using System; using System.Collections.Generic; namespace HRM.BO { #region class Nature Of Training public class NatureOfTraining : BasicBaseObject { #region constructor public NatureOfTraining() { Code = string.Empty; Name = string.Empty; } #endregion #region properties public string Code { get; set; } public string Name { get; set; } //#region Service Factory INatureOfTrainingService : INatureOfTrainingService //internal static INatureOfTrainingService Service //{ // get { return Services.Factory.CreateService(typeof(INatureOfTrainingService)); } //} //#endregion #endregion //#region Function //public static NatureOfTraining Get(ID nID) //{ // NatureOfTraining oNatureOfTraining = null; // #region Cache Header // oNatureOfTraining = (NatureOfTraining)_cache["Get", nID]; // if (oNatureOfTraining != null) // return oNatureOfTraining; // #endregion // oNatureOfTraining = NatureOfTraining.Service.Get(nID); // #region Cache Footer // _cache.Add(oNatureOfTraining, "Get", nID); // #endregion // return oNatureOfTraining; //} //public static List Get() //{ // #region cache header // List natureOfTrainings = _cache["Get"] as List; // if (natureOfTrainings != null) // return natureOfTrainings; // #endregion // try // { // natureOfTrainings = Service.Get(); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region cache footer // _cache.Add(natureOfTrainings, "Get"); // #endregion // return natureOfTrainings; //} //public static NatureOfTraining Get(string sCode) //{ // NatureOfTraining oNatureOfTraining = null; // #region Cache Header // oNatureOfTraining = (NatureOfTraining)_cache["Get", sCode]; // if (oNatureOfTraining != null) // return oNatureOfTraining; // #endregion // oNatureOfTraining = NatureOfTraining.Service.Get(sCode); // #region Cache Footer // _cache.Add(oNatureOfTraining, "Get", sCode); // #endregion // return oNatureOfTraining; //} //public static List Get(EnumStatus status) //{ // #region Cache Header // List natureOfTrainings = _cache["Get", status] as List; // if (natureOfTrainings != null) // return natureOfTrainings; // #endregion // try // { // if(status==EnumStatus.Regardless) // natureOfTrainings = Service.Get(); // else // natureOfTrainings = Service.Get(status); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(natureOfTrainings, "Get", status); // #endregion // return natureOfTrainings; //} //public ID Save() //{ // this.SetAuditTrailProperties(); // return NatureOfTraining.Service.Save(this); //} //public void Delete(ID id) //{ // NatureOfTraining.Service.Delete(id); //} //#endregion } #endregion #region INatureOfTrainingService public interface INatureOfTrainingService { NatureOfTraining Get(int id); NatureOfTraining Get(string sCode); List Get(); List Get(EnumStatus status); int Save(NatureOfTraining item); void Delete(int id); } #endregion }