153 lines
3.7 KiB
C#
153 lines
3.7 KiB
C#
|
|
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<ICountryService>(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<Country> Get()
|
|
//{
|
|
// #region cache header
|
|
// List<Country> countries = _cache["Get"] as List<Country>;
|
|
// 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<Country> Get(EnumStatus status)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<Country> countries = _cache["Get", status] as List<Country>;
|
|
// 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<Country> Get();
|
|
List<Country> Get(EnumStatus status);
|
|
List<Country> Get(EnumStatus status, int payrolltypeid);
|
|
int Save(Country item);
|
|
void Delete(int id);
|
|
|
|
}
|
|
#endregion
|
|
}
|