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