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