public bool ShowSaccoPaymentShedule(string app, SaccoPaymentScheduleModel saccopaymentshedulemodel, string sFilePDF) { bRet = false; if ("pdf".Equals(app)) { try { SaccoPaymentSchedulePDFBuilder lrspdfbuilder = new SaccoPaymentSchedulePDFBuilder(saccopaymentshedulemodel, sFilePDF); lrspdfbuilder.GetshedulePDF(); return(true); } catch (Exception ex) { Utils.ShowError(ex); return(false); } } else //application is excel { try { SaccoPaymentScheduleExcelBuilder lrsebuilder = new SaccoPaymentScheduleExcelBuilder(saccopaymentshedulemodel, sFilePDF); lrsebuilder.GetExcel(); return(true); } catch (Exception ex) { Utils.ShowError(ex); return(false); } } }
public SaccoPaymentSchedulePDFBuilder(SaccoPaymentScheduleModel SaccoPaymentScheduleModel, string FileName) { if (SaccoPaymentScheduleModel == null) { throw new ArgumentNullException("SaccoPaymentScheduleModel is null"); } _ViewModel = SaccoPaymentScheduleModel; sFilePDF = FileName; }
private void Build() { try { _ViewModel = new SaccoPaymentScheduleModel(); _ViewModel.PeriodDate = new DateTime(_year, _period, 1); _ViewModel.employername = _employer.Name; _ViewModel.employeraddress = _employer.Address1.Trim() + ", " + _employer.Address2.Trim(); _ViewModel.CompanyLogo = fileLogo; _ViewModel.CompanySlogan = slogan; _ViewModel.employertelephone = _employer.Telephone; _ViewModel.PrintedOn = DateTime.Today; _ViewModel.saccorepaymentschedule = this.GetSaccoRePayments(); } catch (Exception ex) { Utils.ShowError(ex); } }
//constructor public SaccoPaymentScheduleExcelBuilder(SaccoPaymentScheduleModel saccopaymentshedulemodel, string FileName) { _saccopaymentshedulemodel = saccopaymentshedulemodel; sFileExcel = FileName; }