using System; using System.Collections.Generic; using System.Data; using System.Linq; namespace HRM.BO { public class ArrearProcess : AuditTrailBase { #region Constructor public ArrearProcess() { _dProcessDate = DateTime.MinValue; _sProcessDescription = string.Empty; _dProcessMonth = DateTime.MinValue; _bIsApproved = false; _iApprovedBy = 0; _iPayrollTypeID = 0; ArrearProcessDetails = new List(); } #endregion #region Properties #region ProcessDate : DateTime private DateTime _dProcessDate; public DateTime ProcessDate { get { return _dProcessDate; } set { _dProcessDate = value; } } #endregion #region ProcessDescription : string private string _sProcessDescription; public string ProcessDescription { get { return _sProcessDescription; } set { _sProcessDescription = value; } } #endregion #region ProcessMonth : DateTime private DateTime _dProcessMonth; public DateTime ProcessMonth { get { return _dProcessMonth; } set { _dProcessMonth = value; } } #endregion #region IsApproved : bool private bool _bIsApproved; public bool IsApproved { get { return _bIsApproved; } set { _bIsApproved = value; } } #endregion #region ApprovedBy : ID private int _iApprovedBy; public int ApprovedBy { get { return _iApprovedBy; } set { _iApprovedBy = value; } } #endregion #region PayrollTypeID : ID private int _iPayrollTypeID; public int PayrollTypeID { get { return _iPayrollTypeID; } set { _iPayrollTypeID = value; } } #endregion public List ArrearProcessDetails { get; set; } //#region ArrearProcessDetails : List //private List _oArrearProcessDetails; //public List ArrearProcessDetails //{ // get // { // if (this.int != null && _oArrearProcessDetails == null) // { // _oArrearProcessDetails = ArrearProcess.Service.GetArrearProcessDetails(this.ID); // } // return _oArrearProcessDetails; // } // set { _oArrearProcessDetails = value; } //} //#endregion //#region Service Factory //internal static IArrearProcessService Service //{ // get { return Services.Factory.CreateService(typeof(IArrearProcessService)); } //} //#endregion #endregion //#region Functions //public static ArrearProcess Get(int nID) //{ // ArrearProcess oArrearProcess = null; // #region Cache Header // oArrearProcess = (ArrearProcess)_cache["Get", nID]; // if (oArrearProcess != null) // return oArrearProcess; // #endregion // oArrearProcess = ArrearProcess.Service.Get(nID); // #region Cache Footer // _cache.Add(oArrearProcess, "Get", nID); // #endregion // return oArrearProcess; //} //public static List Get() //{ // #region Cache Header // List arrearProcesses = _cache["Get"] as List; // if (arrearProcesses != null) // return arrearProcesses; // #endregion // try // { // arrearProcesses = ArrearProcess.Service.Get(SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(arrearProcesses, "Get"); // #endregion // return arrearProcesses; //} //public static List Get(DateTime processMonth) //{ // #region Cache Header // List arrearProcesses = _cache["Get", processMonth] as List; // if (arrearProcesses != null) // return arrearProcesses; // #endregion // try // { // arrearProcesses = ArrearProcess.Service.Get(processMonth, SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(arrearProcesses, "Get", processMonth); // #endregion // return arrearProcesses; //} //public static List GetArrearProcessDetails(string sEmpID, DateTime startDate, DateTime endDate) //{ // #region Cache Header // List arrearProcessDetails = _cache["GetArrearProcessDetails", sEmpID, startDate, endDate] as List; // if (arrearProcessDetails != null) // return arrearProcessDetails; // #endregion // try // { // arrearProcessDetails = Service.GetArrearProcessDetails(sEmpID, startDate, endDate); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(arrearProcessDetails, "GetArrearProcessDetails", sEmpID, startDate, endDate); // #endregion // return arrearProcessDetails; //} //public static DataSet GetArrearProcessDetailsByCCID(string sCCID, DateTime startDate, DateTime endDate) //{ // DataSet ds = null; // try // { // ds = Service.GetArrearProcessDetailsByCCID(sCCID, startDate, endDate, SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); // } // catch (Exception e) // { // throw new Exception(e.Message, e); // } // return ds; //} //public static DataSet GetArrearProcessDetailsByCCIDAndEmpID2(string sCCID, DateTime startDate, DateTime endDate, string sEmpIDs) //{ // DataSet ds = null; // try // { // ds = Service.GetArrearProcessDetailsByCCIDAndEmpID2(sCCID, startDate, endDate, sEmpIDs); // } // catch (Exception e) // { // throw new Exception(e.Message, e); // } // return ds; //} //public static DataSet GetArrearProcessDetailsByCCIDAndEmpID3(string sCCID, DateTime startDate, DateTime endDate, string sEmpIDs) //{ // DataSet ds = null; // try // { // ds = Service.GetArrearProcessDetailsByCCIDAndEmpID3(sCCID, startDate, endDate, sEmpIDs); // } // catch (Exception e) // { // throw new Exception(e.Message, e); // } // return ds; //} //public static DataSet GetArrPrssDetailsByCstIDEmpIDLocAndDeptWise(string sCCID, DateTime startDate, DateTime endDate, string sEmpIDs) //{ // DataSet ds = null; // try // { // ds = Service.GetArrPrssDetailsByCstIDEmpIDLocAndDeptWise(sCCID, startDate, endDate, sEmpIDs); // } // catch (Exception e) // { // throw new Exception(e.Message, e); // } // return ds; //} //public static DataSet GetArrearProcessDetailsByCCIDAndEmpID(string sCCID, DateTime startDate, DateTime endDate, string sEmpIDs) //{ // DataSet ds = null; // try // { // ds = Service.GetArrearProcessDetailsByCCIDAndEmpID(sCCID, startDate, endDate, sEmpIDs, SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); // } // catch (Exception e) // { // throw new Exception(e.Message, e); // } // return ds; //} //public static List GetDetailItems(int nEmpID, DateTime processMonth) //{ // #region Cache Header // List arrearProcesses = _cache["Get", nEmpID, processMonth] as List; // if (arrearProcesses != null) // return arrearProcesses; // #endregion // try // { // arrearProcesses = ArrearProcess.Service.GetDetailItems(nEmpID, processMonth, SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(arrearProcesses, "Get", nEmpID, processMonth); // #endregion // return arrearProcesses; //} //public static DataSet GetDetailItems(string sEmpIDs, DateTime processMonth, int ItemType, int ItemID) //{ // DataSet ds = null; // try // { // ds = ArrearProcess.Service.GetDetailItems(sEmpIDs, processMonth, ItemType, ItemID, SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); // } // catch (Exception e) // { // throw new Exception(e.Message, e); // } // return ds; //} //public static List GetDetails(int arrearProcessId, int nEmpID) //{ // #region Cache Header // List arrearProcesses = _cache["Get", arrearProcessId, nEmpID] as List; // if (arrearProcesses != null) // return arrearProcesses; // #endregion // try // { // arrearProcesses = ArrearProcess.Service.GetDetails(arrearProcessId, nEmpID); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(arrearProcesses, "Get", arrearProcessId, nEmpID); // #endregion // return arrearProcesses; //} //public static List GetDetails(int arrearProcessId, string nEmpID) //{ // #region Cache Header // List arrearProcesses = _cache["Get", arrearProcessId, nEmpID] as List; // if (arrearProcesses != null) // return arrearProcesses; // #endregion // try // { // arrearProcesses = ArrearProcess.Service.GetDetails(arrearProcessId, nEmpID); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(arrearProcesses, "Get", arrearProcessId, nEmpID); // #endregion // return arrearProcesses; //} //public int Save() //{ // this.SetAuditTrailProperties(); // return ArrearProcess.Service.Save(this); //} ////public int SaveDetailItem(List ArrearProcessDetailItems, List updTaxColl) ////{ //// return ArrearProcess.Service.SaveDetailItem(ArrearProcessDetailItems, updTaxColl); ////} //public int SaveDetailItem(List ArrearProcessDetailItems) //{ // return ArrearProcess.Service.SaveDetailItem(ArrearProcessDetailItems); //} //public static void Delete(ArrearProcess oAP) //{ // ArrearProcess.Service.Delete(oAP); //} //public bool IsExist(DateTime dMonth) //{ // return ArrearProcess.Service.IsExist(dMonth, SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); //} //public static void Approve(ArrearProcess prc) //{ // ArrearProcess.Service.Approve(prc, SystemInformation.CurrentSysInfo.PayrollTypeID.Integer, SystemInformation.CurrentSysInfo.NextPayProcessDate); //} //#endregion } #region IHRRequest Service public interface IArrearProcessService { ArrearProcess Get(int ArrearProcessID); List GetWithPayrollType(int payrollTypeID); List Get(DateTime processMonth, int payrollTypeID); int Save(ArrearProcess oItem); void Delete(ArrearProcess oAP); List GetArrearProcessDetails(int ArrearProcessID); List GetArrearProcessDetailItems(int ArrearProcessDetailID); List GetArrearProcessCostDists(int ArrearProcessDetailID); List GetDetailItems(int nEmpID, DateTime processMonth, int payrollTypeID); DataSet GetDetailItems(string sEmpIDs, DateTime processMonth, int ItemType, int ItemID, int payrollTypeID); void Approve(ArrearProcess oAP, int payrollTypeID, DateTime nextPayProcessDate); //int SaveDetailItem(List ArrearProcessDetailItems, List updTaxColl); int SaveDetailItem(List ArrearProcessDetailItems); bool IsExist(DateTime dMonth, int payrollTypeID); List GetArrearProcessDetails(string sEmpID, DateTime startDate, DateTime endDate); DataSet GetArrearProcessDetailsByCCID(string sCCID, DateTime startDate, DateTime endDate, int payrollTypeID); DataSet GetArrearProcessDetailsByCCIDAndEmpID(string sCCID, DateTime startDate, DateTime endDate, string sEmpIDs, int payrollTypeID); DataSet GetArrearProcessDetailsByCCIDAndEmpID2(string sCCID, DateTime startDate, DateTime endDate, string sEmpIDs); DataSet GetArrearProcessDetailsByCCIDAndEmpID3(string sCCID, DateTime startDate, DateTime endDate, string sEmpIDs); DataSet GetArrPrssDetailsByCstIDEmpIDLocAndDeptWise(string sCCID, DateTime startDate, DateTime endDate, string sEmpIDs); List GetDetails(int arrearProcessId, string nEmpID); List GetDetails(int arrearProcessId, int nEmpID); List GetArrearProcessDetailItemMonthlys(int ArrearProcessDetailItemID); } #endregion }