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("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(typeof(IOrganogramEmployeeService)); } //} #endregion #endregion //#region Functions //public int Save() //{ // base.SetAuditTrailProperties(); // return OrganogramEmployee.Service.Save(this); //} //public static void Save(List 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 Get(int nodeID) //{ // List oOrganEmp = null; // #region Cache Header // oOrganEmp = (List)_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 GetOrganogramInfo() //{ // List oOrgan = null; // return OrganogramEmployee.Service.GetOrganogramInfo(); //} //public static List GetByEmp(int empID) //{ // List oOrganEmp = null; // #region Cache Header // oOrganEmp = (List)_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 GetByPositionType(EnumOGPositionType enPositionType) //{ // List oOrganEmp = null; // #region Cache Header // oOrganEmp = (List)_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 Get() //{ // #region Cache Header // List oOrganEmp = _cache["Get"] as List; // 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 GetByTier(int tierFrom, int tierTo) //{ // #region Cache Header // List oOrganEmp = _cache["Get"] as List; // 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 GetByGrades(string gradeIds) //{ // #region Cache Header // List oOrganEmp = _cache["GetByGrades"] as List; // 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 GetOrganogramInfo(); List Get(int nodeID); List GetByEmp(int empID); List GetByTier(int tierFrom, int tierTo); List GetByPositionType(EnumOGPositionType enPositionType); List Get(); List GetByGrades(string gradeIds); int Save(OrganogramEmployee OrganEmp); void Save(List OrganEmps); void Delete(int id); void Delete(); } #endregion }