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 BonusProcess [Serializable] public class BonusProcess : AuditTrailBase { #region Cache Store private static Cache _cache = new Cache(typeof(BonusProcess)); #endregion #region Constructor public BonusProcess() { _bonusID = null; _bonusMonth = DateTime.MinValue; _basicOnMonth = DateTime.MinValue; _disburseDate = DateTime.MinValue; _remarks = string.Empty; _showInWeb = false; _IsDisburseWithSalary = false; _IsTaxProcess = false; _UsedProcess = 0.0; // _bonus = null; } #endregion #region Internal Class #region BonusProcessDetail [Serializable] public class BonusProcessDetail : AuditTrailBase { #region Cache Store private static Cache _cache = new Cache(typeof(BonusProcessDetail)); #endregion #region Constructor public BonusProcessDetail() { _bonusProcessID = null; _bonusID = null; _employeeID = null; _bonusMonth = DateTime.MinValue; _bonusAmount = 0; _basicSalary = 0; _changeBonusAmount = 0; _changeAdjustAmount = 0; _changeSalaryItemAmount = 0; _changeTaxAmount = 0; _calculatedAdjustAmount = 0; _calculatedSalaryItemAmount = 0; _taxAmount = 0; _employee = null; _bonus = null; _incomeTax = null; _isProjectedBonus = false; // _bonusProcess = null; } #endregion #region Internal Class public class BonusProcessAdjustItem : AuditTrailBase { #region Cache Store private static Cache _cache = new Cache(typeof(BonusProcessAdjustItem)); #endregion #region Constructor public BonusProcessAdjustItem() { _adjustAmount = 0; _bonusAdjustID = 0; _bonusProcessDetailID = null; //_side = EnumTranSide.Credit; } #endregion #region Properties #region AdjustAmount : double private double _adjustAmount; public double AdjustAmount { get { return _adjustAmount; } set { base.OnPropertyChange("AdjustAmount", _adjustAmount, value); _adjustAmount = value; } } #endregion #region BonusAdjustID : int private int _bonusAdjustID; public int BonusAdjustID { get { return _bonusAdjustID; } set { base.OnPropertyChange("BonusAdjustID", _bonusAdjustID, value); _bonusAdjustID = value; } } #endregion #region BonusProcessDetailID : ID private ID _bonusProcessDetailID; public ID BonusProcessDetailID { get { return _bonusProcessDetailID; } set { base.OnPropertyChange("BonusProcessDetailID", _bonusProcessDetailID, value); _bonusProcessDetailID = value; } } #endregion //#region Side : EnumTranSide //private EnumTranSide _side; //public EnumTranSide Side //{ // get { return _side; } // set {_side = value; } //} //#endregion #endregion } #endregion #region Properties private bool _isProjectedBonus; public bool IsProjectedBonus { get { return _isProjectedBonus; } set { _isProjectedBonus = value; } } #region BonusProcessID : ID private ID _bonusProcessID; public ID BonusProcessID { get { return _bonusProcessID; } set { base.OnPropertyChange("BonusProcessID", _bonusProcessID, value); _bonusProcessID = value; } } #endregion #region BonusID : ID private ID _bonusID; public ID BonusID { get { return _bonusID; } set { base.OnPropertyChange("BonusID", _bonusID, value); _bonusID = value; } } #endregion #region EmployeeID : ID private ID _employeeID; public ID EmployeeID { get { return _employeeID; } set { base.OnPropertyChange("EmployeeID", _employeeID, value); _employeeID = value; } } #endregion #region disburseDate : DateTime private DateTime _bonusMonth; public DateTime BonusMonth { get { return _bonusMonth; } set { base.OnPropertyChange("BonusMonth", _bonusMonth, value); _bonusMonth = value; } } #endregion #region bonusAmount : double private double _bonusAmount; public double BonusAmount { get { return _bonusAmount; } set { base.OnPropertyChange("bonusAmount", _bonusAmount, value); _bonusAmount = value; } } #endregion #region basicSalary : double private double _basicSalary; public double BasicSalary { get { return _basicSalary; } set { base.OnPropertyChange("basicSalary", _basicSalary, value); _basicSalary = value; } } #endregion private double _grossSalary; public double GrossSalary { get { return _grossSalary; } set { _grossSalary = value; } } #region changeBonusAmount : double private double _changeBonusAmount; public double ChangeBonusAmount { get { return _changeBonusAmount; } set { base.OnPropertyChange("changeBonusAmount", _changeBonusAmount, value); _changeBonusAmount = value; } } #endregion #region changeTaxAmount : double private double _changeTaxAmount; public double ChangeTaxAmount { get { return _changeTaxAmount; } set { base.OnPropertyChange("changeTaxAmount", _changeTaxAmount, value); _changeTaxAmount = value; } } #endregion #region ChangeSalaryItemAmount : double private double _changeSalaryItemAmount; public double ChangeSalaryItemAmount { get { return _changeSalaryItemAmount; } set { base.OnPropertyChange("ChangeSalaryItemAmount", _changeSalaryItemAmount, value); _changeSalaryItemAmount = value; } } #endregion #region ChangeSalaryItemAmount : double private double _changeAdjustAmount; public double ChangeAdjustAmount { get { return _changeAdjustAmount; } set { base.OnPropertyChange("ChangeAdjustAmount", _changeAdjustAmount, value); _changeAdjustAmount = value; } } #endregion #region CalculatedAdjustAmount : double private double _calculatedAdjustAmount; public double CalculatedAdjustAmount { get { return _calculatedAdjustAmount; } set { base.OnPropertyChange("CalculatedAdjustAmount", _calculatedAdjustAmount, value); _calculatedAdjustAmount = value; } } #endregion #region CalculatedSalaryItemAmount : double private double _calculatedSalaryItemAmount; public double CalculatedSalaryItemAmount { get { return _calculatedSalaryItemAmount; } set { base.OnPropertyChange("CalculatedSalaryItemAmount", _calculatedSalaryItemAmount, value); _calculatedSalaryItemAmount = value; } } #endregion #region NetBonusAmount : double public double NetBonusAmount { get { bool isOtherItem = ConfigurationManager.GetBoolValue("incometax", "taxissalaryotheritem", EnumConfigurationType.Logic); if(isOtherItem==true) return _changeBonusAmount; else return (_changeBonusAmount - _changeTaxAmount) ; } } #endregion #region taxAmount : double private double _taxAmount; public double TaxAmount { get { return _taxAmount; } set { base.OnPropertyChange("taxAmount", _taxAmount, value); _taxAmount = value; } } #endregion #region BonusProcessAdjustItems : BonusProcessAdjustItems private ObjectsTemplate _BonusProcessAdjustItems = null; public ObjectsTemplate BonusProcessAdjustItems { get { //if (_BonusProcessAdjustItems == null) // this._BonusProcessAdjustItems = new ObjectsTemplate(); return this._BonusProcessAdjustItems; } set { _BonusProcessAdjustItems = value; } } #endregion #region employee : Employee private Employee _employee; public Employee Employee { get { if (_employeeID.Integer > 0 && _employee == null) { _employee = new Employee(); _employee = Employee.Get(_employeeID); } return this._employee; } set { _employee = value; } } #endregion #region Bonus EmpCostCenter : BonusEmpCotCenter private ObjectsTemplate _bonusEmpCostCenters; public ObjectsTemplate BonusCostCentersInvolments { get { if (_bonusEmpCostCenters == null) { _bonusEmpCostCenters = new ObjectsTemplate(); } return _bonusEmpCostCenters; } set { _bonusEmpCostCenters = value; } } #endregion #region bonus : Bonus private Bonus _bonus; public Bonus Bonus { get { if (_bonusID.Integer > 0 && _bonus == null) { _bonus = new Bonus(); _bonus = Bonus.Get(_bonusID); } return this._bonus; } set { _bonus = value; } } #endregion #region BonusProcessAdjustItems : BonusProcessAdjustItems //private ObjectsTemplate _BonusProcessAdjustItems = null; //public ObjectsTemplate BonusProcessAdjustItems //{ // get // { // return this._BonusProcessAdjustItems; // } // set // { // _BonusProcessAdjustItems = value; // } //} #endregion #region Property IncomeTax : ObjectsTemplate private ObjectsTemplate _incomeTax = null; public ObjectsTemplate IncomeTaxcoll { get { return _incomeTax; } set { _incomeTax = value; } } #endregion Property IncomeTax : ObjectsTemplate #endregion } #endregion #endregion #region Properties #region BonusID : ID private ID _bonusID; public ID BonusID { get { return _bonusID; } set { base.OnPropertyChange("BonusID", _bonusID, value); _bonusID = value; } } #endregion #region bonusMonth : DateTime private DateTime _bonusMonth; public DateTime BonusMonth { get { return _bonusMonth; } set { base.OnPropertyChange("bonusMonth", _bonusMonth, value); _bonusMonth = value; } } #endregion #region basicOnMonth : DateTime private DateTime _basicOnMonth; public DateTime BasicOnMonth { get { return _basicOnMonth; } set { base.OnPropertyChange("basicOnMonth", _basicOnMonth, value); _basicOnMonth = value; } } #endregion #region disburseDate : DateTime private DateTime _disburseDate; public DateTime DisburseDate { get { return _disburseDate; } set { base.OnPropertyChange("disburseDate", _disburseDate, value); _disburseDate = value; } } #endregion #region FestivalDate : DateTime private DateTime _festivalDate; public DateTime FestivalDate { get { return _festivalDate; } set { base.OnPropertyChange("FestivalDate", _festivalDate, value); _festivalDate = value; } } #endregion #region religionID : ID private ID _religionID; public ID ReligionID { get { return _religionID; } set { base.OnPropertyChange("ReligionID", _religionID, value); _religionID = value; } } #endregion #region remarks : string private string _remarks; public string Remarks { get { return _remarks; } set { base.OnPropertyChange("remarks", _remarks, value); _remarks = value; } } #endregion #region showInWeb : bool private bool _showInWeb; public bool ShowInWeb { get { return _showInWeb; } set { base.OnPropertyChange("showInWeb", _showInWeb, value); _showInWeb = value; } } #endregion #region IsDisburseWithSalary : bool private bool _IsDisburseWithSalary; public bool IsDisburseWithSalary { get { return _IsDisburseWithSalary; } set { base.OnPropertyChange("IsDisburseWithSalary", _IsDisburseWithSalary, value); _IsDisburseWithSalary = value; } } #endregion #region IsTaxProcess : bool private bool _IsTaxProcess; public bool IsTaxProcess { get { return _IsTaxProcess; } set { base.OnPropertyChange("IsTaxProcess", _IsTaxProcess, value); _IsTaxProcess = value; } } #endregion #region BonusProcessDetails : BonusProcessDetails private ObjectsTemplate _BonusProcessDetails = null; public ObjectsTemplate BonusProcessDetails { get { if (_BonusProcessDetails == null) { if (!this.ID.IsUnassigned) { _BonusProcessDetails = new ObjectsTemplate(); _BonusProcessDetails = BonusProcess.Service.GetBonusDetails(this.ID.Integer); if (_BonusProcessDetails.Count == 0) _BonusProcessDetails = null; } } return _BonusProcessDetails; } set { _BonusProcessDetails = value; } } #endregion #region UsedProcess : int private double _UsedProcess; public double UsedProcess { get { return _UsedProcess; } set { base.OnPropertyChange("UsedProcess", _UsedProcess, value); _UsedProcess = value; } } #endregion #region Service Factory IBonusProcessService : IBonusProcessService internal static IBonusProcessService Service { get { return Services.Factory.CreateService(typeof(IBonusProcessService)); } } #endregion #endregion #region Functions public static double GetBonusAmount(DateTime bonusMonthFirstDate, ID employeeID, int bonusID) { double bonusAmount = 0; try { bonusAmount = BonusProcess.Service.GetBonusAmount(bonusMonthFirstDate, employeeID, bonusID, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (Exception e) { if (e.InnerException == null) { throw new Exception(e.Message); } else { throw new Exception(e.Message, e.InnerException); } } return bonusAmount; } public static double GetUsedBonusWithinYear(DateTime bonusMonthFirstDate,int bonusID) { double usedBonus = 0; try { usedBonus = BonusProcess.Service.GetUsedBonusWithinYear(bonusMonthFirstDate, bonusID, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (Exception e) { if (e.InnerException == null) { throw new Exception(e.Message); } else { throw new Exception(e.Message, e.InnerException); } } return usedBonus; } public static double GetBonusAmountWithinYear(DateTime bonusYearDate, ID employeeID, int bonusID) { double bonusAmount = 0; try { bonusAmount = BonusProcess.Service.GetBonusAmountWithinYear(bonusYearDate, employeeID, bonusID, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (Exception e) { if (e.InnerException == null) { throw new Exception(e.Message); } else { throw new Exception(e.Message, e.InnerException); } } return bonusAmount; } public static double GetBonusPaidAmount(DateTime date1, DateTime date2, ID employeeID, int bonusID) { double bonusAmount = 0; try { bonusAmount = BonusProcess.Service.GetBonusPaidAmount(date1, date2, employeeID, bonusID); } catch (Exception e) { if (e.InnerException == null) { throw new Exception(e.Message); } else { throw new Exception(e.Message, e.InnerException); } } return bonusAmount; } public static double GetBonusAmountWithinYear(DateTime bonusYearDate, ID employeeID, int bonusID,int nReligionID) { double bonusAmount = 0; try { bonusAmount = BonusProcess.Service.GetBonusAmountWithinYear(bonusYearDate, employeeID, bonusID, SystemInformation.CurrentSysInfo.PayrollTypeID, nReligionID); } catch (Exception e) { if (e.InnerException == null) { throw new Exception(e.Message); } else { throw new Exception(e.Message, e.InnerException); } } return bonusAmount; } public static double GetKPIBonusAmountWithinYear(DateTime bonusYearDate, ID employeeID, int bonusID, int nReligionID) { double bonusAmount = 0; try { bonusAmount = BonusProcess.Service.GetKPIBonusAmountWithinYear(bonusYearDate, employeeID, bonusID, SystemInformation.CurrentSysInfo.PayrollTypeID, nReligionID); } catch (Exception e) { if (e.InnerException == null) { throw new Exception(e.Message); } else { throw new Exception(e.Message, e.InnerException); } } return bonusAmount; } public static double GetPreviousKPIBonusAmount(ID employeeID, int bonusID, string bonusProcessIDs) { double bonusAmount = 0; try { bonusAmount = BonusProcess.Service.GetPreviousKPIBonusAmount(employeeID, bonusID, bonusProcessIDs, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (Exception e) { if (e.InnerException == null) { throw new Exception(e.Message); } else { throw new Exception(e.Message, e.InnerException); } } return bonusAmount; } public static double GetKPIBonusAmountWithinYearPercent(DateTime bonusYearDate, ID employeeID, int bonusID, int nReligionID) { double bonusAmount = 0; try { bonusAmount = BonusProcess.Service.GetKPIBonusAmountWithinYearPercent(bonusYearDate, employeeID, bonusID, SystemInformation.CurrentSysInfo.PayrollTypeID, nReligionID); } catch (Exception e) { if (e.InnerException == null) { throw new Exception(e.Message); } else { throw new Exception(e.Message, e.InnerException); } } return bonusAmount; } public static BonusProcess Get(ID nID) { BonusProcess oBonusProcess = null; #region Cache Header oBonusProcess = (BonusProcess)_cache["Get", nID]; if (oBonusProcess != null) return oBonusProcess; #endregion oBonusProcess = BonusProcess.Service.Get(nID, SystemInformation.CurrentSysInfo.PayrollTypeID); #region Cache Footer _cache.Add(oBonusProcess, "Get", nID); #endregion return oBonusProcess; } public static BonusProcess Get(ID nBonusID, DateTime bonusMonth) { BonusProcess oBonusProcess = null; oBonusProcess = BonusProcess.Service.Get(nBonusID, bonusMonth, SystemInformation.CurrentSysInfo.PayrollTypeID); return oBonusProcess; } public static BonusProcess Get(ID nBonusID, DateTime bonusMonth,int nQuarterID) { BonusProcess oBonusProcess = null; oBonusProcess = BonusProcess.Service.Get(nBonusID, bonusMonth, SystemInformation.CurrentSysInfo.PayrollTypeID, nQuarterID); return oBonusProcess; } public static ObjectsTemplate GetProcess(DateTime bonusMonth) { #region Cache Header ObjectsTemplate bonusProcesss = _cache["GetProcess", bonusMonth] as ObjectsTemplate; if (bonusProcesss != null) return bonusProcesss; #endregion try { bonusProcesss = Service.GetProcess(bonusMonth, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(bonusProcesss, "GetProcess", bonusMonth); #endregion return bonusProcesss; } public static ObjectsTemplate GetBonusDetails(DateTime dMonth, bool bPayWithsalary) { #region Cache Header ObjectsTemplate bonusProcesssDetails = _cache["GetBonusDetails", dMonth, bPayWithsalary] as ObjectsTemplate; if (bonusProcesssDetails != null) return bonusProcesssDetails; #endregion try { bonusProcesssDetails = Service.GetBonusDetails(dMonth, bPayWithsalary, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(bonusProcesssDetails, "GetBonusDetails", dMonth, bPayWithsalary); #endregion return bonusProcesssDetails; } public static ObjectsTemplate GetBonusDetails(DateTime dMonth, bool bPayWithsalary,int nEmpID) { #region Cache Header ObjectsTemplate bonusProcesssDetails = _cache["GetBonusDetails", dMonth, bPayWithsalary] as ObjectsTemplate; if (bonusProcesssDetails != null) return bonusProcesssDetails; #endregion try { bonusProcesssDetails = Service.GetBonusDetails(dMonth, bPayWithsalary, SystemInformation.CurrentSysInfo.PayrollTypeID, nEmpID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(bonusProcesssDetails, "GetBonusDetails", dMonth, bPayWithsalary); #endregion return bonusProcesssDetails; } public static ObjectsTemplate GetBonusDetails(DateTime dMonth, int nEmpID,int nBonusID) { #region Cache Header ObjectsTemplate bonusProcesssDetails = _cache["GetBonusDetails", dMonth] as ObjectsTemplate; if (bonusProcesssDetails != null) return bonusProcesssDetails; #endregion try { bonusProcesssDetails = Service.GetBonusDetails(dMonth, nEmpID, nBonusID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(bonusProcesssDetails, "GetBonusDetails", dMonth); #endregion return bonusProcesssDetails; } public static ObjectsTemplate GetBonusDetails(DateTime dMonth) { #region Cache Header ObjectsTemplate bonusProcesssDetails = _cache["GetBonusDetails", dMonth] as ObjectsTemplate; if (bonusProcesssDetails != null) return bonusProcesssDetails; #endregion try { bonusProcesssDetails = Service.GetBonusDetails(dMonth, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(bonusProcesssDetails, "GetBonusDetails", dMonth); #endregion return bonusProcesssDetails; } public static ObjectsTemplate GetBonusDetails(int nID) { #region Cache Header ObjectsTemplate bonusProcesssDetails = _cache["GetBonusDetails", nID] as ObjectsTemplate; if (bonusProcesssDetails != null) return bonusProcesssDetails; #endregion try { bonusProcesssDetails = Service.GetBonusDetails(nID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(bonusProcesssDetails, "GetBonusDetails", nID); #endregion return bonusProcesssDetails; } public static ObjectsTemplate GetSumOfBonusDetails(DateTime fromMonth, DateTime toMonth) { #region Cache Header ObjectsTemplate bonusProcesssDetails = _cache["GetSumOfBonusDetails", fromMonth, toMonth] as ObjectsTemplate; if (bonusProcesssDetails != null) return bonusProcesssDetails; #endregion try { bonusProcesssDetails = Service.GetSumOfBonusDetails(fromMonth, toMonth, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(bonusProcesssDetails, "GetSumOfBonusDetails", fromMonth, toMonth); #endregion return bonusProcesssDetails; } //public static ObjectsTemplate GetBProcessAdjust(ID bonusProDetailID) //{ // #region Cache Header // ObjectsTemplate bonusProcessAdjustItems = _cache["GetBProcessAdjust", bonusProDetailID] as ObjectsTemplate; // if (bonusProcessAdjustItems != null) // return bonusProcessAdjustItems; // #endregion // try // { // bonusProcessAdjustItems = Service.GetBProcessAdjust(bonusProDetailID); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(bonusProcessAdjustItems, "GetBProcessAdjust", bonusProDetailID); // #endregion // return bonusProcessAdjustItems; //} public static DataSet GetBonusRegisterCarFuel(DateTime dBonusMonth, string sEmpID) { DataSet ds = null; try { ds = Service.GetBonusRegisterCarFuel(dBonusMonth, sEmpID); } catch (Exception e) { throw new Exception(e.Message, e); } return ds; } public static DataSet GetBonusRegister(ID BonusID,DateTime dBonusMonth, string sEmpID) { DataSet ds = null; try { ds = Service.GetBonusRegister(BonusID,dBonusMonth, sEmpID, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (Exception e) { throw new Exception(e.Message, e); } return ds; } public static DataSet GetBonusBankAdvice(ID BonusID, DateTime dBonusMonth, string sEmpID) { DataSet ds = null; try { ds = Service.GetBonusBankAdvice(BonusID, dBonusMonth, sEmpID, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (Exception e) { throw new Exception(e.Message, e); } return ds; } public static DataSet GetBonusPaySlip(ID BonusID, DateTime dBonusMonth, string sEmpID) { DataSet ds = null; try { ds = Service.GetBonusPaySlip(BonusID, dBonusMonth, sEmpID, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (Exception e) { throw new Exception(e.Message, e); } return ds; } public static DataSet GetOldBonusPaySlip(ID BonusID, DateTime dBonusMonth, string sEmpID) { DataSet ds = null; try { ds = Service.GetOldBonusPaySlip(BonusID, dBonusMonth, sEmpID, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (Exception e) { throw new Exception(e.Message, e); } return ds; } public static DataSet GetOldBonusRegister(ID BonusID, DateTime dBonusMonth, string sEmpID) { DataSet ds = null; try { ds = Service.GetOldBonusRegister(BonusID, dBonusMonth, sEmpID, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (Exception e) { throw new Exception(e.Message, e); } return ds; } public static int GetForNoOfPaidForEmp(DateTime bonusYearDate, int bonusID,int empId) { int PaidItem = 0; try { PaidItem = BonusProcess.Service.GetForNoOfPaidForEmp(bonusYearDate, bonusID, empId, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (Exception e) { if (e.InnerException == null) { throw new Exception(e.Message); } else { throw new Exception(e.Message, e.InnerException); } } return PaidItem; } public static int GetForNoOfPaid(DateTime bonusYearDate,int bonusID) { int PaidItem = 0; try { PaidItem = BonusProcess.Service.GetForNoOfPaid(bonusYearDate, bonusID, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (Exception e) { if (e.InnerException == null) { throw new Exception(e.Message); } else { throw new Exception(e.Message, e.InnerException); } } return PaidItem; } public static ObjectsTemplate GetProcess(ID bonusID, DateTime bonusMonth) { #region Cache Header ObjectsTemplate bonusProcesss = _cache["GetProcess", bonusID, bonusMonth] as ObjectsTemplate; if (bonusProcesss != null) return bonusProcesss; #endregion try { bonusProcesss = Service.GetProcess(bonusID, bonusMonth, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(bonusProcesss, "GetProcess", bonusID, bonusMonth); #endregion return bonusProcesss; } public static ObjectsTemplate GetProcess() { #region Cache Header ObjectsTemplate bonusProcesss = _cache["GetProcess"] as ObjectsTemplate; if (bonusProcesss != null) return bonusProcesss; #endregion try { bonusProcesss = Service.GetProcess(SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(bonusProcesss, "GetProcess"); #endregion return bonusProcesss; } public static ObjectsTemplate GetProcess(DateTime fromMonth, DateTime toDate,ID religionID, ID bonusID) { #region Cache Header ObjectsTemplate bonusProcesss = new ObjectsTemplate(); if (bonusProcesss != null) return bonusProcesss; #endregion try { bonusProcesss = Service.GetProcess(fromMonth, toDate,religionID, bonusID,Payroll.BO.SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); } catch (ServiceException e) { throw new Exception(e.Message, e); } return bonusProcesss; } public ID Save() { this.SetAuditTrailProperties(); return BonusProcess.Service.Save(this, SystemInformation.CurrentSysInfo.PayrollTypeID); } public void BulkSave() { this.SetAuditTrailProperties(); BonusProcess.Service.BulkSave(this); } public static void UndoProcess(BonusProcess oBonusProcess) { BonusProcess.Service.Delete(oBonusProcess, SystemInformation.CurrentSysInfo.PayrollTypeID); } #endregion } #endregion #region IBonusProcess Service public interface IBonusProcessService { double GetPreviousKPIBonusAmount(ID employeeID, int bonusID, string bonusProcessIDs, ID PayrollTypeID); ObjectsTemplate GetProcess(ID PayrollTypeID); double GetBonusAmount(DateTime bonusMonthFirstDate, ID employeeID, int bonusID, ID PayrollTypeID); double GetBonusAmountWithinYear(DateTime bonusYearDate, ID employeeID, int bonusID, ID PayrollTypeId); double GetBonusAmountWithinYear(DateTime bonusYearDate, ID employeeID, int bonusID, ID PayrollTypeId,int nReligionID); double GetBonusPaidAmount(DateTime date1, DateTime date2, ID employeeID, int bonusID); double GetKPIBonusAmountWithinYear(DateTime bonusYearDate, ID employeeID, int bonusID, ID PayrollTypeId, int nReligionID); double GetKPIBonusAmountWithinYearPercent(DateTime bonusYearDate, ID employeeID, int bonusID, ID PayrollTypeId, int nReligionID); double GetUsedBonusWithinYear(DateTime bonusYearDate,int bonusID, ID PayrollTypeID); BonusProcess Get(ID id, ID PayrollTypeID); int GetForNoOfPaid(DateTime bonusYear, int bonusID, ID PayrollTypeID); BonusProcess Get(ID bonusID, DateTime bonusMonth, ID PayrollTypeID); BonusProcess Get(ID bonusID, DateTime bonusMonth, ID PayrollTypeID, int nQuarterID); ObjectsTemplate GetBonusDetails(DateTime dMonth, bool bPayWithSalary, ID PayrollTypeID); ObjectsTemplate GetBonusDetails(DateTime dMonth, bool bPayWithSalary, ID PayrollTypeID,int nEmpID); ObjectsTemplate GetBonusDetails(DateTime dMonth, int nEmpID,int nBonusID); ObjectsTemplate GetSumOfBonusDetails(DateTime fromMonth, DateTime toDate, ID PayrollTypeID); DataSet GetBonusRegister(ID BonusID, DateTime dBonusMonth, string sEmpID, ID PayrollTypeID); DataSet GetBonusRegisterCarFuel( DateTime dBonusMonth, string sEmpID); DataSet GetBonusBankAdvice(ID BonusID, DateTime dBonusMonth, string sEmpID, ID PayrollTypeID); DataSet GetBonusPaySlip(ID BonusID, DateTime dBonusMonth, string sEmpID, ID PayrollTypeID); DataSet GetOldBonusPaySlip(ID BonusID, DateTime dBonusMonth, string sEmpID, ID PayrollTypeID); DataSet GetOldBonusRegister(ID BonusID, DateTime dBonusMonth, string sEmpID, ID PayrollTypeID); ID Save(BonusProcess item, ID PayrollTypeID); void BulkSave(BonusProcess item); void Delete(BonusProcess oBonusProcess, ID PayrollTypeID); ObjectsTemplate GetProcess(ID bonusID, DateTime bonusMonth, ID PayrollTypeID); ObjectsTemplate GetProcess(DateTime bonusMonth, ID PayrollTypeId); int GetForNoOfPaidForEmp(DateTime bonusYearDate, int bonusID, int empId, ID PayrollTytpeID); ObjectsTemplate GetBonusDetails(DateTime dMonth, ID PayrollTypeID); ObjectsTemplate GetBonusDetails(int nID); ObjectsTemplate GetProcess(DateTime fromMonth, DateTime toDate, ID religionID, ID bonusID,int payrollTypeID); } #endregion }