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 private ObjectsTemplate _oFndMngmentEmp; public ObjectsTemplate FndMngmentEmps { get { if (this.ID != null && _oFndMngmentEmp == null) { _oFndMngmentEmp = FndMngmentWF.Service.GetFndMngmentEmps(this.ID); } return _oFndMngmentEmp; } set { _oFndMngmentEmp = value; } } #endregion #region FndMngmentEmps : ObjectsTemplate private ObjectsTemplate _oAllFndMngEmpRemarks; public ObjectsTemplate 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(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 Get(EnumStatus status) { #region Cache Header ObjectsTemplate FndMngments = _cache["Get"] as ObjectsTemplate; 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 GetFndMngmentEmpRemarks(ID FndMngmentEmpID) { #region Cache Header ObjectsTemplate FndMngmentEmpRemarkses = _cache["GetFndMngmentEmpRemarks"] as ObjectsTemplate; 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 Get(EnumStatus status); ID Save(FndMngmentWF oFndMngment); void Delete(ID id); ObjectsTemplate GetFndMngmentEmps(ID FndMngmentWFID); ObjectsTemplate GetFndMngmentEmpRemarks(ID FndMngmentEmpID); ObjectsTemplate GetAllFndMngmentEmpRemarks(ID FndMngmentWFID); void Save(FndMngmentEmpRemarks oFndEmpRemarks); void Deactivate(FndMngmentWF fndMngmentWF); } #endregion }