EchoTex_Payroll/HRM.DA/DA/Recruitement/ErCVExperienceDA.cs

107 lines
3.9 KiB
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00
using HRM.BO;
using Ease.Core.DataAccess;
using System;
using System.Data;
namespace HRM.DA
{
public class ErCVExperienceDA
{
internal static void InsertErcvExperience(ErCVExperience exprItem, TransactionContext tc)
{
DateTime? ToDate;
if (exprItem.ToDate == DateTime.MinValue)
{
ToDate = null;
}
else ToDate = exprItem.ToDate;
string sql =
SQLParser.MakeSQL(
@"INSERT INTO ERCVEXPERIENCE
(
CVExperienceID, Employeer, ContactPerson,
Address, Industry, Designation,
FROMDATE, TODATE, Telephone,
RoleDefination, CVID,Mobile
)
VALUES
(
%n, %s, %s,
%s, %s, %s,
%d, %d, %s,
%s, %n,%s
)",
exprItem.ID, exprItem.Employeer, exprItem.ContactPerson,
exprItem.Address, exprItem.Industry, exprItem.Designation,
exprItem.FromDate, DataReader.GetNullValue(ToDate), exprItem.Telephone,
exprItem.RoleDefination, exprItem.CVID, exprItem.Mobile);
tc.ExecuteNonQuery(sql);
}
internal static void UpdateErcvExperience(ErCVExperience exprItem, TransactionContext tc)
{
DateTime? ToDate;
if (exprItem.ToDate == DateTime.MinValue)
{
ToDate = null;
}
else ToDate = exprItem.ToDate;
string sql =
SQLParser.MakeSQL(
@"UPDATE ERCVEXPERIENCE
SET
Employeer = %s,
ContactPerson = %s,
Address = %s,
Industry = %s,
Designation = %s,
FROMDATE = %d,
TODATE = %d,
Telephone = %s,
RoleDefination = %s,
CVID = %n,
Mobile=%s
WHERE CVExperienceID = %n",
exprItem.Employeer, exprItem.ContactPerson, exprItem.Address, exprItem.Industry,
exprItem.Designation, exprItem.FromDate, DataReader.GetNullValue(ToDate), exprItem.Telephone, exprItem.RoleDefination, exprItem.Mobile, exprItem.ID);
tc.ExecuteNonQuery(sql);
}
internal static void Delete(int iD, TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"Delete From ErCVExperience Where CVID = %n", iD);
tc.ExecuteNonQuery(sql);
}
internal static void DeleteByCvId(int oID, TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"Delete From ErCVExperience Where CVID = %n", oID);
tc.ExecuteNonQuery(sql);
}
//internal static void InsertChild(HeadCountRequestEmp item, TransactionContext tc)
//{
// string sql = SQLParser.MakeSQL(@"INSERT INTO HeadCountRequestEmp
// (
// HeadCountRequestEmpID,
// HeadCountApprovalRequestID,
// EmployeeID,
// Department,
// Designation
// )
// VALUES
// (
// %n,
// %n,
// %n,
// %s,
// %s
// )", item.ID, item.HeadCountApprovalRequestID, item.EmployeeID, item.Department, item.Designation);
// tc.ExecuteNonQuery(sql);
//}
}
}