CEL_Payroll/Payroll.BO/FundManagement/FndMngmentWF.cs

265 lines
7.3 KiB
C#
Raw 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.Caching;
using Ease.CoreV35.Model;
namespace Payroll.BO
{
[Serializable]
public class FndMngmentWF : BasicBaseObject
{
#region Cache Store
private static Cache _cache = new Cache(typeof(FndMngmentWF));
#endregion
#region Constructor
public FndMngmentWF()
{
_sPurchaseType = string.Empty;
_sDescription = string.Empty;
_dPurchaseAmount = 0;
_dPFAmount = 0;
_dCFAmount = 0;
_dPFInterest = 0;
_dCFInterest = 0;
_dGratuity = 0;
_nEmployeeID = null;
_status = EnumStatus.Active;
_oFndMngmentEmp = null;
}
#endregion
#region Properties
#region PurchaseType : string
private string _sPurchaseType;
public string PurchaseType
{
get { return _sPurchaseType; }
set { _sPurchaseType = value; }
}
#endregion
#region PurchaseAmount : double
private double _dPurchaseAmount;
public double PurchaseAmount
{
get { return _dPurchaseAmount; }
set { _dPurchaseAmount = value; }
}
#endregion
#region PFAmount : double
private double _dPFAmount;
public double PFAmount
{
get { return _dPFAmount; }
set { _dPFAmount = value; }
}
#endregion
#region CFAmount : double
private double _dCFAmount;
public double CFAmount
{
get { return _dCFAmount; }
set { _dCFAmount = value; }
}
#endregion
#region PFInterest : double
private double _dPFInterest;
public double PFInterest
{
get { return _dPFInterest; }
set { _dPFInterest = value; }
}
#endregion
#region CFInterest : double
private double _dCFInterest;
public double CFInterest
{
get { return _dCFInterest; }
set { _dCFInterest = value; }
}
#endregion
#region Gratuity : double
private double _dGratuity;
public double Gratuity
{
get { return _dGratuity; }
set { _dGratuity = value; }
}
#endregion
#region EmployeeID : ID
private ID _nEmployeeID;
public ID EmployeeID
{
get { return _nEmployeeID; }
set { _nEmployeeID = value; }
}
#endregion
#region Description : string
private string _sDescription;
public string Description
{
get { return _sDescription; }
set { _sDescription = value; }
}
#endregion
#region Status : EnumStatus
private EnumStatus _eStatus;
public EnumStatus Status
{
get { return _eStatus; }
set { _eStatus = value; }
}
#endregion
#region FndMngmentEmps : ObjectsTemplate<FndMngmentEmp>
private ObjectsTemplate<FndMngmentEmp> _oFndMngmentEmp;
public ObjectsTemplate<FndMngmentEmp> FndMngmentEmps
{
get
{
if (this.ID != null && _oFndMngmentEmp == null)
{
_oFndMngmentEmp = FndMngmentWF.Service.GetFndMngmentEmps(this.ID);
}
return _oFndMngmentEmp;
}
set { _oFndMngmentEmp = value; }
}
#endregion
#region FndMngmentEmps : ObjectsTemplate<FndMngmentEmpRemarks>
private ObjectsTemplate<FndMngmentEmpRemarks> _oAllFndMngEmpRemarks;
public ObjectsTemplate<FndMngmentEmpRemarks> AllFndMngEmpRemarks
{
get
{
if (this.ID != null && _oAllFndMngEmpRemarks == null)
{
_oAllFndMngEmpRemarks = FndMngmentWF.Service.GetAllFndMngmentEmpRemarks(this.ID);
}
return _oAllFndMngEmpRemarks;
}
set { _oAllFndMngEmpRemarks = value; }
}
#endregion
#region Service Factory
internal static IFndMngmentWFService Service
{
get { return Services.Factory.CreateService<IFndMngmentWFService>(typeof(IFndMngmentWFService)); }
}
#endregion
#endregion
#region Functions
public static FndMngmentWF Get(ID FndMngmentId)
{
FndMngmentWF oFndMngment = null;
#region Cache Header
oFndMngment = (FndMngmentWF)_cache["Get", FndMngmentId];
if (oFndMngment != null)
return oFndMngment;
#endregion
oFndMngment = FndMngmentWF.Service.Get(FndMngmentId);
#region Cache Footer
_cache.Add(oFndMngment, "Get", FndMngmentId);
#endregion
return oFndMngment;
}
public static ObjectsTemplate<FndMngmentWF> Get(EnumStatus status)
{
#region Cache Header
ObjectsTemplate<FndMngmentWF> FndMngments = _cache["Get"] as ObjectsTemplate<FndMngmentWF>;
if (FndMngments != null)
return FndMngments;
#endregion
FndMngments = FndMngmentWF.Service.Get(status);
#region Cache Footer
_cache.Add(FndMngments, "Get");
#endregion
return FndMngments;
}
public ID Save()
{
this.SetAuditTrailProperties();
return FndMngmentWF.Service.Save(this);
}
public void Delete()
{
FndMngmentWF.Service.Delete(this.ID);
}
public void Deactivate()
{
this.SetAuditTrailProperties();
FndMngmentWF.Service.Deactivate(this);
}
public static ObjectsTemplate<FndMngmentEmpRemarks> GetFndMngmentEmpRemarks(ID FndMngmentEmpID)
{
#region Cache Header
ObjectsTemplate<FndMngmentEmpRemarks> FndMngmentEmpRemarkses = _cache["GetFndMngmentEmpRemarks"] as ObjectsTemplate<FndMngmentEmpRemarks>;
if (FndMngmentEmpRemarkses != null)
return FndMngmentEmpRemarkses;
#endregion
FndMngmentEmpRemarkses = FndMngmentWF.Service.GetFndMngmentEmpRemarks(FndMngmentEmpID);
#region Cache Footer
_cache.Add(FndMngmentEmpRemarkses, "GetFndMngmentEmpRemarks");
#endregion
return FndMngmentEmpRemarkses;
}
#endregion
}
#region IFndMngment Service
public interface IFndMngmentWFService
{
FndMngmentWF Get(ID id);
ObjectsTemplate<FndMngmentWF> Get(EnumStatus status);
ID Save(FndMngmentWF oFndMngment);
void Delete(ID id);
ObjectsTemplate<FndMngmentEmp> GetFndMngmentEmps(ID FndMngmentWFID);
ObjectsTemplate<FndMngmentEmpRemarks> GetFndMngmentEmpRemarks(ID FndMngmentEmpID);
ObjectsTemplate<FndMngmentEmpRemarks> GetAllFndMngmentEmpRemarks(ID FndMngmentWFID);
void Save(FndMngmentEmpRemarks oFndEmpRemarks);
void Deactivate(FndMngmentWF fndMngmentWF);
}
#endregion
}