EchoTex_Payroll/HRM.BO/Employee/EmployeeStatus.cs
2024-10-14 10:01:49 +06:00

174 lines
5.1 KiB
C#

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<EmpStatusComponent> EmployeeStatusComponents { get; set; }
public List<EmployeeStatus.EmployeeStatusComponentUser> 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<IEmployeeStatusService>(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<EmpStatusComponent>
//{
// #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<EmployeeStatus.EmployeeStatusComponentUser> _empStatusComponentUsers;
//public List<EmployeeStatus.EmployeeStatusComponentUser> 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<EmpStatusComponent> _empStatusComponents;
//public List<EmpStatusComponent> 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<EmployeeStatus> Get();
List<EmployeeStatus> GetByUserID(int userid);
List<EmployeeStatus.EmpStatusComponent> GetChild(int id);
List<EmployeeStatus.EmployeeStatusComponentUser> GetEmpStatusComponentUser(int parentID);
List<EmployeeStatus> Get(EnumStatus status);
List<EmployeeStatus> Get(EnumStatus status, EnumLifeCycleComponent sComponentStatus);
List<EmployeeStatus> GetByEmpStatus(EnumStatus status, EnumEmployeeStatus empStatus);
int Save(EmployeeStatus item);
int SaveStatus(EmployeeStatus oEmployeeStatus);
void Delete(int id);
}
#endregion
}