106 lines
3.8 KiB
C#
106 lines
3.8 KiB
C#
|
using HRM.BO;
|
|||
|
using Ease.Core.DataAccess;
|
|||
|
using System;
|
|||
|
using System.Data;
|
|||
|
|
|||
|
namespace HRM.DA
|
|||
|
{
|
|||
|
public class ExperienceDA
|
|||
|
{
|
|||
|
internal static void InsertExperience(CVExperience exprItem, TransactionContext tc)
|
|||
|
{
|
|||
|
DateTime? ToDate;
|
|||
|
|
|||
|
|
|||
|
if (exprItem.ToDate == DateTime.MinValue)
|
|||
|
{
|
|||
|
ToDate = null;
|
|||
|
}
|
|||
|
else ToDate = exprItem.ToDate;
|
|||
|
|
|||
|
string sql =
|
|||
|
SQLParser.MakeSQL(
|
|||
|
@"INSERT INTO CVEXPERIENCE
|
|||
|
(
|
|||
|
CVExperienceID, Employeer, ContactPerson,
|
|||
|
Address, Industry, Designation,
|
|||
|
FROMDATE, TODATE, Telephone,
|
|||
|
RoleDefination, CVID
|
|||
|
)
|
|||
|
VALUES
|
|||
|
(
|
|||
|
%n, %s, %s,
|
|||
|
%s, %s, %s,
|
|||
|
%d, %d, %s,
|
|||
|
%s, %n
|
|||
|
)",
|
|||
|
exprItem.ID, exprItem.Employeer, exprItem.ContactPerson,
|
|||
|
exprItem.Address, exprItem.Industry, exprItem.Designation,
|
|||
|
exprItem.FromDate, DataReader.GetNullValue(ToDate), exprItem.Telephone,
|
|||
|
exprItem.RoleDefination, exprItem.CVID);
|
|||
|
tc.ExecuteNonQuery(sql);
|
|||
|
}
|
|||
|
|
|||
|
internal static void UpdateExperience(CVExperience exprItem, TransactionContext tc)
|
|||
|
{
|
|||
|
DateTime? ToDate;
|
|||
|
if (exprItem.ToDate == DateTime.MinValue)
|
|||
|
{
|
|||
|
ToDate = null;
|
|||
|
}
|
|||
|
else ToDate = exprItem.ToDate;
|
|||
|
|
|||
|
string sql =
|
|||
|
SQLParser.MakeSQL(
|
|||
|
@"UPDATE CVEXPERIENCE
|
|||
|
SET
|
|||
|
Employeer = %s,
|
|||
|
ContactPerson = %s,
|
|||
|
Address = %s,
|
|||
|
Industry = %s,
|
|||
|
Designation = %s,
|
|||
|
FROMDATE = %d,
|
|||
|
TODATE = %d,
|
|||
|
Telephone = %s,
|
|||
|
RoleDefination = %s,
|
|||
|
CVID = %n
|
|||
|
WHERE CVExperienceID = %n",
|
|||
|
exprItem.Employeer, exprItem.ContactPerson, exprItem.Address, exprItem.Industry,
|
|||
|
exprItem.Designation, exprItem.FromDate, DataReader.GetNullValue(ToDate), exprItem.Telephone, exprItem.RoleDefination, exprItem.ID);
|
|||
|
tc.ExecuteNonQuery(sql);
|
|||
|
}
|
|||
|
|
|||
|
internal static void Delete(int iD, TransactionContext tc)
|
|||
|
{
|
|||
|
string sql = SQLParser.MakeSQL(@"Delete From CVExperience Where CVID = %n", iD);
|
|||
|
tc.ExecuteNonQuery(sql);
|
|||
|
}
|
|||
|
|
|||
|
internal static void DeleteByCvId(int oID, TransactionContext tc)
|
|||
|
{
|
|||
|
string sql = SQLParser.MakeSQL(@"Delete From CVExperience 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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|