112 lines
3.2 KiB
C#
112 lines
3.2 KiB
C#
|
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);
|
|||
|
}
|
|||
|
}
|