EchoTex_Payroll/HRM.BO/Basic/Department.cs

112 lines
3.2 KiB
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00
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<Department> _Childs;
//public List<Department> Childs
//{
// get
// {
// if (_Childs == null && this.ID == 0)
// {
// _Childs = Department.GetChilds(this.ID);
// }
// return _Childs;
// }
// set
// {
// _Childs = value;
// }
//}
//public List<ObjectTemplate> PickerChilds
//{
// get
// {
// List<ObjectTemplate> pChilds = new List<ObjectTemplate>();
// 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<IDepartmentService>(typeof(IDepartmentService)); }
//}
//#endregion
}
public interface IDepartmentService
{
Department Get(int id);
List<Department> GetAll(int payrollTypeID);
List<Department> GetAllDepartment(int payrollTypeID, EnumStatus status, string code, string name);
List<Department> Get(EnumStatus status, int payrollTypeID);
List<Department> GetByDeptIDs(string deptIds);
List<Department> GetChield(int parentID);
List<Department> GetParents(EnumStatus status, int payrolltypeid);
List<Department> GetByTier(int tier, int id);
List<Department> GetByTier(int tier);
int Save(Department item);
void Save(List<Department> _oDepartments);
void Delete(int id);
Department Get(string sCode);
List<Department> GetParentLessChilds();
string GetNextCode(int tier, int parentid);
//string GetNextCode(int nteir);
DataSet GetForTree();
DataSet GetDepartmentWiseManpower(string sParam);
}
}