public NSSFPDFBuilder(NSSFReportModel nssfreportmodel, string FileName, string Conn) { if (nssfreportmodel == null) { throw new ArgumentNullException("NSSFReportModel is null"); } _ViewModel = nssfreportmodel; if (string.IsNullOrEmpty(Conn)) { throw new ArgumentNullException("connection"); } connection = Conn; db = new SBPayrollDBEntities(connection); rep = new Repository(connection); sFilePDF = FileName; }
private void BuildNewNssf() { try { _ViewModel = new NSSFReportModel(connection); _ViewModel.EmployerCode = _employer.NSSF; _ViewModel.EmpAddress = _employer.Address1.Trim() + " " + _employer.Address2.Trim(); _ViewModel.CompanyLogo = fileLogo; _ViewModel.CompanySlogan = slogan; _ViewModel.EmployerName = _employer.Name; _ViewModel.Period = _period; _ViewModel.Year = _year; _ViewModel.PrintedOn = DateTime.Today; _ViewModel.PayList = this.GetNewNssfPayList(); } catch (Exception ex) { Utils.ShowError(ex); } }
public bool ShowNewNSSF(string app, NSSFReportModel nssfreportmodel, string sFilePDF) { bRet = false; try { if ("pdf".Equals(app.ToLower())) { NSSFPDFBuilder payPdfMaker = new NSSFPDFBuilder(nssfreportmodel, sFilePDF, connection); payPdfMaker.GetPDF(); return(true); } else { NSSFExcelBuilder pe = new NSSFExcelBuilder(nssfreportmodel, sFilePDF); pe.GetExcel(); return(true); } } catch (Exception ex) { Utils.ShowError(ex); return(false); } }