EchoTex_Payroll/HRM.BO/Attendance/OutsideDuty.cs
2024-10-14 10:01:49 +06:00

163 lines
4.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ease.Core;
namespace HRM.BO
{
#region OutsideDuty
[Serializable]
public class OutsideDuty : BasicBaseObject
{
#region Constructor
public OutsideDuty()
{
_name = string.Empty;
_status = EnumStatus.Active;
}
#region Input validator
public string[] InputValidator()
{
string[] sErrorString = new string[2];
if (this.Name == "")
{
sErrorString[0] = "Name can not be empty";
sErrorString[1] = "Name";
return sErrorString;
}
sErrorString = null;
return sErrorString;
}
#endregion
#endregion
#region Properties
#region Name : string
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
#endregion
//#region Service Factory IOutsideDutyService : IOutsideDutyService
//internal static IOutsideDutyService Service
//{
// get { return Services.Factory.CreateService<IOutsideDutyService>(typeof(IOutsideDutyService)); }
//}
//#endregion
#endregion
//#region Functions
//public static OutsideDuty Get(ID nID)
//{
// OutsideDuty oOutsideDuty = null;
// #region Cache Header
// oOutsideDuty = (OutsideDuty)_cache["Get", nID];
// if (oOutsideDuty != null)
// return oOutsideDuty;
// #endregion
// oOutsideDuty = OutsideDuty.Service.Get(nID);
// #region Cache Footer
// _cache.Add(oOutsideDuty, "Get", nID);
// #endregion
// return oOutsideDuty;
//}
//public static ObjectsTemplate<OutsideDuty> Get()
//{
// #region Cache Header
// ObjectsTemplate<OutsideDuty> outsideDutys = _cache["Get"] as ObjectsTemplate<OutsideDuty>;
// if (outsideDutys != null)
// return outsideDutys;
// #endregion
// try
// {
// outsideDutys = Service.Get();
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(outsideDutys, "Get");
// #endregion
// return outsideDutys;
//}
//public static ObjectsTemplate<OutsideDuty> Get(EnumStatus status)
//{
// #region Cache Header
// ObjectsTemplate<OutsideDuty> oOutsideDuty = _cache["Get", status] as ObjectsTemplate<OutsideDuty>;
// if (oOutsideDuty != null)
// return oOutsideDuty;
// #endregion
// try
// {
// oOutsideDuty = Service.Get(status);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(oOutsideDuty, "Get", status);
// #endregion
// return oOutsideDuty;
//}
//public ID Save()
//{
// if (this.IsNew)
// {
// this.Status = EnumStatus.Active;
// }
// this.SetAuditTrailProperties();
// return OutsideDuty.Service.Save(this);
//}
//public void Delete(ID id)
//{
// OutsideDuty.Service.Delete(id);
//}
//#endregion
}
#endregion
#region IOutsideDuty Service
public interface IOutsideDutyService
{
OutsideDuty Get(int id);
List<OutsideDuty> Get();
List<OutsideDuty> Get(EnumStatus status);
int Save(OutsideDuty item);
void Delete(int id);
}
#endregion
}