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 ExitInterview [Serializable] public class ExitInterview : AuditTrailBase { #region Cache Store private static Cache _cache = new Cache(typeof(ExitInterview)); #endregion #region Constructor public ExitInterview() { _EmployeeID = null; _Name = string.Empty; _JobTitle = string.Empty; _DepartmentName = string.Empty; _ManagerName = string.Empty; _SourceofHire = string.Empty; _HireDate = null; _TermDate = null; _ExitInteviewDate = DateTime.Today; //_ReasonsforLeaving = string.Empty; _CultureandClimate = string.Empty; _CareerDevelopment = string.Empty; _Settingobjectives = string.Empty; _providingfeedbackonperformance = string.Empty; _facilitatingteamwork = string.Empty; _communicatinginformationaffects = string.Empty; _relationshipwithemployees = string.Empty; _other = string.Empty; _AdditionalComments = string.Empty; _CommentForCompany = string.Empty; } #endregion #region Properties #region _EmployeeID : ID private ID _EmployeeID; public ID EmployeeID { get { return _EmployeeID; } set { base.OnPropertyChange("EmployeeID", _EmployeeID, value); _EmployeeID = value; } } #endregion #region _ExitInteviewDate : DateTime private DateTime _ExitInteviewDate; public DateTime ExitInteviewDate { get { return _ExitInteviewDate; } set { base.OnPropertyChange("ExitInteviewDate", _ExitInteviewDate, value); _ExitInteviewDate = value; } } #endregion #region _TermDate : DateTime private DateTime? _TermDate; public DateTime? TermDate { get { return _TermDate; } set { base.OnPropertyChange("TermDate", _TermDate, value); _TermDate = value; } } #endregion #region _HireDate : DateTime private DateTime? _HireDate; public DateTime? HireDate { get { return _HireDate; } set { base.OnPropertyChange("HireDate", _HireDate, value); _HireDate = value; } } #endregion #region _CommentForCompany : string private string _CommentForCompany; public string CommentForCompany { get { return _CommentForCompany; } set { base.OnPropertyChange("CommentForCompany", _CommentForCompany, value); _CommentForCompany = value; } } #endregion #region _AdditionalComments : string private string _AdditionalComments; public string AdditionalComments { get { return _AdditionalComments; } set { base.OnPropertyChange("AdditionalComments", _AdditionalComments, value); _AdditionalComments = value; } } #endregion #region _other : string private string _other; public string Other { get { return _other; } set { base.OnPropertyChange("Other", _other, value); _other = value; } } #endregion #region _relationshipwithemployees : string private string _relationshipwithemployees; public string Relationshipwithemployees { get { return _relationshipwithemployees; } set { base.OnPropertyChange("Relationshipwithemployees", _relationshipwithemployees, value); _relationshipwithemployees = value; } } #endregion #region _communicatinginformationaffects : string private string _communicatinginformationaffects; public string Communicatinginformationaffects { get { return _communicatinginformationaffects; } set { base.OnPropertyChange("Communicatinginformationaffects", _communicatinginformationaffects, value); _communicatinginformationaffects = value; } } #endregion #region _facilitatingteamwork : string private string _facilitatingteamwork; public string Facilitatingteamwork { get { return _facilitatingteamwork; } set { base.OnPropertyChange("Facilitatingteamwork", _facilitatingteamwork, value); _facilitatingteamwork = value; } } #endregion #region _Settingobjectives : string private string _Settingobjectives; public string Settingobjectives { get { return _Settingobjectives; } set { base.OnPropertyChange("Settingobjectives", _Settingobjectives, value); _Settingobjectives = value; } } #endregion #region _providingfeedbackonperformance : string private string _providingfeedbackonperformance; public string Providingfeedbackonperformance { get { return _providingfeedbackonperformance; } set { base.OnPropertyChange("Providingfeedbackonperformance", _providingfeedbackonperformance, value); _providingfeedbackonperformance = value; } } #endregion #region _SourceofHire : string private string _SourceofHire; public string SourceofHire { get { return _SourceofHire; } set { base.OnPropertyChange("SourceofHire", _SourceofHire, value); _SourceofHire = value; } } #endregion //#region _ReasonsforLeaving : string //private string _ReasonsforLeaving; //public string ReasonsforLeaving //{ // get { return _ReasonsforLeaving; } // set // { // base.OnPropertyChange("ReasonsforLeaving", _ReasonsforLeaving, value); // _ReasonsforLeaving = value; // } //} //#endregion #region _CultureandClimate : string private string _CultureandClimate; public string CultureandClimate { get { return _CultureandClimate; } set { base.OnPropertyChange("CultureandClimate", _CultureandClimate, value); _CultureandClimate = value; } } #endregion #region _CareerDevelopment : string private string _CareerDevelopment; public string CareerDevelopment { get { return _CareerDevelopment; } set { base.OnPropertyChange("CareerDevelopment", _CareerDevelopment, value); _CareerDevelopment = value; } } #endregion #region _Name : string private string _Name; public string Name { get { return _Name; } set { base.OnPropertyChange("Name", _Name, value); _Name = value; } } #endregion #region _JobTitle : string private string _JobTitle; public string JobTitle { get { return _JobTitle; } set { base.OnPropertyChange("JobTitle", _JobTitle, value); _JobTitle = value; } } #endregion #region _DepartmentName : string private string _DepartmentName; public string DepartmentName { get { return _DepartmentName; } set { base.OnPropertyChange("DepartmentName", _DepartmentName, value); _DepartmentName = value; } } #endregion #region _ManagerName : string private string _ManagerName; public string ManagerName { get { return _ManagerName; } set { base.OnPropertyChange("ManagerName", _ManagerName, value); _ManagerName = value; } } #endregion #region ReasonsForLeaving : ReasonsForLeaving private ObjectsTemplate _ReasonsForLeaving; public ObjectsTemplate ReasonsForLeavingCol { get { if (this.ID != null && this.ID.IsUnassigned == false && this.ID.Integer > 0 && _ReasonsForLeaving == null) { ReasonsForLeavingCol = new ObjectsTemplate(); _ReasonsForLeaving = GetReasonsForLeaving(this.ID); } return this._ReasonsForLeaving; } set { _ReasonsForLeaving = value; } } #endregion #region Service Factory IExitInterviewService : IExitInterviewService internal static IExitInterviewService Service { get { return Services.Factory.CreateService(typeof(IExitInterviewService)); } } #endregion #endregion #region Functions public static ObjectsTemplate GetReasonsForLeaving(ID nExitInterviewID) { #region Cache Header ObjectsTemplate oReasonsForLeaving = _cache["GetReasonsForLeaving"] as ObjectsTemplate; if (oReasonsForLeaving != null) return oReasonsForLeaving; #endregion try { oReasonsForLeaving = Service.GetReasonsForLeaving(nExitInterviewID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(oReasonsForLeaving, "GetReasonsForLeaving"); #endregion return oReasonsForLeaving; } public static ExitInterview Get(ID nID) { ExitInterview oExitInterview = null; #region Cache Header oExitInterview = (ExitInterview)_cache["Get", nID]; if (oExitInterview != null) return oExitInterview; #endregion oExitInterview = ExitInterview.Service.Get(nID); #region Cache Footer _cache.Add(oExitInterview, "Get", nID); #endregion return oExitInterview; } public static ExitInterview GetByEmployeeID(ID nID) { ExitInterview oExitInterview = null; #region Cache Header oExitInterview = (ExitInterview)_cache["GetByEmployeeID", nID]; if (oExitInterview != null) return oExitInterview; #endregion oExitInterview = ExitInterview.Service.GetByEmployeeID(nID); #region Cache Footer _cache.Add(oExitInterview, "GetByEmployeeID", nID); #endregion return oExitInterview; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate ExitInterviews = _cache["Get"] as ObjectsTemplate; if (ExitInterviews != null) return ExitInterviews; #endregion try { ExitInterviews = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(ExitInterviews, "Get"); #endregion return ExitInterviews; } public static ObjectsTemplate Get(DateTime dtFrom,DateTime dtTo,int nReasonID) { #region Cache Header ObjectsTemplate ExitInterviews = _cache["Get", dtFrom, dtTo, nReasonID] as ObjectsTemplate; if (ExitInterviews != null) return ExitInterviews; #endregion try { ExitInterviews = Service.Get(dtFrom, dtTo, nReasonID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(ExitInterviews, "Get", dtFrom, dtTo, nReasonID); #endregion return ExitInterviews; } public ID Save() { this.SetAuditTrailProperties(); return ExitInterview.Service.Save(this); } public void Delete(ID id) { ExitInterview.Service.Delete(id); } #endregion } #endregion #region ReasonsForLeaving [Serializable] public class ReasonsForLeaving : BasicBaseObject { #region Cache Store private static Cache _cache = new Cache(typeof(ReasonsForLeaving)); #endregion #region Constructor public ReasonsForLeaving() { _ExitInterviewID = null; _ReasonID = null; } #endregion #region Properties #region _ExitInterviewID : ID private ID _ExitInterviewID; public ID ExitInterviewID { get { return _ExitInterviewID; } set { base.OnPropertyChange("ExitInterviewID", _ExitInterviewID, value); _ExitInterviewID = value; } } #endregion #region _ReasonID : ID private ID _ReasonID; public ID ReasonID { get { return _ReasonID; } set { base.OnPropertyChange("ReasonID", _ReasonID, value); _ReasonID = value; } } #endregion #endregion } #endregion #region IExitInterview Service public interface IExitInterviewService { ExitInterview Get(ID id); ExitInterview GetByEmployeeID(ID nID); ObjectsTemplate Get(); ID Save(ExitInterview item); void Delete(ID id); ObjectsTemplate GetReasonsForLeaving(ID nExitInterviewID); ObjectsTemplate Get(DateTime dtFrom, DateTime dtTo, int nReasonID); } #endregion }