Exemplo n.º 1
0
 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;
        }
Exemplo n.º 3
0
 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;
 }