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