using Ease.Core.Model; using System; using System.Collections.Generic; namespace HRM.BO { #region EmployeeStatus public class EmployeeStatus : BasicBaseObject { #region Constructor public EmployeeStatus() { EmpStatus = EnumEmployeeStatus.Live; Description = string.Empty; ContinueOwnPartPF = false; ContinueCmpPartPF = false; ContinueGratuity = false; //GradeSalaryChangeType = null; } #endregion #region Properties public EnumEmployeeStatus EmpStatus { get; set; } public string EmpStatusName { get { return this.EmpStatus.ToString(); } } public string Description { get; set; } public bool ContinueOwnPartPF { get; set; } public bool ContinueCmpPartPF { get; set; } public bool ContinueGratuity { get; set; } public int ParentID { get; set; } //public GradeSalaryChangeType GradeSalaryChangeType { get; set; } public List EmployeeStatusComponents { get; set; } public List EmpStatusComponentUsers { get; set; } public bool IsPromotion { get; set; } // New public bool IsJoining { get; set; } // New public bool IsTransferReceived { get; set; } #endregion //#region Service Factory IEmployeeStatusService : IEmployeeStatusService //internal static IEmployeeStatusService Service //{ // get { return Services.Factory.CreateService(typeof(IEmployeeStatusService)); } //} //#endregion #region EmpStatusComponent public class EmpStatusComponent : ObjectTemplate { #region constructor public EmpStatusComponent() { } #endregion #region properties #region ComponentType :int public EnumLifeCycleComponent ComponentType { get; set; } public int StatusID { get; set; } public new void SetID(int id) { base.SetID(id); } #endregion } #endregion #region EmployeeStatusComponentUser public class EmployeeStatusComponentUser : ObjectTemplate { #region Properties public int UserID { get; set; } public int EmployeeStatusID { get; set; } #endregion } #endregion //#region EmpStatusComponents //public class EmpStatusComponents : List //{ // #region constructor // public EmpStatusComponents() // { } // #endregion // public EmpStatusComponent GetItemByEmpStatusID(int EmpStatusID) // { // return this.Find(delegate(EmpStatusComponent item) { return item.StatusID == EmpStatusID; }); // } //} //#endregion //#region Property EmpStatusComponentUsers //private List _empStatusComponentUsers; //public List EmpStatusComponentUsers //{ // get // { // if (_empStatusComponentUsers == null && this.ID != null && !this.ID.IsUnassigned) // _empStatusComponentUsers = EmployeeStatus.GetEmpStatusComponentUser(this.ID); // return _empStatusComponentUsers; // } // set // { // _empStatusComponentUsers = value; // } //} //#endregion //#region Property EmpStatusComponents //private List _empStatusComponents; //public List EmployeeStatusComponents //{ // get // { // if (_empStatusComponents == null && this.ID != null && !this.ID.IsUnassigned) // _empStatusComponents = EmployeeStatus.GetChild(this.ID); // return _empStatusComponents; // } // set // { // _empStatusComponents = value; // } //} #endregion #endregion } #region IEmployeeStatus Service public interface IEmployeeStatusService { EmployeeStatus Get(int id); List Get(); List GetByUserID(int userid); List GetChild(int id); List GetEmpStatusComponentUser(int parentID); List Get(EnumStatus status); List Get(EnumStatus status, EnumLifeCycleComponent sComponentStatus); List GetByEmpStatus(EnumStatus status, EnumEmployeeStatus empStatus); int Save(EmployeeStatus item); int SaveStatus(EmployeeStatus oEmployeeStatus); void Delete(int id); } #endregion }