EchoTex_Payroll/HRM.BO/Organogram/OrganogramEmployee.cs

313 lines
8.9 KiB
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00
using System;
using System.Collections.Generic;
namespace HRM.BO
{
#region OrganogramEmployee
public class OrganogramEmployee : AuditTrailBase
{
#region Constructor
public OrganogramEmployee()
{
//_organEmpID = null;
_nodeID = 0;
_employeeID = 0;
_assignDate = DateTime.MinValue;
}
#endregion
#region Property
//#region OrganEmpID : ID
//private int _organEmpID;
//public int OrganEmpID
//{
// get { return _organEmpID; }
// set
// {
// base.OnPropertyChange<ID>("organEmpID", _organEmpID, value);
// _organEmpID = value;
// }
//}
//#endregion
#region nodeID : ID
private int _nodeID;
public int NodeID
{
get { return _nodeID; }
set
{
_nodeID = value;
}
}
#endregion
#region employeeID : ID
private int _employeeID;
public int EmployeeID
{
get { return _employeeID; }
set
{
_employeeID = value;
}
}
#endregion
#region employee : Employee
private Employee _employee;
public Employee Employee
{
get
{
//if (_employeeID.Integer > 0 && _employee == null)
//{
// _employee = new Employee();
// _employee = Employee.Get(_employeeID);
//}
return this._employee;
}
set
{
_employee = value;
}
}
#endregion
#region assignDate : DateTime
private DateTime _assignDate;
public DateTime AssignDate
{
get { return _assignDate; }
set
{
_assignDate = value;
}
}
#endregion
private OrganogramBasic _position;
public OrganogramBasic position
{
get
{
//if (_nodeid != null && !_nodeid.isunassigned)
//{
// if (_nodeid.integer > 0 && _position == null)
// {
// _position = new organogrambasic();
// _position = organogrambasic.get(_nodeid);
// }
//}
return this._position;
}
set
{
_position = value;
}
}
#region Service Factory IOrganogramEmployee : IOrganogramEmployee
//internal static IOrganogramEmployeeService Service
//{
// get { return Services.Factory.CreateService<IOrganogramEmployeeService>(typeof(IOrganogramEmployeeService)); }
//}
#endregion
#endregion
//#region Functions
//public int Save()
//{
// base.SetAuditTrailProperties();
// return OrganogramEmployee.Service.Save(this);
//}
//public static void Save(List<OrganogramEmployee> organogramEmployees)
//{
// foreach (OrganogramEmployee item in organogramEmployees)
// {
// item.SetAuditTrailProperties();
// }
// //base.SetAuditTrailProperties();
// OrganogramEmployee.Service.Save(organogramEmployees);
//}
//public void Delete()
//{
// OrganogramEmployee.Service.Delete(ID);
//}
//public static void DeleteAll()
//{
// OrganogramEmployee.Service.Delete();
//}
//public static List<OrganogramEmployee> Get(int nodeID)
//{
// List<OrganogramEmployee> oOrganEmp = null;
// #region Cache Header
// oOrganEmp = (List<OrganogramEmployee>)_cache["Get", nodeID];
// if (oOrganEmp != null)
// return oOrganEmp;
// #endregion
// oOrganEmp = OrganogramEmployee.Service.Get(nodeID);
// #region Cache Footer
// _cache.Add(oOrganEmp, "Get", nodeID);
// #endregion
// return oOrganEmp;
//}
//public static List<OrganogramBasicTemp> GetOrganogramInfo()
//{
// List<OrganogramBasicTemp> oOrgan = null;
// return OrganogramEmployee.Service.GetOrganogramInfo();
//}
//public static List<OrganogramEmployee> GetByEmp(int empID)
//{
// List<OrganogramEmployee> oOrganEmp = null;
// #region Cache Header
// oOrganEmp = (List<OrganogramEmployee>)_cache["GetByEmp", empID];
// if (oOrganEmp != null)
// return oOrganEmp;
// #endregion
// oOrganEmp = OrganogramEmployee.Service.GetByEmp(empID);
// #region Cache Footer
// _cache.Add(oOrganEmp, "GetByEmp", empID);
// #endregion
// return oOrganEmp;
//}
//public static List<OrganogramEmployee> GetByPositionType(EnumOGPositionType enPositionType)
//{
// List<OrganogramEmployee> oOrganEmp = null;
// #region Cache Header
// oOrganEmp = (List<OrganogramEmployee>)_cache["GetByPositionType", enPositionType];
// if (oOrganEmp != null)
// return oOrganEmp;
// #endregion
// oOrganEmp = OrganogramEmployee.Service.GetByPositionType(enPositionType);
// #region Cache Footer
// _cache.Add(oOrganEmp, "GetByPositionType", enPositionType);
// #endregion
// return oOrganEmp;
//}
//public static List<OrganogramEmployee> Get()
//{
// #region Cache Header
// List<OrganogramEmployee> oOrganEmp = _cache["Get"] as List<OrganogramEmployee>;
// if (oOrganEmp != null)
// return oOrganEmp;
// #endregion
// try
// {
// oOrganEmp = Service.Get();
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(oOrganEmp, "Get");
// #endregion
// return oOrganEmp;
//}
//public static List<OrganogramEmployee> GetByTier(int tierFrom, int tierTo)
//{
// #region Cache Header
// List<OrganogramEmployee> oOrganEmp = _cache["Get"] as List<OrganogramEmployee>;
// if (oOrganEmp != null)
// return oOrganEmp;
// #endregion
// try
// {
// oOrganEmp = Service.GetByTier(tierFrom, tierTo);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(oOrganEmp, "Get");
// #endregion
// return oOrganEmp;
//}
//public static List<OrganogramEmployee> GetByGrades(string gradeIds)
//{
// #region Cache Header
// List<OrganogramEmployee> oOrganEmp = _cache["GetByGrades"] as List<OrganogramEmployee>;
// if (oOrganEmp != null)
// return oOrganEmp;
// #endregion
// try
// {
// oOrganEmp = Service.GetByGrades(gradeIds);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(oOrganEmp, "GetByGrades");
// #endregion
// return oOrganEmp;
//}
//#endregion
}
#endregion
//public class OrganogramBasicTemp
//{
// public int Tier { get; set; }
// public int ParentID { get; set; }
// public int OrganogramID { get; set; }
// public int EmployeeID { get; set; }
// public string PositionName { get; set; }
// public string EmployeeNo { get; set; }
// public string EmployeeName { get; set; }
//}
#region IOrganogramEmployeeService
public interface IOrganogramEmployeeService
{
List<OrganogramBasic> GetOrganogramInfo();
List<OrganogramEmployee> Get(int nodeID);
List<OrganogramEmployee> GetByEmp(int empID);
List<OrganogramEmployee> GetByTier(int tierFrom, int tierTo);
List<OrganogramEmployee> GetByPositionType(EnumOGPositionType enPositionType);
List<OrganogramEmployee> Get();
List<OrganogramEmployee> GetByGrades(string gradeIds);
int Save(OrganogramEmployee OrganEmp);
void Save(List<OrganogramEmployee> OrganEmps);
void Delete(int id);
void Delete();
}
#endregion
}