181 lines
4.2 KiB
C#
181 lines
4.2 KiB
C#
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace HRM.BO
|
|
{
|
|
#region class Thana
|
|
public class Thana : BasicBaseObject
|
|
{
|
|
#region constructor
|
|
public Thana()
|
|
{
|
|
Code = string.Empty;
|
|
Name = string.Empty;
|
|
DistrictID = 0;
|
|
Status = EnumStatus.Active;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region properties
|
|
public string Code { get; set; }
|
|
public string Name { get; set; }
|
|
public int DistrictID { get; set; }
|
|
|
|
//#region Service Factory IThanaService : IThanaService
|
|
|
|
//internal static IThanaService Service
|
|
//{
|
|
// get { return Services.Factory.CreateService<IThanaService>(typeof(IThanaService)); }
|
|
//}
|
|
|
|
//#endregion
|
|
|
|
#endregion
|
|
|
|
//#region Function
|
|
//public static Thana Get(ID nID)
|
|
//{
|
|
// Thana oThana = null;
|
|
// #region Cache Header
|
|
// oThana = (Thana)_cache["Get", nID];
|
|
// if (oThana != null)
|
|
// return oThana;
|
|
// #endregion
|
|
// oThana = Thana.Service.Get(nID);
|
|
// #region Cache Footer
|
|
// _cache.Add(oThana, "Get", nID);
|
|
// #endregion
|
|
// return oThana;
|
|
//}
|
|
|
|
//public static Thana Get(string sCode)
|
|
//{
|
|
// Thana oThana = null;
|
|
// #region Cache Header
|
|
// oThana = (Thana)_cache["Get", sCode];
|
|
// if (oThana != null)
|
|
// return oThana;
|
|
// #endregion
|
|
// oThana = Thana.Service.Get(sCode);
|
|
// #region Cache Footer
|
|
// _cache.Add(oThana, "Get", sCode);
|
|
// #endregion
|
|
// return oThana;
|
|
//}
|
|
|
|
//public static List<Thana> Get()
|
|
//{
|
|
// #region cache header
|
|
// List<Thana> thanas = _cache["Get"] as List<Thana>;
|
|
// if (thanas != null)
|
|
// return thanas;
|
|
// #endregion
|
|
// try
|
|
// {
|
|
// thanas = Service.Get();
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region cache footer
|
|
// _cache.Add(thanas, "Get");
|
|
// #endregion
|
|
|
|
// return thanas;
|
|
//}
|
|
|
|
//public static List<Thana> GetByDistID(ID nDistID)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<Thana> thanas = _cache["GetByDistID", nDistID] as List<Thana>;
|
|
// if (thanas != null)
|
|
// return thanas;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// thanas = Service.GetByDistID(nDistID);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(thanas, "GetByDistID", nDistID);
|
|
|
|
// #endregion
|
|
|
|
// return thanas;
|
|
|
|
//}
|
|
|
|
//public static List<Thana> Get(EnumStatus status)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<Thana> thanas = _cache["Get", status] as List<Thana>;
|
|
// if (thanas != null)
|
|
// return thanas;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// thanas = Service.Get(status);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(thanas, "Get", status);
|
|
|
|
// #endregion
|
|
|
|
// return thanas;
|
|
//}
|
|
|
|
|
|
|
|
//public ID Save()
|
|
//{
|
|
// this.SetAuditTrailProperties();
|
|
// return Thana.Service.Save(this);
|
|
//}
|
|
|
|
//public void Delete(ID id)
|
|
//{
|
|
// Thana.Service.Delete(id);
|
|
//}
|
|
//#endregion
|
|
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region IThana Service
|
|
public interface IThanaService
|
|
{
|
|
Thana Get(int id);
|
|
Thana Get(string sCode);
|
|
List<Thana> Get();
|
|
List<Thana> GetByDistID(int nDistID);
|
|
List<Thana> Get(EnumStatus status);
|
|
int Save(Thana item);
|
|
void Delete(int id);
|
|
|
|
}
|
|
#endregion
|
|
}
|