CEL_Payroll/Payroll.Service/Recruitement/DA/CVDA.cs

126 lines
5.3 KiB
C#
Raw Permalink Normal View History

2024-09-17 14:30:13 +06:00
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Ease.CoreV35.DataAccess;
using Ease.CoreV35.Model;
using Payroll.BO;
namespace Payroll.Service
{
public class CVDA
{
internal static void InsertCVBase(CV obCv,TransactionContext tc)
{
int? createdBy = null;
if(obCv.CreatedBy == null && obCv.CreatedBy.IsUnassigned == true)
{
createdBy = null;
}
else
{
createdBy = obCv.CreatedBy.Integer;
}
DateTime? creationDate;
if (obCv.CreatedDate == null)
{
creationDate = null;
}
else
{
creationDate = obCv.CreatedDate;
}
//DataReader.GetNullValue(item.ApprovarID,IDType.Integer)
string sql = SQLParser.MakeSQL(@"Insert Into CVMain(CvID,TrackNo,TotalYearOfExperience,SpecialSkill,OrganPositionId,NationalId,Name,MotherName,MobileNo,FileAddress,
FatherName,ExpectedMinimumSalary,LandPhoneNo,EmailAddress,IsFresher,ContactAddress,ApplicationDate,CreatedBy,CreationDate,DesignationID) Values(%n,%s,%n,%s,%n,%s,%s,%s,%s,%s,
%s,%n,%s,%s,%n,%s,%d,%n,%d,%n)", obCv.ID.Integer, obCv.TrackNo, obCv.TotalYearOfExperience, obCv.SpecialSkill, DataReader.GetNullValue(obCv.OrganPositionId, IDType.Integer), obCv.NationalId, obCv.Name, obCv.MotherName, obCv.MobileNo,
obCv.FileAddress, obCv.FatherName, obCv.ExpectedMinimumSalary, obCv.LandPhoneNo, obCv.EmailAddress, Convert.ToInt32(obCv.IsFresher), obCv.ContactAddress, obCv.ApplicationDate, DataReader.GetNullValue(createdBy), DataReader.GetNullValue(creationDate),
DataReader.GetNullValue(obCv.Designation, IDType.Integer));
tc.ExecuteNonQuery(sql);
}
internal static void UpdateCVBase(CV obCv, TransactionContext tc)
{
int? modifiedBy = null;
if (obCv.ModifiedBy == null && obCv.ModifiedBy.IsUnassigned == true)
{
modifiedBy = null;
}
else
{
modifiedBy = obCv.ModifiedBy.Integer;
}
DateTime? modificationDate;
if (obCv.ModifiedDate == null)
{
modificationDate = null;
}
else
{
modificationDate = obCv.ModifiedDate;
}
string sql = SQLParser.MakeSQL(@"Update CVMain Set TrackNo = %s,TotalYearOfExperience = %n,SpecialSkill = %s,OrganPositionId = %n,NationalId = %s,Name = %s,MotherName = %s,MobileNo = %s,FileAddress = %s,
FatherName = %s,ExpectedMinimumSalary = %n,LandPhoneNo = %s,EmailAddress = %s,IsFresher = %n ,ContactAddress = %s ,ApplicationDate = %d,ModifiedBy = %n,ModificationDate = %d,DesignationID = %n Where CvId = %n", obCv.TrackNo, obCv.TotalYearOfExperience, obCv.SpecialSkill, DataReader.GetNullValue(obCv.OrganPositionId, IDType.Integer), obCv.NationalId, obCv.Name, obCv.MotherName, obCv.MobileNo,
obCv.FileAddress, obCv.FatherName, obCv.ExpectedMinimumSalary, obCv.LandPhoneNo, obCv.EmailAddress, Convert.ToInt32(obCv.IsFresher), obCv.ContactAddress, obCv.ApplicationDate, DataReader.GetNullValue(modifiedBy), DataReader.GetNullValue(modificationDate), DataReader.GetNullValue(obCv.Designation, IDType.Integer),obCv.ID.Integer);
tc.ExecuteNonQuery(sql);
}
internal static IDataReader GetReferredBy(ID cVID, TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"Select * From CVReferredBy Where CvId = %n", cVID.Integer);
return tc.ExecuteReader(sql);
}
internal static IDataReader GetCVOrgByID(ID cVID, TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"Select * From CVOrg Where CvId = %n", cVID.Integer);
return tc.ExecuteReader(sql);
}
internal static IDataReader GetEducationQualifications(ID cVID, TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"Select * From CVEductionalQualification Where CvId = %n",cVID.Integer);
return tc.ExecuteReader(sql);
}
internal static IDataReader GetExperiences(ID cVID, TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"Select * From CVExperience Where CvId = %n", cVID.Integer);
return tc.ExecuteReader(sql);
}
internal static IDataReader Get(TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"Select * From CVMain");
return tc.ExecuteReader(sql);
}
internal static IDataReader Get(ID cVID, TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"Select * From CVMain Where CvID = %n", cVID.Integer);
return tc.ExecuteReader(sql);
}
internal static void Delete(ID iD, TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"Delete From CVMain Where CvID = %n", iD.Integer);
tc.ExecuteNonQuery(sql);
}
internal static IDataReader GetByQuery(string query, TransactionContext tc)
{
return tc.ExecuteReader(query);
}
}
}