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

265 lines
6.5 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;
namespace Payroll.BO
{
#region PFinterestProvision
[Serializable]
public class PFinterestProvision : AuditTrailBase
{
#region Cache Store
private static Cache _cache = new Cache(typeof(PFinterestProvision));
#endregion
#region Constructor
public PFinterestProvision()
{
_employeeID = null;
_pFTransactionID = null;
_processedMonthDate = DateTime.MinValue;
_pFamount = 0;
_cPFAmount = 0;
_pFIntProvision = 0;
_cPFIntProvision = 0;
_pending = false;
_pFTransaction = null;
}
#endregion
#region Properties
#region EmployeeID : ID
private ID _employeeID;
public ID EmployeeID
{
get { return _employeeID; }
set
{
base.OnPropertyChange<ID>("EmployeeID", _employeeID, value);
_employeeID = value;
}
}
#endregion
#region processedMonthDate : DateTime
private DateTime _processedMonthDate;
public DateTime ProcessedMonthDate
{
get { return _processedMonthDate; }
set
{
base.OnPropertyChange<DateTime>("processedMonthDate", _processedMonthDate, value);
_processedMonthDate = value;
}
}
#endregion
#region PFTransactionID : ID
private ID _pFTransactionID;
public ID PFTransactionID
{
get { return _pFTransactionID; }
set
{
base.OnPropertyChange<ID>("PFTransactionID", _pFTransactionID, value);
_pFTransactionID = value;
}
}
#endregion
#region pFamount : double
private double _pFamount;
public double PFamount
{
get { return _pFamount; }
set
{
base.OnPropertyChange<double>("pFamount", _pFamount, value);
_pFamount = value;
}
}
#endregion
#region cPFAmount : double
private double _cPFAmount;
public double CPFAmount
{
get { return _cPFAmount; }
set
{
base.OnPropertyChange<double>("cPFAmount", _cPFAmount, value);
_cPFAmount = value;
}
}
#endregion
#region pFIntProvision : double
private double _pFIntProvision;
public double PFIntProvision
{
get { return _pFIntProvision; }
set
{
base.OnPropertyChange<double>("pFIntProvision", _pFIntProvision, value);
_pFIntProvision = value;
}
}
#endregion
#region cPFIntProvision : double
private double _cPFIntProvision;
public double CPFIntProvision
{
get { return _cPFIntProvision; }
set
{
base.OnPropertyChange<double>("cPFIntProvision", _cPFIntProvision, value);
_cPFIntProvision = value;
}
}
#endregion
#region pending : bool
private bool _pending;
public bool Pending
{
get { return _pending; }
set
{
base.OnPropertyChange<bool>("pending", _pending, value);
_pending = value;
}
}
#endregion
#region pFTransaction : PFTransaction
private PFTransaction _pFTransaction;
public PFTransaction PFTransaction
{
get
{
if (_pFTransactionID.Integer > 0 && _pFTransaction == null)
{
_pFTransaction = new PFTransaction();
// _pFTransaction = PFTransaction.Get(_pFTransactionID);
}
return this._pFTransaction;
}
set
{
_pFTransaction = value;
}
}
#endregion
#region Service Factory IPFinterestProvisionService : IPFinterestProvisionService
internal static IPFinterestProvisionService Service
{
get { return Services.Factory.CreateService<IPFinterestProvisionService>(typeof(IPFinterestProvisionService)); }
}
#endregion
#endregion
#region Functions
public static PFinterestProvision Get(ID nEmpID)
{
PFinterestProvision oPFinterestProvision = null;
#region Cache Header
oPFinterestProvision = (PFinterestProvision)_cache["Get", nEmpID];
if (oPFinterestProvision != null)
return oPFinterestProvision;
#endregion
oPFinterestProvision = PFinterestProvision.Service.Get(nEmpID);
#region Cache Footer
_cache.Add(oPFinterestProvision, "Get", nEmpID);
#endregion
return oPFinterestProvision;
}
public static ObjectsTemplate<PFinterestProvision> Get()
{
#region Cache Header
ObjectsTemplate<PFinterestProvision> pFinterestProvisions = _cache["Get"] as ObjectsTemplate<PFinterestProvision>;
if (pFinterestProvisions != null)
return pFinterestProvisions;
#endregion
try
{
pFinterestProvisions = Service.Get();
}
catch (ServiceException e)
{
throw new Exception(e.Message, e);
}
#region Cache Footer
_cache.Add(pFinterestProvisions, "Get");
#endregion
return pFinterestProvisions;
}
public ID Save()
{
this.SetAuditTrailProperties();
return PFinterestProvision.Service.Save(this);
}
public void Delete()
{
PFinterestProvision.Service.Delete(ID);
}
#endregion
}
#endregion
#region IPFinterestProvision Service
public interface IPFinterestProvisionService
{
PFinterestProvision Get(ID nEmpID);
ObjectsTemplate<PFinterestProvision> Get();
ID Save(PFinterestProvision item);
void Delete(ID id);
}
#endregion
}