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(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 Get() //{ // #region cache header // List relations = _cache["Get"] as List; // 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 Get(EnumStatus status) //{ // #region Cache Header // List relations = _cache["Get", status] as List; // 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 Get(); List Get(EnumStatus status); int Save(Allergy item); void Delete(int id); } #endregion }