Beispiel #1
0
 private void btnPreview_Click(object sender, EventArgs e)
 {
     if (cboYearList.GetSelectedDataRow() is Years item)
     {
         /*  AOBViewModel model = new AOBViewModel();
          * model.GenerateReport(item.Year.ToInt(), new StaticSettings().OfficeId);
          * frmReportViewer frm = new frmReportViewer(new rptAccountOutstandingBalance()
          * {
          *    DataSource = new List<AOBViewModel>() { model }
          * });
          * frm.ShowDialog();*/
         var vm = new LARViewModel()
         {
             OfficeId = new StaticSettings().OfficeId,
             Year     = item.Year.ToInt(),
             FT       = Win.Properties.Settings.Default.FundType
         };
         vm.Generate();
         frmReportViewer frm = new frmReportViewer(new rptLAR()
         {
             DataSource = new List <LARViewModel>()
             {
                 vm
             }
         });
         frm.ShowDialog();
     }
 }
Beispiel #2
0
 private void btnPreview_Click(object sender, EventArgs e)
 {
     if (cboYearList.GetSelectedDataRow() is Years item)
     {
         ObligationRequestViewModel model = new ObligationRequestViewModel();
         model.GenerateReport(item.Year.ToInt(), new StaticSettings().OfficeId, Win.Properties.Settings.Default.FundType);
         frmReportViewer frm = new frmReportViewer(new rptObligationRequests()
         {
             DataSource = new List <ObligationRequestViewModel>()
             {
                 model
             }
         });
         frm.ShowDialog();
     }
 }
Beispiel #3
0
 private void btnPreview_Click(object sender, EventArgs e)
 {
     if (cboYearList.GetSelectedDataRow() is Years item)
     {
         ObligationRequestViewModel model = new ObligationRequestViewModel();
         model.GenerateReport(vm =>
         {
             var user         = new UnitOfWork().UsersRepo.Find(x => x.Id == User.UserId);
             vm.PreparedBy    = user?.FullName;
             vm.PreparedByPos = user?.Position;
         }, item.Year.ToInt(), new StaticSettings().OfficeId, Win.Properties.Settings.Default.FundType);
         frmReportViewer frm = new frmReportViewer(new rptDetailedObligationRequests()
         {
             DataSource = new List <ObligationRequestViewModel>()
             {
                 model
             }
         });
         frm.ShowDialog();
     }
 }
Beispiel #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (cboStaff.GetSelectedDataRow() is Users item)
                {
                    AccomplishmentReportViewModel model = new AccomplishmentReportViewModel()
                    {
                        UserId             = item.Id,
                        DateFrom           = dtDateFrom.DateTime,
                        DateTo             = dtDateTo.DateTime.AddHours(11).AddMinutes(59).AddSeconds(59),
                        Office             = item.Offices?.OfficeName,
                        TelNo              = item.Offices?.TelNo,
                        Address            = item.Offices?.Address,
                        NotedBy            = (cboNotedBy.GetSelectedDataRow() as Employees)?.EmployeeName,
                        NotedByPosition    = (cboNotedBy.GetSelectedDataRow() as Employees)?.Position,
                        ReviewedBy         = (cboReviewedBy.GetSelectedDataRow() as Employees)?.EmployeeName,
                        ReviewedByPosition = (cboReviewedBy.GetSelectedDataRow() as Employees)?.Position,
                        PeriodOf           = $"For the period of: {dtDateFrom.DateTime.ToShortDateString()} to {dtDateTo.DateTime.ToShortDateString()}",
                        TableName          = tableName
                    };
                    if (item.Offices?.UnderOfOffice != null)
                    {
                        model.Office = item.Offices?.UnderOfOffice.OfficeName + Environment.NewLine + model.Office;
                    }

                    rptPivotAccomplisment rpt = new rptPivotAccomplisment();


                    Generate(model, rpt);
                    rpt.lblSystemName.Text = footer;
                    frmReportViewer frm = new frmReportViewer(rpt);
                    frm.ShowDialog();
                }
            }
            catch (Exception exception)
            {
            }
        }