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

197 lines
4.6 KiB
C#

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 ProdBonusSupervisor
[Serializable]
public class ProdBonusSupervisor: BasicBaseObject
{
#region Cache Store
private static Cache _cache = new Cache(typeof(ProdBonusSupervisor));
#endregion
#region Constructor
#region Input validator
#endregion
public ProdBonusSupervisor()
{
}
#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 EmployeeID : ID
private ID _employeeID;
public ID EmployeeID
{
get { return _employeeID; }
set
{
base.OnPropertyChange<ID>("EmployeeID", _employeeID, value);
_employeeID = value;
}
}
#endregion
#region BonusPercent : double
private double _bonusPercent;
public double BonusPercent
{
get { return _bonusPercent; }
set
{
base.OnPropertyChange<double>("BonusPercent", _bonusPercent, value);
_bonusPercent = value;
}
}
#endregion
#region Amount : double
private double _amount;
public double Amount
{
get { return _amount; }
set
{
base.OnPropertyChange<double>("Amount", _amount, value);
_amount = value;
}
}
#endregion
#region Service Factory IProdBonusSupervisorService : IProdBonusSupervisorService
internal static IProdBonusSupervisorService Service
{
get { return Services.Factory.CreateService<IProdBonusSupervisorService>(typeof(IProdBonusSupervisorService)); }
}
#endregion
#endregion
#region Functions
public static ProdBonusSupervisor Get(ID nID)
{
ProdBonusSupervisor oProdBonusSupervisor = null;
#region Cache Header
oProdBonusSupervisor = (ProdBonusSupervisor)_cache["Get", nID];
if (oProdBonusSupervisor != null)
return oProdBonusSupervisor;
#endregion
oProdBonusSupervisor = ProdBonusSupervisor.Service.Get(nID);
#region Cache Footer
_cache.Add(oProdBonusSupervisor, "Get", nID);
#endregion
return oProdBonusSupervisor;
}
public static ObjectsTemplate<ProdBonusSupervisor> Get()
{
#region Cache Header
ObjectsTemplate<ProdBonusSupervisor> ProdBonusSupervisors = _cache["Get"] as ObjectsTemplate<ProdBonusSupervisor>;
if (ProdBonusSupervisors != null)
return ProdBonusSupervisors;
#endregion
try
{
ProdBonusSupervisors = Service.Get();
}
catch (ServiceException e)
{
throw new Exception(e.Message, e);
}
#region Cache Footer
_cache.Add(ProdBonusSupervisors, "Get");
#endregion
return ProdBonusSupervisors;
}
public ID Save()
{
this.SetAuditTrailProperties();
return ProdBonusSupervisor.Service.Save(this);
}
public void Delete(ID id)
{
ProdBonusSupervisor.Service.Delete(id);
}
#endregion
}
#endregion
#region IProdBonusSupervisor Service
public interface IProdBonusSupervisorService
{
ProdBonusSupervisor Get(ID id);
ObjectsTemplate<ProdBonusSupervisor> Get();
ID Save(ProdBonusSupervisor item);
void Delete(ID id);
}
#endregion
}