145 lines
3.7 KiB
C#
145 lines
3.7 KiB
C#
|
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace HRM.BO
|
|||
|
{
|
|||
|
#region class occupation
|
|||
|
public class Occupation : BasicBaseObject
|
|||
|
{
|
|||
|
#region Constructor
|
|||
|
public Occupation()
|
|||
|
{
|
|||
|
Code = string.Empty;
|
|||
|
Description = string.Empty;
|
|||
|
Status = EnumStatus.Active;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Properties
|
|||
|
public string Code { get; set; }
|
|||
|
public string Description { get; set; }
|
|||
|
|
|||
|
//#region Service Factory IOccupationService : IOccupationService
|
|||
|
|
|||
|
//internal static IOccupationService Service
|
|||
|
//{
|
|||
|
// get { return Services.Factory.CreateService<IOccupationService>(typeof(IOccupationService)); }
|
|||
|
//}
|
|||
|
|
|||
|
//#endregion
|
|||
|
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
//#region Function
|
|||
|
//public static Occupation Get(ID nID)
|
|||
|
//{
|
|||
|
// Occupation oOccupation = null;
|
|||
|
// #region Cache Header
|
|||
|
// oOccupation = (Occupation)_cache["Get", nID];
|
|||
|
// if (oOccupation != null)
|
|||
|
// return oOccupation;
|
|||
|
// #endregion
|
|||
|
// oOccupation = Occupation.Service.Get(nID);
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(oOccupation, "Get", nID);
|
|||
|
// #endregion
|
|||
|
// return oOccupation;
|
|||
|
//}
|
|||
|
|
|||
|
//public static Occupation Get(string sCode)
|
|||
|
//{
|
|||
|
// Occupation oOccupation = null;
|
|||
|
// #region Cache Header
|
|||
|
// oOccupation = (Occupation)_cache["Get", sCode];
|
|||
|
// if (oOccupation != null)
|
|||
|
// return oOccupation;
|
|||
|
// #endregion
|
|||
|
// oOccupation = Occupation.Service.Get(sCode);
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(oOccupation, "Get", sCode);
|
|||
|
// #endregion
|
|||
|
// return oOccupation;
|
|||
|
//}
|
|||
|
|
|||
|
//public static List<Occupation> Get()
|
|||
|
//{
|
|||
|
// #region cache header
|
|||
|
// List<Occupation> occupations = _cache["Get"] as List<Occupation>;
|
|||
|
// if (occupations != null)
|
|||
|
// return occupations;
|
|||
|
// #endregion
|
|||
|
// try
|
|||
|
// {
|
|||
|
// occupations = Service.Get();
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
|
|||
|
// #region cache footer
|
|||
|
// _cache.Add(occupations, "Get");
|
|||
|
// #endregion
|
|||
|
|
|||
|
// return occupations;
|
|||
|
//}
|
|||
|
|
|||
|
//public static List<Occupation> Get(EnumStatus status)
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
|
|||
|
// List<Occupation> occupations = _cache["Get", status] as List<Occupation>;
|
|||
|
// if (occupations != null)
|
|||
|
// return occupations;
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// try
|
|||
|
// {
|
|||
|
// occupations = Service.Get(status);
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
|
|||
|
// #region Cache Footer
|
|||
|
|
|||
|
// _cache.Add(occupations, "Get", status);
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// return occupations;
|
|||
|
//}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
//public ID Save()
|
|||
|
//{
|
|||
|
// this.SetAuditTrailProperties();
|
|||
|
// return Occupation.Service.Save(this);
|
|||
|
//}
|
|||
|
|
|||
|
//public void Delete(ID id)
|
|||
|
//{
|
|||
|
// Occupation.Service.Delete(id);
|
|||
|
//}
|
|||
|
//#endregion
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region IOccupation Service
|
|||
|
public interface IOccupationService
|
|||
|
{
|
|||
|
Occupation Get(int id);
|
|||
|
Occupation Get(string sCode);
|
|||
|
List<Occupation> Get();
|
|||
|
List<Occupation> Get(EnumStatus status);
|
|||
|
int Save(Occupation item);
|
|||
|
void Delete(int id);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|