CEL_Payroll/Payroll.BO/Attendence/EmpMobileAttendance.cs
2024-09-17 14:30:13 +06:00

123 lines
3.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
namespace Payroll.BO
{
[Serializable]
public class EmpMobileAttendance:BasicBaseObject
{
#region Cache Store
private static Cache _cache = new Cache(typeof(EmpMobileAttendance));
#endregion
#region Constructor
public EmpMobileAttendance()
{
_empID = ID.FromInteger(0);
_iMEINO = string.Empty;
}
#endregion
#region EmployeeID:ID
private ID _empID;
public ID EmpID
{
get { return _empID; }
set { _empID = value; }
}
#endregion
#region IMENO:String
private string _iMEINO;
public string IMENO
{
get { return _iMEINO; }
set { _iMEINO = value; }
}
#endregion
#region Functions
public static ObjectsTemplate<EmpMobileAttendance> Get()
{
#region Cache Header
ObjectsTemplate<EmpMobileAttendance> attendanceTracks = _cache["Get"] as ObjectsTemplate<EmpMobileAttendance>;
if (attendanceTracks != null)
return attendanceTracks;
#endregion
try
{
attendanceTracks = Service.Get();
}
catch (ServiceException e)
{
throw new Exception(e.Message, e);
}
#region Cache Footer
_cache.Add("Get", attendanceTracks);
#endregion
return attendanceTracks;
}
public static EmpMobileAttendance Get(ID nID)
{
EmpMobileAttendance attendanceTrack = null;
#region Cache Header
attendanceTrack = (EmpMobileAttendance)_cache["Get", nID];
if (attendanceTrack != null)
return attendanceTrack;
#endregion
attendanceTrack = Service.Get(nID);
#region Cache Footer
_cache.Add(attendanceTrack, "Get", nID);
#endregion
return attendanceTrack;
}
public ID Save()
{
base.SetAuditTrailProperties();
return Service.Save(this);
}
public ID Delete()
{
return Service.Delete(this);
}
#endregion
#region Service Factory Service : IEmpMobileAttendanceService
internal static IEmpMobileAttendanceService Service
{
get { return Services.Factory.CreateService<IEmpMobileAttendanceService>(typeof(IEmpMobileAttendanceService)); }
}
#endregion
}
#region IEmpMobileAttendanceService : Service
public interface IEmpMobileAttendanceService
{
ObjectsTemplate<EmpMobileAttendance> Get();
EmpMobileAttendance Get(ID nID);
ID Save(EmpMobileAttendance obj);
ID Delete(EmpMobileAttendance obj);
}
#endregion
}