예제 #1
0
        public MasterReportBound GetDistributionReport()
        {
            var reports      = new List <BLL.ViewModels.Report.Data.DistributionReport>();
            var distribution = new BLL.ViewModels.Report.Data.DistributionReport();

            BLL.UserProfile user = _userProfileService.GetUser(User.Identity.Name);

            distribution.PreparedBy  = user.GetFullName();
            distribution.ReportCode  = DateTime.Now.ToString();
            distribution.ReportDate  = DateTime.Now;
            distribution.ReportName  = "DistributionReport";
            distribution.ReportTitle = "Distribution Report";
            Random ran = new Random(1);

            distribution.Rows = new List <DistributionRows>();
            for (int i = 1; i < 2; i++)
            {
                DistributionRows r = new DistributionRows();
                r.BudgetYear        = DateTime.Now.Year;
                r.Region            = (i % 2 == 0) ? "Amhara" : "Benshangul";
                r.Program           = "Program " + i.ToString();
                r.DistributedAmount = i * decimal.Parse("2340.43674") * 45;
                int month = ran.Next(4);
                r.Quarter = 1;
                distribution.Rows.Add(r);
            }

            reports.Add(distribution);

            DRMFSS.Web.Reports.DistributionReport rpt = new Web.Reports.DistributionReport()
            {
                DataSource = reports[0].Rows
            };
            MasterReportBound report = new MasterReportBound()
            {
                Name = "Distribution Report - " + DateTime.Now.ToShortDateString(), DataSource = reports
            };

            report.rptSubReport.ReportSource = rpt;
            return(report);
        }
예제 #2
0
        public MasterReportBound GetDistributionReport()
        {
            var reports = new List<Cats.Models.Hub.ViewModels.Report.Data.DistributionReport>();
            var distribution = new Cats.Models.Hub.ViewModels.Report.Data.DistributionReport();
            UserProfile user = _userProfileService.GetUser(User.Identity.Name);

            distribution.PreparedBy = user.GetFullName();
            distribution.ReportCode = DateTime.Now.ToString();
            distribution.ReportDate = DateTime.Now;
            distribution.ReportName = "DistributionReport";
            distribution.ReportTitle = "Distribution Report";
            Random ran = new Random(1);
            distribution.Rows = new List<DistributionRows>();
            for (int i = 1; i < 2; i++)
            {
                DistributionRows r = new DistributionRows();
                r.BudgetYear = DateTime.Now.Year;
                r.Region = (i % 2 == 0) ? "Amhara" : "Benshangul";
                r.Program = "Program " + i.ToString();
                r.DistributedAmount = i * decimal.Parse("2340.43674") * 45;
                int month = ran.Next(4);
                r.Quarter = 1;
                distribution.Rows.Add(r);
            }

            reports.Add(distribution);

            Cats.Web.Hub.Reports.DistributionReport rpt = new Cats.Web.Hub.Reports.DistributionReport() { DataSource = reports[0].Rows };
            MasterReportBound report = new MasterReportBound() { Name = "Distribution Report - " + DateTime.Now.ToShortDateString(), DataSource = reports };
            report.rptSubReport.ReportSource = rpt;
            return report;
        }