using Ease.Core.Model; using System.Collections.Generic; namespace HRM.BO { #region Costcenter public class Costcenter : BasicBaseObject { #region Constructor public Costcenter() { Code = string.Empty; Name = string.Empty; NameInBangla = string.Empty; ProfitCenterName = string.Empty; ParentsID = string.Empty; Parent = null; Tier = 1; Status = EnumStatus.Active; GrsName = string.Empty; ParentID = null; } #endregion #region Properties public string Code { get; set; } public string GrsName { get; set; } public string Name { get; set; } public string NameInBangla { get; set; } public string ProfitCenterName { get; set; } public int? ParentID { get; set; } public string ParentsID { get; set; } public Costcenter Parent { get; set; } public int PayrollTypeID { get; set; } public int Tier { get; set; } //public string CodeName { get { return this.Name + " [" + this.Code + "]"; }; set; } public string CodeName { get; set; } //#region Chield : Cost Center //private List _Childs; //public List Childs //{ // get // { // if (_Childs == null && this.ID == 0) // { // _Childs = Costcenter.GetChilds(this.ID); // } // return _Childs; // } // set // { // _Childs = value; // } //} //public List PickerChilds //{ // get // { // List pChilds = new List(); // if (_Childs == null && this.ID == 0) // { // _Childs = Costcenter.GetChilds(this.ID); // if (_Childs != null) // { // foreach (Costcenter cc in _Childs) // { // pChilds.Add(cc); // } // } // } // return pChilds; // } //} //#endregion //#region Service Factory ICostcenterService : ICostcenterService //internal static ICostcenterService Service //{ // get { return Services.Factory.CreateService(typeof(ICostcenterService)); } //} //#endregion #endregion } #endregion #region ICostcenter Service public interface ICostcenterService { Costcenter Get(int id); // List Get(int payrollTypeID); List Get(); List GetParents(EnumStatus status, int payrollTypeID); List GetChilds(int parentID, int payrollTypeID); List GetByTire(int nTire, int payrollTypeID); List GetByTireAndProfitCenter(int nTire, string sProfitCenter, int payrollTypeID); int Save(Costcenter item, int payrollTypeID); int Save(Costcenter item); void Delete(int id); Costcenter Get(string sCode, int payrollTypeID); List Get(EnumStatus status, int tier, int payrollTypeID); List GetAllCostCenter(int payrollTypeID, EnumStatus status, string code, string name); } #endregion }