EchoTex_Payroll/HRM.BO/HRBasic/Hobby.cs

146 lines
3.5 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 class Hobby
public class Hobby : BasicBaseObject
{
#region Constructor
public Hobby()
{
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 IHobbyService : IHobbyService
//internal static IHobbyService Service
//{
// get { return Services.Factory.CreateService<IHobbyService>(typeof(IHobbyService)); }
//}
//#endregion
#endregion
//#region Function
//public static Hobby Get(ID nID)
//{
// Hobby oHobby = null;
// #region Cache Header
// oHobby = (Hobby)_cache["Get", nID];
// if (oHobby != null)
// return oHobby;
// #endregion
// oHobby = Hobby.Service.Get(nID);
// #region Cache Footer
// _cache.Add(oHobby, "Get", nID);
// #endregion
// return oHobby;
//}
//public static Hobby Get(string sCode)
//{
// Hobby oHobby = null;
// #region Cache Header
// oHobby = (Hobby)_cache["Get", sCode];
// if (oHobby != null)
// return oHobby;
// #endregion
// oHobby = Hobby.Service.Get(sCode);
// #region Cache Footer
// _cache.Add(oHobby, "Get", sCode);
// #endregion
// return oHobby;
//}
//public static List<Hobby> Get()
//{
// #region cache header
// List<Hobby> hobbies = _cache["Get"] as List<Hobby>;
// if (hobbies != null)
// return hobbies;
// #endregion
// try
// {
// hobbies = Service.Get();
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region cache footer
// _cache.Add(hobbies, "Get");
// #endregion
// return hobbies;
//}
//public static List<Hobby> Get(EnumStatus status)
//{
// #region Cache Header
// List<Hobby> hobbies = _cache["Get", status] as List<Hobby>;
// if (hobbies != null)
// return hobbies;
// #endregion
// try
// {
// hobbies = Service.Get(status);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(hobbies, "Get", status);
// #endregion
// return hobbies;
//}
//public ID Save()
//{
// this.SetAuditTrailProperties();
// return Hobby.Service.Save(this);
//}
//public void Delete(ID id)
//{
// Hobby.Service.Delete(id);
//}
//#endregion
}
#endregion
#region IHobby Service
public interface IHobbyService
{
Hobby Get(int id);
Hobby Get(string sCode);
List<Hobby> Get();
List<Hobby> Get(EnumStatus status);
int Save(Hobby item);
void Delete(int id);
}
#endregion
}