using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35; using Ease.CoreV35.Model; using Ease.CoreV35.Caching; using System.Data.Linq.Mapping; namespace Payroll.BO { #region RecruitmentLetters [Serializable] public class RecruitmentLetters : BasicBaseObject { public delegate void ItemChanged(); #region Cache Store private static Cache _cache = new Cache(typeof(RecruitmentLetters)); #endregion #region Constructor public RecruitmentLetters() { _nProcessID = ID.FromInteger(0); _nCandidateID = ID.FromInteger(0); _dacceptOfferBefore = DateTime.MinValue; _dIssueOfferDate = DateTime.MinValue; _dAcceptOfferDate = DateTime.MinValue; _dRejectOfferDate = DateTime.MinValue; _sRejectOfferReason = string.Empty; _nOfferLetterCount = 0; _nOfferCreatedBy = null; _nOfferCreatedDate = DateTime.MinValue; _nGradeID =ID.FromInteger(0); _dBasicSalary = 0; _nDepartmentID = ID.FromInteger(0); _nLocationID = ID.FromInteger(0); _nNoticePeriod = 0; _dAppAcceptBefore = DateTime.MinValue; _dIssueAppLetterDate = DateTime.MinValue; _dRejectAppLetterDate = DateTime.MinValue; _sRejectAppLetterReason = string.Empty; _bCarEligible = false; _nAppCreatedBy = ID.FromInteger(0); _dAppCreatedDate = DateTime.MinValue; _nAppLetterCount = 0; _bJoiningLetter = false; _bVendorMail = false; _bWelcomeMail = false; _bInductionRequest = false; _bAnnouncement = false; _bOtherLetters = false; _nOthersCount = 0; _nOtherCreatedBy = ID.FromInteger(0); _dOtherCreatedDate = DateTime.MinValue; _dJoiningBeforeDate = DateTime.MinValue; _dConfirmJoiningDate = DateTime.MinValue; //_nEmployeeID = ID.FromInteger(0); } #endregion #region Properties #region CandidateID : ID private ID _nCandidateID; public ID CandidateID { get { return _nCandidateID; } set { base.OnPropertyChange("candidateID", _nCandidateID, value); _nCandidateID = value; } } #endregion #region ProcessID : ID private ID _nProcessID; public ID ProcessID { get { return _nProcessID; } set { base.OnPropertyChange("ProcessID", _nProcessID, value); _nProcessID = value; } } #endregion #region EmployeeID : ID //private ID _nEmployeeID; //public ID EmployeeID //{ // get { return _nEmployeeID; } // set // { // base.OnPropertyChange("EmployeeID", _nEmployeeID, value); // _nEmployeeID = value; // } //} #endregion #region AcceptOfferBefore : DateTime private DateTime _dacceptOfferBefore; public DateTime AcceptOfferBefore { get { return _dacceptOfferBefore; } set { base.OnPropertyChange("acceptOfferBefore", _dacceptOfferBefore, value); _dacceptOfferBefore = value; } } #endregion #region IssueOfferDate : DateTime private DateTime _dIssueOfferDate; public DateTime IssueOfferDate { get { return _dIssueOfferDate; } set { base.OnPropertyChange("issueOfferDate", _dIssueOfferDate, value); _dIssueOfferDate = value; } } #endregion #region AcceptOfferDate : DateTime private DateTime _dAcceptOfferDate; public DateTime AcceptOfferDate { get { return _dAcceptOfferDate; } set { base.OnPropertyChange("acceptOfferDate", _dAcceptOfferDate, value); _dAcceptOfferDate = value; } } #endregion #region RejectOfferDate : DateTime private DateTime _dRejectOfferDate; public DateTime RejectOfferDate { get { return _dRejectOfferDate; } set { base.OnPropertyChange("rejectOfferDate", _dRejectOfferDate, value); _dRejectOfferDate = value; } } #endregion #region RejectOfferReason : string private string _sRejectOfferReason; public string RejectOfferReason { get { return _sRejectOfferReason; } set { base.OnPropertyChange("rejectOfferReason", _sRejectOfferReason, value); _sRejectOfferReason = value; } } #endregion #region OfferLetterCount : int private int _nOfferLetterCount; public int OfferLetterCount { get { return _nOfferLetterCount; } set { base.OnPropertyChange("offerLetterCount", _nOfferLetterCount, value); _nOfferLetterCount = value; } } #endregion #region OfferCreatedBy : ID private ID _nOfferCreatedBy; public ID OfferCreatedBy { get { return _nOfferCreatedBy; } set { base.OnPropertyChange("offerCreatedBy", _nOfferCreatedBy, value); _nOfferCreatedBy = value; } } #endregion #region OfferCreatedDate : DateTime private DateTime _nOfferCreatedDate; public DateTime OfferCreatedDate { get { return _nOfferCreatedDate; } set { base.OnPropertyChange("offerCreatedDate", _nOfferCreatedDate, value); _nOfferCreatedDate = value; } } #endregion #region GradeID private ID _nGradeID; public ID GradeID { get { return _nGradeID; } set { base.OnPropertyChange("gradeID", _nGradeID, value); _nGradeID = value; } } #endregion #region BasicSalary : double private double _dBasicSalary; public double BasicSalary { get { return _dBasicSalary; } set { base.OnPropertyChange("basicSalary", _dBasicSalary, value); _dBasicSalary = value; } } #endregion #region DepartmentID : ID private ID _nDepartmentID; public ID DepartmentID { get { return _nDepartmentID; } set { base.OnPropertyChange("departmentID", _nDepartmentID, value); _nDepartmentID = value; } } #endregion #region LocationID : ID private ID _nLocationID; public ID LocationID { get { return _nLocationID; } set { base.OnPropertyChange("locationID", _nLocationID, value); _nLocationID = value; } } #endregion #region NoticePeriod: int private double _nNoticePeriod; public double NoticePeriod { get { return _nNoticePeriod; } set { base.OnPropertyChange("noticePeriod", _nNoticePeriod, value); _nNoticePeriod = value; } } #endregion #region AppAcceptBefore : DateTime private DateTime _dAppAcceptBefore; public DateTime AppAcceptBefore { get { return _dAppAcceptBefore; } set { base.OnPropertyChange("AppAcceptBefore", _dAppAcceptBefore, value); _dAppAcceptBefore = value; } } #endregion #region IssueAppLetterDate : Date private DateTime _dIssueAppLetterDate; public DateTime IssueAppLetterDate { get { return _dIssueAppLetterDate; } set { base.OnPropertyChange("issueAppLetterDate", _dIssueAppLetterDate, value); _dIssueAppLetterDate = value; } } #endregion #region RejectAppLetterDate : DateTime private DateTime _dRejectAppLetterDate; public DateTime RejectAppLetterDate { get { return _dRejectAppLetterDate; } set { base.OnPropertyChange("rejectAppLetterDate", _dRejectAppLetterDate, value); _dRejectAppLetterDate = value; } } #endregion #region RejectAppLetterReason : string private string _sRejectAppLetterReason; public string RejectAppLetterReason { get { return _sRejectAppLetterReason; } set { base.OnPropertyChange("rejectAppLetterReason", _sRejectAppLetterReason, value); _sRejectAppLetterReason = value; } } #endregion #region CarEligible : Boolean private bool _bCarEligible; public bool CarEligible { get { return _bCarEligible; } set { base.OnPropertyChange("CarEligible", _bCarEligible, value); _bCarEligible = value; } } #endregion #region AppCreatedBy : ID private ID _nAppCreatedBy; public ID AppCreatedBy { get { return _nAppCreatedBy; } set { base.OnPropertyChange("appCreatedBy", _nAppCreatedBy, value); _nAppCreatedBy = value; } } #endregion #region AppCreatedDate : DateTime private DateTime _dAppCreatedDate; public DateTime AppCreatedDate { get { return _dAppCreatedDate; } set { base.OnPropertyChange("appCreatedDate", _dAppCreatedDate, value); _dAppCreatedDate = value; } } #endregion #region AppLetterCount : int private int _nAppLetterCount; public int AppLetterCount { get { return _nAppLetterCount; } set { base.OnPropertyChange("appLetterCount", _nAppLetterCount, value); _nAppLetterCount = value; } } #endregion #region JoiningLetter : Boolean private bool _bJoiningLetter; public bool JoiningLetter { get { return _bJoiningLetter; } set { base.OnPropertyChange("joiningLetter", _bJoiningLetter, value); _bJoiningLetter = value; } } #endregion #region VendorMail : Boolean private bool _bVendorMail; public bool VendorMail { get { return _bVendorMail; } set { base.OnPropertyChange("vendorMail", _bVendorMail, value); _bVendorMail = value; } } #endregion #region WelcomeMail : Boolean private bool _bWelcomeMail; public bool WelcomeMail { get { return _bWelcomeMail; } set { base.OnPropertyChange("welcomeMail", _bWelcomeMail, value); _bWelcomeMail = value; } } #endregion #region InductionRequest : Boolean private bool _bInductionRequest; public bool InductionRequest { get { return _bInductionRequest; } set { base.OnPropertyChange("inductionRequest", _bInductionRequest, value); _bInductionRequest = value; } } #endregion #region Announcement : Boolean private bool _bAnnouncement; public bool Announcement { get { return _bAnnouncement; } set { base.OnPropertyChange("announcement", _bAnnouncement, value); _bAnnouncement = value; } } #endregion #region OtherLetters : Boolean private bool _bOtherLetters; public bool OtherLetters { get { return _bOtherLetters; } set { base.OnPropertyChange("otherLetters", _bOtherLetters, value); _bOtherLetters = value; } } #endregion #region OthersCount : int private int _nOthersCount; public int OthersCount { get { return _nOthersCount; } set { base.OnPropertyChange("othersCount", _nOthersCount, value); _nOthersCount = value; } } #endregion #region OtherCreatedBy : ID private ID _nOtherCreatedBy; public ID OtherCreatedBy { get { return _nOtherCreatedBy; } set { base.OnPropertyChange("otherCreatedBy", _nOtherCreatedBy, value); _nOtherCreatedBy = value; } } #endregion #region OtherCreateddate : DateTime private DateTime _dOtherCreatedDate; public DateTime OtherCreateddate { get { return _dOtherCreatedDate; } set { base.OnPropertyChange("otherCreateddate", _dOtherCreatedDate, value); _dOtherCreatedDate = value; } } #endregion #region JoiningBeforeDate : DateTime private DateTime _dJoiningBeforeDate; public DateTime JoiningBeforeDate { get { return _dJoiningBeforeDate; } set { base.OnPropertyChange("JoiningBeforeDate", _dJoiningBeforeDate, value); _dJoiningBeforeDate = value; } } #endregion #region ConfirmJoiningDate : DateTime private DateTime _dConfirmJoiningDate; public DateTime ConfirmJoiningDate { get { return _dConfirmJoiningDate; } set { base.OnPropertyChange("ConfirmJoiningDate", _dConfirmJoiningDate, value); _dConfirmJoiningDate = value; } } #endregion #endregion #region Service Factory IRecruitmentLettersService : IRecruitmentLettersService internal static IRecruitmentLettersService Service { get { return Services.Factory.CreateService(typeof(IRecruitmentLettersService)); } } #endregion #region Functions public static RecruitmentLetters Get(ID nID) { RecruitmentLetters RecruitmentLetter = null; #region Cache Header RecruitmentLetter = (RecruitmentLetters)_cache["Get", nID]; if (RecruitmentLetter != null) return RecruitmentLetter; #endregion RecruitmentLetter = RecruitmentLetters.Service.Get(nID); #region Cache Footer _cache.Add(RecruitmentLetter, "Get", nID); #endregion return RecruitmentLetter; } public static RecruitmentLetters GetByCandidateID(ID nCandidateID) { RecruitmentLetters RecruitmentLetter = null; #region Cache Header RecruitmentLetter = (RecruitmentLetters)_cache["GetByCandidateID", nCandidateID]; if (RecruitmentLetter != null) return RecruitmentLetter; #endregion RecruitmentLetter = RecruitmentLetters.Service.GetByCandidateID(nCandidateID); #region Cache Footer _cache.Add(RecruitmentLetter, "GetByCandidateID", nCandidateID); #endregion return RecruitmentLetter; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate recruitmentLetters = _cache["Get"] as ObjectsTemplate; if (recruitmentLetters != null) return recruitmentLetters; #endregion try { recruitmentLetters = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(recruitmentLetters, "Get"); #endregion return recruitmentLetters; } public static ObjectsTemplate GetByProcessID(ID nProcessID) { #region Cache Header ObjectsTemplate recruitmentLetters = _cache["GetByProcessID", nProcessID] as ObjectsTemplate; if (recruitmentLetters != null) return recruitmentLetters; #endregion try { recruitmentLetters = Service.GetByProcessID(nProcessID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(recruitmentLetters, "GetByProcessID"); #endregion return recruitmentLetters; } public ID Save(int CheckValue) { base.SetAuditTrailProperties(); return RecruitmentLetters.Service.Save(this,CheckValue); } public void Delete() { RecruitmentLetters.Service.Delete(ID); } public void Save(ObjectsTemplate inventories) { base.SetAuditTrailProperties(); RecruitmentLetters.Service.Save(inventories); } #endregion } #endregion #region IRecruitmentLettersService public interface IRecruitmentLettersService { RecruitmentLetters Get(ID id); RecruitmentLetters GetByCandidateID(ID nCandidateID); ObjectsTemplate Get(); ObjectsTemplate GetByProcessID(ID nProcessID); ID Save(RecruitmentLetters item,int checkValue); void Save(ObjectsTemplate letters); void Delete(ID id); } #endregion }