using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35.Model; using System.Data.SqlClient; using Ease.CoreV35.DataAccess; using Payroll.BO; using System.Data; using Ease.CoreV35.DataAccess.SQL; namespace Payroll.Service { public class RecruitmentLettersDA { #region Constructor private RecruitmentLettersDA() { } #endregion #region Get internal static System.Data.IDataReader Get(Ease.CoreV35.DataAccess.TransactionContext tc, Ease.CoreV35.Model.ID id) { return tc.ExecuteReader("SELECT * FROM RecruitmentLetters WHERE RecruitmentLetterID=%n", id.Integer); } internal static System.Data.IDataReader GetByCandidateID(Ease.CoreV35.DataAccess.TransactionContext tc, Ease.CoreV35.Model.ID id) { return tc.ExecuteReader("SELECT * FROM RecruitmentLetters WHERE CandidateID=%n", id.Integer); } internal static System.Data.IDataReader Get(Ease.CoreV35.DataAccess.TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM RecruitmentLetters"); } internal static System.Data.IDataReader GetByProcessID(Ease.CoreV35.DataAccess.TransactionContext tc,ID nProcessID) { return tc.ExecuteReader("SELECT * FROM RecruitmentLetters where ProcessID=%n",nProcessID.Integer); } #endregion #region Update internal static void Update(Ease.CoreV35.DataAccess.TransactionContext tc, RecruitmentLetters oRecruitmentLetters) { //,EmployeeID=%n oRecruitmentLetters.EmployeeID.Integer, string sSQL = SQLParser.MakeSQL("UPDATE RecruitmentLetters SET "+ " [CandidateID]=%n,[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 [RecruitmentLetterID]=%n", oRecruitmentLetters.CandidateID.Integer, 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.Integer), DataReader.GetNullValue(oRecruitmentLetters.OfferCreatedDate), DataReader.GetNullValue(oRecruitmentLetters.GradeID.Integer), DataReader.GetNullValue(oRecruitmentLetters.BasicSalary), DataReader.GetNullValue(oRecruitmentLetters.DepartmentID.Integer), DataReader.GetNullValue(oRecruitmentLetters.LocationID.Integer), DataReader.GetNullValue(oRecruitmentLetters.NoticePeriod), DataReader.GetNullValue(oRecruitmentLetters.AppAcceptBefore), DataReader.GetNullValue(oRecruitmentLetters.IssueAppLetterDate), DataReader.GetNullValue(oRecruitmentLetters.RejectAppLetterDate), oRecruitmentLetters.RejectAppLetterReason, oRecruitmentLetters.CarEligible, DataReader.GetNullValue(oRecruitmentLetters.AppCreatedBy.Integer), 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.Integer), DataReader.GetNullValue(oRecruitmentLetters.OtherCreateddate), DataReader.GetNullValue(oRecruitmentLetters.ModifiedBy.Integer), DataReader.GetNullValue(oRecruitmentLetters.ModifiedDate), oRecruitmentLetters.ProcessID.Integer, DataReader.GetNullValue(oRecruitmentLetters.JoiningBeforeDate), DataReader.GetNullValue(oRecruitmentLetters.ConfirmJoiningDate), oRecruitmentLetters.ID.Integer); tc.ExecuteNonQuery(sSQL); } #endregion #region Insert internal static void Insert(Ease.CoreV35.DataAccess.TransactionContext tc, RecruitmentLetters oRecruitmentLetters) { //,EmployeeID ,%n ,oRecruitmentLetters.EmployeeID.Integer string sSQL = SQLParser.MakeSQL("INSERT INTO RecruitmentLetters(RecruitmentLetterID, 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, %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.Integer, oRecruitmentLetters.CandidateID.Integer, 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.Integer), DataReader.GetNullValue(oRecruitmentLetters.OfferCreatedDate), DataReader.GetNullValue(oRecruitmentLetters.GradeID.Integer), DataReader.GetNullValue(oRecruitmentLetters.BasicSalary), DataReader.GetNullValue(oRecruitmentLetters.DepartmentID.Integer), DataReader.GetNullValue(oRecruitmentLetters.LocationID.Integer), DataReader.GetNullValue(oRecruitmentLetters.NoticePeriod), DataReader.GetNullValue(oRecruitmentLetters.AppAcceptBefore), DataReader.GetNullValue(oRecruitmentLetters.IssueAppLetterDate), DataReader.GetNullValue(oRecruitmentLetters.RejectAppLetterDate), oRecruitmentLetters.RejectAppLetterReason, oRecruitmentLetters.CarEligible, DataReader.GetNullValue(oRecruitmentLetters.AppCreatedBy.Integer), 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.Integer), DataReader.GetNullValue(oRecruitmentLetters.OtherCreateddate), DataReader.GetNullValue(oRecruitmentLetters.CreatedBy.Integer), DataReader.GetNullValue(oRecruitmentLetters.CreatedDate),oRecruitmentLetters.ProcessID.Integer, DataReader.GetNullValue(oRecruitmentLetters.JoiningBeforeDate), DataReader.GetNullValue(oRecruitmentLetters.ConfirmJoiningDate)); tc.ExecuteNonQuery(sSQL); } #endregion #region Delete internal static void Delete(Ease.CoreV35.DataAccess.TransactionContext tc, Ease.CoreV35.Model.ID id) { tc.ExecuteNonQuery("DELETE FROM [RecruitmentLetters] WHERE RecruitmentLetterID=%n", id.Integer); } #endregion } }