private void Build() { try { _ViewModel = new PayrollMasterModel(connection); _ViewModel.employeraddress = _employer.Address1.Trim() + " " + _employer.Address2.Trim(); _ViewModel.employername = _employer.Name; _ViewModel.CompanyLogo = fileLogo; _ViewModel.CompanySlogan = slogan; _ViewModel.Period = _period; _ViewModel.Year = _year; _ViewModel.PrintedOn = DateTime.Today; _ViewModel.paymaster = GetPayrollMasterList(); } catch (Exception ex) { Utils.ShowError(ex); } }
//constructor public PayrollMasterPDFBuilder(PayrollMasterModel payrollMasterModel, string FileName, string Conn) { if (payrollMasterModel == null) { throw new ArgumentNullException("PayrollMasterModel is null"); } _ViewModel = payrollMasterModel; if (string.IsNullOrEmpty(Conn)) { throw new ArgumentNullException("connection"); } connection = Conn; de = new DataEntry(connection); db = new SBPayrollDBEntities(connection); rep = new Repository(connection); sFilePDF = FileName; }
//constructor public PayrollMasterPDFBuilder2(System.Collections.Generic.List <string> earnings, System.Collections.Generic.List <string> deductions, PayrollMasterModel payrollMasterModel, string FileName, string Conn) { if (payrollMasterModel == null) { throw new ArgumentNullException("PayrollMasterModel is null"); } _ViewModel = payrollMasterModel; if (string.IsNullOrEmpty(Conn)) { throw new ArgumentNullException("connection"); } connection = Conn; de = new DataEntry(connection); db = new SBPayrollDBEntities(connection); rep = new Repository(connection); sFilePDF = FileName; _earnings = earnings; _deductions = deductions; }
public bool ShowPayrollMaster(System.Collections.Generic.List <string> earnings, System.Collections.Generic.List <string> deductions, string app, PayrollMasterModel pMaster, string sFilePDF) { bRet = false; try { if ("pdf".Equals(app.ToLower())) { //PayrollMasterPDFBuilder payPdfMaker = new PayrollMasterPDFBuilder(pMaster, sFilePDF,connection); PayrollMasterPDFBuilder2 payPdfMaker = new PayrollMasterPDFBuilder2(earnings, deductions, pMaster, sFilePDF, connection); payPdfMaker.GetPDF(); } else { //PayrollMasterExcelBuilder pe = new PayrollMasterExcelBuilder(pMaster, sFilePDF, connection); PayrollMasterExcelBuilder pe = new PayrollMasterExcelBuilder(earnings, deductions, pMaster, sFilePDF, connection); pe.GetExcel(); } return(true); } catch (Exception ex) { Utils.ShowError(ex); return(false); } }