using System.Collections.Generic; using System.Data; namespace HRM.BO { public class Department : BasicBaseObject { #region Constructor public Department() { Code = string.Empty; Name = string.Empty; ParentID = null; ParentsID = string.Empty; Tier = 1; Parent = null; //_Childs = null; _status = EnumStatus.Active; CostCenter = string.Empty; } #endregion #region Properties public string Code { get; set; } public string Name { get; set; } public int? ParentID { get; set; } public string ParentsID { get; set; } public Department Parent { get; set; } public int Tier { get; set; } public string CostCenter { get; set; } public int PayrollTypeID { get; set; } //#region Chield : Department //private List _Childs; //public List Childs //{ // get // { // if (_Childs == null && this.ID == 0) // { // _Childs = Department.GetChilds(this.ID); // } // return _Childs; // } // set // { // _Childs = value; // } //} //public List PickerChilds //{ // get // { // List pChilds = new List(); // if (_Childs == null && this.ID == 0) // { // _Childs = Department.GetChilds(this.ID); // if (_Childs != null) // { // foreach (Department dpt in _Childs) // { // pChilds.Add(dpt); // } // } // } // return pChilds; // } //} #endregion //#region Service Factory IDepartmentService : IDepartmentService //internal static IDepartmentService Service //{ // get { return Services.Factory.CreateService(typeof(IDepartmentService)); } //} //#endregion } public interface IDepartmentService { Department Get(int id); List GetAll(int payrollTypeID); List GetAllDepartment(int payrollTypeID, EnumStatus status, string code, string name); List Get(EnumStatus status, int payrollTypeID); List GetByDeptIDs(string deptIds); List GetChield(int parentID); List GetParents(EnumStatus status, int payrolltypeid); List GetByTier(int tier, int id); List GetByTier(int tier); int Save(Department item); void Save(List _oDepartments); void Delete(int id); Department Get(string sCode); List GetParentLessChilds(); string GetNextCode(int tier, int parentid); //string GetNextCode(int nteir); DataSet GetForTree(); DataSet GetDepartmentWiseManpower(string sParam); } }