using HRM.BO; using Ease.Core.DataAccess; using System; using System.Data; namespace HRM.DA { public class RecruitmentLettersDA { #region Constructor private RecruitmentLettersDA() { } #endregion #region Get internal static System.Data.IDataReader Get(Ease.Core.DataAccess.TransactionContext tc, int id) { return tc.ExecuteReader("SELECT * FROM RECRUITMENTLETTERS WHERE RecruitmentLetterID=%n", id); } internal static System.Data.IDataReader GetByCandidateID(Ease.Core.DataAccess.TransactionContext tc, int id) { return tc.ExecuteReader("SELECT * FROM RECRUITMENTLETTERS WHERE CandidateID=%n", id); } internal static System.Data.IDataReader Get(Ease.Core.DataAccess.TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM RECRUITMENTLETTERS"); } internal static System.Data.IDataReader GetbyRequisitionID(Ease.Core.DataAccess.TransactionContext tc, int requisitionID) { return tc.ExecuteReader("SELECT * FROM RECRUITMENTLETTERS where RequisitionID=%n", requisitionID); } internal static System.Data.IDataReader GetByProcessID(Ease.Core.DataAccess.TransactionContext tc, int nProcessID) { return tc.ExecuteReader("SELECT * FROM RECRUITMENTLETTERS where ProcessID=%n", nProcessID); } #endregion #region Update internal static void Update(Ease.Core.DataAccess.TransactionContext tc, RecruitmentLetters oRECRUITMENTLETTERS) { //,EmployeeID=%n oRECRUITMENTLETTERS.EmployeeID, string sSQL = SQLParser.MakeSQL("UPDATE RECRUITMENTLETTERS SET " + " [AcceptOfferBefore]=%d,[IssueOfferDate]=%d," + " [AcceptOfferDate]=%d,[RejectOfferDate]=%d,[RejectOfferReason]=%s," + " [OfferLetterCount]=%n,[OfferCreatedBy]=%n,[OfferCreatedDate]=%d," + " [GradeID]=%n,[BasicSalary]=%n,[DepartmentID]=%n,[LocationID]=%n," + " [NoticePeriod]=%n,[AppAcceptBefore]=%d,[IssueAppLetterDate]=%d," + " [RejectAppLetterDate]=%d,[RejectAppLetterReason]=%s,[CarEligible]=%b," + " [AppCreatedBy]=%n,[AppCreatedDate]=%d,[AppLetterCount]=%n," + " [JoiningLetter]=%b,[VendorMail]=%b,[WelcomeMail]=%b," + " [InductionRequest]=%b,[Announcement]=%b,[OtherLetters]=%b," + " [OthersCount]=%n,[OtherCreatedBy]=%n,[OtherCreateddate]=%d," + " [ModifiedBy]=%n,[ModifiedDate]=%d,ProcessID=%n,JoiningBeforeDate=%d,ConfirmJoiningDate=%d WHERE [RequisitionID]=%n and [CandidateID]=%n", DataReader.GetNullValue(oRECRUITMENTLETTERS.AcceptOfferBefore), DataReader.GetNullValue(oRECRUITMENTLETTERS.IssueOfferDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.AcceptOfferDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.RejectOfferDate), oRECRUITMENTLETTERS.RejectOfferReason, DataReader.GetNullValue(oRECRUITMENTLETTERS.OfferLetterCount), DataReader.GetNullValue(oRECRUITMENTLETTERS.OfferCreatedBy), DataReader.GetNullValue(oRECRUITMENTLETTERS.OfferCreatedDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.GradeID), DataReader.GetNullValue(oRECRUITMENTLETTERS.BasicSalary), DataReader.GetNullValue(oRECRUITMENTLETTERS.DepartmentID), DataReader.GetNullValue(oRECRUITMENTLETTERS.LocationID), DataReader.GetNullValue(oRECRUITMENTLETTERS.NoticePeriod), DataReader.GetNullValue(oRECRUITMENTLETTERS.AppAcceptBefore), DataReader.GetNullValue(oRECRUITMENTLETTERS.IssueAppLetterDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.RejectAppLetterDate), oRECRUITMENTLETTERS.RejectAppLetterReason, oRECRUITMENTLETTERS.CarEligible, DataReader.GetNullValue(oRECRUITMENTLETTERS.AppCreatedBy), DataReader.GetNullValue(oRECRUITMENTLETTERS.AppCreatedDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.AppLetterCount), oRECRUITMENTLETTERS.JoiningLetter, oRECRUITMENTLETTERS.VendorMail, oRECRUITMENTLETTERS.WelcomeMail, oRECRUITMENTLETTERS.InductionRequest, oRECRUITMENTLETTERS.Announcement, oRECRUITMENTLETTERS.OtherLetters, DataReader.GetNullValue(oRECRUITMENTLETTERS.OthersCount), DataReader.GetNullValue(oRECRUITMENTLETTERS.OtherCreatedBy), DataReader.GetNullValue(oRECRUITMENTLETTERS.OtherCreateddate), DataReader.GetNullValue(oRECRUITMENTLETTERS.ModifiedBy), DataReader.GetNullValue(oRECRUITMENTLETTERS.ModifiedDate), oRECRUITMENTLETTERS.ProcessID, DataReader.GetNullValue(oRECRUITMENTLETTERS.JoiningBeforeDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.ConfirmJoiningDate), oRECRUITMENTLETTERS.RequisitionID, oRECRUITMENTLETTERS.CandidateID); tc.ExecuteNonQuery(sSQL); } #endregion #region Insert internal static void Insert(Ease.Core.DataAccess.TransactionContext tc, RecruitmentLetters oRECRUITMENTLETTERS) { //,EmployeeID ,%n ,oRECRUITMENTLETTERS.EmployeeID string sSQL = SQLParser.MakeSQL("INSERT INTO RECRUITMENTLETTERS(RecruitmentLetterID, RequisitionID, CandidateID," + " AcceptOfferBefore, IssueOfferDate,AcceptOfferDate,RejectOfferDate," + " RejectOfferReason, OfferLetterCount,OfferCreatedBy,OfferCreatedDate," + " GradeID,BasicSalary,DepartmentID,LocationID,NoticePeriod," + " AppAcceptBefore,IssueAppLetterDate,RejectAppLetterDate," + " RejectAppLetterReason,CarEligible,AppCreatedBy,AppCreatedDate," + " AppLetterCount,JoiningLetter,VendorMail,WelcomeMail,InductionRequest," + " Announcement,OtherLetters,OthersCount,OtherCreatedBy,OtherCreateddate," + " CreatedBy, CreationDate,ProcessID,JoiningBeforeDate,ConfirmJoiningDate)" + " VALUES(%n, %n, %n, %d, %d, %d, %d,%s, %n,%n,%d,%n,%n,%n,%n,%n,%d,%d,%d," + " %s,%b,%n,%d,%n,%b,%b,%b,%b,%b,%b,%n,%n,%d,%n,%d,%n,%d,%d)", oRECRUITMENTLETTERS.ID, oRECRUITMENTLETTERS.RequisitionID, oRECRUITMENTLETTERS.CandidateID, DataReader.GetNullValue(oRECRUITMENTLETTERS.AcceptOfferBefore), DataReader.GetNullValue(oRECRUITMENTLETTERS.IssueOfferDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.AcceptOfferDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.RejectOfferDate), oRECRUITMENTLETTERS.RejectOfferReason, DataReader.GetNullValue(oRECRUITMENTLETTERS.OfferLetterCount), DataReader.GetNullValue(oRECRUITMENTLETTERS.OfferCreatedBy), DataReader.GetNullValue(oRECRUITMENTLETTERS.OfferCreatedDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.GradeID), DataReader.GetNullValue(oRECRUITMENTLETTERS.BasicSalary), DataReader.GetNullValue(oRECRUITMENTLETTERS.DepartmentID), DataReader.GetNullValue(oRECRUITMENTLETTERS.LocationID), DataReader.GetNullValue(oRECRUITMENTLETTERS.NoticePeriod), DataReader.GetNullValue(oRECRUITMENTLETTERS.AppAcceptBefore), DataReader.GetNullValue(oRECRUITMENTLETTERS.IssueAppLetterDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.RejectAppLetterDate), oRECRUITMENTLETTERS.RejectAppLetterReason, oRECRUITMENTLETTERS.CarEligible, DataReader.GetNullValue(oRECRUITMENTLETTERS.AppCreatedBy), DataReader.GetNullValue(oRECRUITMENTLETTERS.AppCreatedDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.AppLetterCount), oRECRUITMENTLETTERS.JoiningLetter, oRECRUITMENTLETTERS.VendorMail, oRECRUITMENTLETTERS.WelcomeMail, oRECRUITMENTLETTERS.InductionRequest, oRECRUITMENTLETTERS.Announcement, oRECRUITMENTLETTERS.OtherLetters, DataReader.GetNullValue(oRECRUITMENTLETTERS.OthersCount), DataReader.GetNullValue(oRECRUITMENTLETTERS.OtherCreatedBy), DataReader.GetNullValue(oRECRUITMENTLETTERS.OtherCreateddate), DataReader.GetNullValue(oRECRUITMENTLETTERS.CreatedBy), DataReader.GetNullValue(oRECRUITMENTLETTERS.CreatedDate), oRECRUITMENTLETTERS.ProcessID, DataReader.GetNullValue(oRECRUITMENTLETTERS.JoiningBeforeDate), DataReader.GetNullValue(oRECRUITMENTLETTERS.ConfirmJoiningDate)); tc.ExecuteNonQuery(sSQL); } #endregion #region Delete internal static void Delete(Ease.Core.DataAccess.TransactionContext tc, int id) { tc.ExecuteNonQuery("DELETE FROM RECRUITMENTLETTERS WHERE RecruitmentLetterID=%n", id); } #endregion } }