149 lines
3.6 KiB
C#
149 lines
3.6 KiB
C#
|
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace HRM.BO
|
|||
|
{
|
|||
|
#region class allergy
|
|||
|
public class Allergy : BasicBaseObject
|
|||
|
{
|
|||
|
#region constructor
|
|||
|
public Allergy()
|
|||
|
{
|
|||
|
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 IAllergyService : IAllergyService
|
|||
|
|
|||
|
//internal static IAllergyService Service
|
|||
|
//{
|
|||
|
// get { return Services.Factory.CreateService<IAllergyService>(typeof(IAllergyService)); }
|
|||
|
//}
|
|||
|
|
|||
|
//#endregion
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
//#region Function
|
|||
|
|
|||
|
//public static Allergy Get(ID nID)
|
|||
|
//{
|
|||
|
// Allergy oAllergy = null;
|
|||
|
// #region Cache Header
|
|||
|
// oAllergy = (Allergy)_cache["Get", nID];
|
|||
|
// if (oAllergy != null)
|
|||
|
// return oAllergy;
|
|||
|
// #endregion
|
|||
|
// oAllergy = Allergy.Service.Get(nID);
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(oAllergy, "Get", nID);
|
|||
|
// #endregion
|
|||
|
// return oAllergy;
|
|||
|
//}
|
|||
|
|
|||
|
//public static Allergy Get(string sCode)
|
|||
|
//{
|
|||
|
// Allergy oAllergy = null;
|
|||
|
// #region Cache Header
|
|||
|
// oAllergy = (Allergy)_cache["Get", sCode];
|
|||
|
// if (oAllergy != null)
|
|||
|
// return oAllergy;
|
|||
|
// #endregion
|
|||
|
// oAllergy = Allergy.Service.Get(sCode);
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(oAllergy, "Get", sCode);
|
|||
|
// #endregion
|
|||
|
// return oAllergy;
|
|||
|
//}
|
|||
|
|
|||
|
//public static List<Allergy> Get()
|
|||
|
//{
|
|||
|
// #region cache header
|
|||
|
// List<Allergy> relations = _cache["Get"] as List<Allergy>;
|
|||
|
// if (relations != null)
|
|||
|
// return relations;
|
|||
|
// #endregion
|
|||
|
// try
|
|||
|
// {
|
|||
|
// relations = Service.Get();
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
|
|||
|
// #region cache footer
|
|||
|
// _cache.Add(relations, "Get");
|
|||
|
// #endregion
|
|||
|
|
|||
|
// return relations;
|
|||
|
//}
|
|||
|
|
|||
|
//public static List<Allergy> Get(EnumStatus status)
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
|
|||
|
// List<Allergy> relations = _cache["Get", status] as List<Allergy>;
|
|||
|
// if (relations != null)
|
|||
|
// return relations;
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// try
|
|||
|
// {
|
|||
|
// relations = Service.Get(status);
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
|
|||
|
// #region Cache Footer
|
|||
|
|
|||
|
// _cache.Add(relations, "Get", status);
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// return relations;
|
|||
|
//}
|
|||
|
|
|||
|
//public ID Save()
|
|||
|
//{
|
|||
|
// this.SetAuditTrailProperties();
|
|||
|
// return Allergy.Service.Save(this);
|
|||
|
//}
|
|||
|
|
|||
|
//public void Delete(ID id)
|
|||
|
//{
|
|||
|
// Allergy.Service.Delete(id);
|
|||
|
//}
|
|||
|
|
|||
|
//#endregion
|
|||
|
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region IAllergy Service
|
|||
|
public interface IAllergyService
|
|||
|
{
|
|||
|
Allergy Get(int id);
|
|||
|
Allergy Get(string sCode);
|
|||
|
List<Allergy> Get();
|
|||
|
List<Allergy> Get(EnumStatus status);
|
|||
|
int Save(Allergy item);
|
|||
|
void Delete(int id);
|
|||
|
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|