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