CEL_Payroll/Payroll.BO/Bonus/ProdBonusWorkSchedule.cs

234 lines
6.0 KiB
C#
Raw Permalink Normal View History

2024-09-17 14:30:13 +06:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ease.CoreV35;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
using System.Data.Linq.Mapping;
using System.Data;
namespace Payroll.BO
{
#region ProdBonusWorkSchedule
[Serializable]
public class ProdBonusWorkSchedule: BasicBaseObject
{
#region Cache Store
private static Cache _cache = new Cache(typeof(ProdBonusWorkSchedule));
#endregion
#region Constructor
#region Input validator
#endregion
public ProdBonusWorkSchedule()
{
// _endDateTime = DateTime.MinValue;
_startDateTime = DateTime.MinValue;
}
#endregion
#region Properties
#region ProdBonusSetupID : ID
private ID _prodBonusSetupID;
public ID ProdBonusSetupID
{
get { return _prodBonusSetupID; }
set
{
base.OnPropertyChange<ID>("ProdBonusSetupID", _prodBonusSetupID, value);
_prodBonusSetupID = value;
}
}
#endregion
#region ProdBonusLineID : ID
private ID _prodBonusLineID;
public ID ProdBonusLineID
{
get { return _prodBonusLineID; }
set
{
base.OnPropertyChange<ID>("ProdBonusLineID", _prodBonusLineID, value);
_prodBonusLineID = value;
}
}
#endregion
#region StartDateTime : DateTime
private DateTime _startDateTime;
public DateTime StartDateTime
{
get { return _startDateTime; }
set
{
base.OnPropertyChange<DateTime>("StartDateTime", _startDateTime, value);
_startDateTime = value;
}
}
#endregion
//#region Property ProdBonusAttns : ProdBonusWorkSchedules
//private ObjectsTemplate<ProdBonusAttn> _ProdBonusAttns;
//public ObjectsTemplate<ProdBonusAttn> ProdBonusAttns
//{
// get
// {
// if (_ProdBonusAttns == null && !this.ID.IsUnassigned && this.ID.Integer > 0)
// {
// _ProdBonusAttns = ProdBonusAttn.(this.ID);
// }
// return _prodBonusWorkSchedule;
// }
// set
// {
// _prodBonusWorkSchedule = value;
// }
//}
//#endregion
//#region EndDateTime : DateTime
//private DateTime _endDateTime;
//public DateTime EndDateTime
//{
// get { return _endDateTime; }
// set
// {
// base.OnPropertyChange<DateTime>("EndDateTime", _endDateTime, value);
// _endDateTime = value;
// }
//}
//#endregion
#region Service Factory IProdBonusWorkScheduleService : IProdBonusWorkScheduleService
internal static IProdBonusWorkScheduleService Service
{
get { return Services.Factory.CreateService<IProdBonusWorkScheduleService>(typeof(IProdBonusWorkScheduleService)); }
}
#endregion
#endregion
#region Functions
public static ProdBonusWorkSchedule Get(ID nID)
{
ProdBonusWorkSchedule oProdBonusWorkSchedule = null;
#region Cache Header
oProdBonusWorkSchedule = (ProdBonusWorkSchedule)_cache["Get", nID];
if (oProdBonusWorkSchedule != null)
return oProdBonusWorkSchedule;
#endregion
oProdBonusWorkSchedule = ProdBonusWorkSchedule.Service.Get(nID);
#region Cache Footer
_cache.Add(oProdBonusWorkSchedule, "Get", nID);
#endregion
return oProdBonusWorkSchedule;
}
public static ObjectsTemplate<ProdBonusWorkSchedule> Get()
{
#region Cache Header
ObjectsTemplate<ProdBonusWorkSchedule> ProdBonusWorkSchedules = _cache["Get"] as ObjectsTemplate<ProdBonusWorkSchedule>;
if (ProdBonusWorkSchedules != null)
return ProdBonusWorkSchedules;
#endregion
try
{
ProdBonusWorkSchedules = Service.Get();
}
catch (ServiceException e)
{
throw new Exception(e.Message, e);
}
#region Cache Footer
_cache.Add(ProdBonusWorkSchedules, "Get");
#endregion
return ProdBonusWorkSchedules;
}
public static ObjectsTemplate<ProdBonusWorkSchedule> Get(int nSetupID)
{
#region Cache Header
ObjectsTemplate<ProdBonusWorkSchedule> ProdBonusWorkSchedules = _cache["Get"] as ObjectsTemplate<ProdBonusWorkSchedule>;
if (ProdBonusWorkSchedules != null)
return ProdBonusWorkSchedules;
#endregion
try
{
ProdBonusWorkSchedules = Service.Get(nSetupID);
}
catch (ServiceException e)
{
throw new Exception(e.Message, e);
}
#region Cache Footer
_cache.Add(ProdBonusWorkSchedules, "Get");
#endregion
return ProdBonusWorkSchedules;
}
public ID Save()
{
this.SetAuditTrailProperties();
return ProdBonusWorkSchedule.Service.Save(this);
}
public void Delete(ID id)
{
ProdBonusWorkSchedule.Service.Delete(id);
}
#endregion
}
#endregion
#region IProdBonusWorkSchedule Service
public interface IProdBonusWorkScheduleService
{
ProdBonusWorkSchedule Get(ID id);
ObjectsTemplate<ProdBonusWorkSchedule> Get();
ObjectsTemplate<ProdBonusWorkSchedule> Get(int nSetupID);
ID Save(ProdBonusWorkSchedule item);
void Delete(ID id);
}
#endregion
}