186 lines
4.3 KiB
C#
186 lines
4.3 KiB
C#
|
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace HRM.BO
|
|||
|
{
|
|||
|
#region HRDoc
|
|||
|
public class HRDoc : BasicBaseObject
|
|||
|
{
|
|||
|
#region Constructor
|
|||
|
public HRDoc()
|
|||
|
{
|
|||
|
Code = string.Empty;
|
|||
|
Name = string.Empty;
|
|||
|
Description = string.Empty;
|
|||
|
ParentID = 0;
|
|||
|
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Properties
|
|||
|
public string Code { get; set; }
|
|||
|
public string Description { get; set; }
|
|||
|
public string Name { get; set; }
|
|||
|
public int ParentID { get; set; }
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
//#region Service Factory IHRDocService : IHRDocService
|
|||
|
|
|||
|
//internal static IHRDocService Service
|
|||
|
//{
|
|||
|
// get { return Services.Factory.CreateService<IHRDocService>(typeof(IHRDocService)); }
|
|||
|
//}
|
|||
|
|
|||
|
//#endregion
|
|||
|
|
|||
|
//#region Functions
|
|||
|
//public static HRDoc Get(ID nID)
|
|||
|
//{
|
|||
|
// HRDoc oHRDoc = null;
|
|||
|
// #region Cache Header
|
|||
|
// oHRDoc = (HRDoc)_cache["Get", nID];
|
|||
|
// if (oHRDoc != null)
|
|||
|
// return oHRDoc;
|
|||
|
// #endregion
|
|||
|
// oHRDoc = HRDoc.Service.Get(nID);
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(oHRDoc, "Get", nID);
|
|||
|
// #endregion
|
|||
|
// return oHRDoc;
|
|||
|
//}
|
|||
|
|
|||
|
//public static List<HRDoc> Get(EnumStatus status)
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
|
|||
|
// List<HRDoc> hrDocs = _cache["Get"] as List<HRDoc>;
|
|||
|
// if (hrDocs != null)
|
|||
|
// return hrDocs;
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// try
|
|||
|
// {
|
|||
|
// hrDocs = Service.Get();
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
|
|||
|
// #region Cache Footer
|
|||
|
|
|||
|
// _cache.Add(hrDocs, "Get");
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// return hrDocs;
|
|||
|
//}
|
|||
|
|
|||
|
//public static List<HRDoc> GetParent(EnumStatus status)
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
|
|||
|
// List<HRDoc> hrDocs = _cache["Get"] as List<HRDoc>;
|
|||
|
// if (hrDocs != null)
|
|||
|
// return hrDocs;
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// try
|
|||
|
// {
|
|||
|
// hrDocs = Service.GetParent(status);
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
|
|||
|
// #region Cache Footer
|
|||
|
|
|||
|
// _cache.Add(hrDocs, "Get");
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// return hrDocs;
|
|||
|
//}
|
|||
|
|
|||
|
//public ID Save()
|
|||
|
//{
|
|||
|
|
|||
|
// base.SetAuditTrailProperties();
|
|||
|
// return HRDoc.Service.Save(this);
|
|||
|
//}
|
|||
|
|
|||
|
//public void Delete(ID id)
|
|||
|
//{
|
|||
|
// HRDoc.Service.Delete(id);
|
|||
|
//}
|
|||
|
|
|||
|
//public static List<HRDoc> GetChilds(ID parentID)
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
|
|||
|
// List<HRDoc> HRDocs = _cache["GetChilds"] as List<HRDoc>;
|
|||
|
// if (HRDocs != null)
|
|||
|
// return HRDocs;
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// try
|
|||
|
// {
|
|||
|
// HRDocs = Service.GetChilds(parentID);
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
|
|||
|
// #region Cache Footer
|
|||
|
|
|||
|
// _cache.Add(HRDocs, "GetChilds");
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// return HRDocs;
|
|||
|
//}
|
|||
|
|
|||
|
//private bool IsExists(string Code)
|
|||
|
//{
|
|||
|
// try
|
|||
|
// {
|
|||
|
// bool isExists = false;
|
|||
|
// if (this.Code != null)
|
|||
|
// {
|
|||
|
// isExists = HRDoc.Service.IsExists(Code);
|
|||
|
// }
|
|||
|
// return isExists;
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new ServiceException(e.Message, e);
|
|||
|
// }
|
|||
|
//}
|
|||
|
|
|||
|
//#endregion
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region IHRDocService Service
|
|||
|
|
|||
|
public interface IHRDocService
|
|||
|
{
|
|||
|
HRDoc Get(int id);
|
|||
|
List<HRDoc> Get();
|
|||
|
List<HRDoc> GetParent(EnumStatus status);
|
|||
|
List<HRDoc> GetChilds(int parentID);
|
|||
|
int Save(HRDoc item);
|
|||
|
void Delete(int id);
|
|||
|
bool IsExists(string Code);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|