예제 #1
0
        public ActionResult ExpectedArrivalDetailsReport(string branchCode, double date)
        {
            var reportDate = DateTime.FromOADate(date);

            ViewBag.Branches = m_enttContext.GetBranchInfo(branchCode).Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            var reportViewer = ReportEngine.Create();

            var dataset = m_enttContext.ExpectedArrivalBranchReportDetailsDataSet(reportDate.Date, branchCode);

            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\Versus\ExpectedArrivalDestinationOfficeDetails.rdlc";
            var parameters = new List <ReportParameter>
            {
                new ReportParameter("reportDate", reportDate.ToShortDateString()),
                new ReportParameter("branchCode", branchCode)
            };

            reportViewer.LocalReport.EnableHyperlinks = true;
            reportViewer.LocalReport.SetParameters(parameters);
            reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dataset.Tables[0]));
            ViewBag.TotalRows    = dataset.Tables[0].Rows.Count;
            ViewBag.ReportViewer = reportViewer;
            var model = new StandardReportViewModel {
                ReportDate = reportDate, SelectedBranch = branchCode
            };

            return(View(model));
        }
예제 #2
0
        public ActionResult ItemOverDeclared(StandardReportViewModel model)
        {
            var reportViewer = new ReportViewer()
            {
                KeepSessionAlive    = false,
                ProcessingMode      = ProcessingMode.Local,
                SizeToReportContent = true,
                Width  = Unit.Percentage(100),
                Height = Unit.Percentage(100)
            };

            if (ModelState.IsValid)
            {
                DataSet dataset;
                dataset = model.SelectedBranch == "All" ?
                          m_enttContext.GetIpcItemOverDeclaredDataSet(model.ReportDate) :
                          m_enttContext.GetIpcItemOverDeclaredBranchDataSet(model.ReportDate, model.SelectedBranch);
                reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\Versus\IpcItemOverDeclared.rdlc";

                var parameters = new List <ReportParameter>
                {
                    new ReportParameter("reportDate", model.ReportDate.ToShortDateString())
                };

                reportViewer.LocalReport.EnableHyperlinks = true;
                reportViewer.LocalReport.SetParameters(parameters);
                reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dataset.Tables[0]));
            }

            ViewBag.ReportViewer = reportViewer;
            ViewBag.Branches     = GetUserViewBranches().Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            return(View(model));
        }
예제 #3
0
        public ActionResult ExpectedArrivalReport(StandardReportViewModel model)
        {
            var reportViewer = ReportEngine.Create();

            if (ModelState.IsValid)
            {
                DataSet dataset;
                dataset = model.SelectedBranch == "All" ?
                          m_enttContext.ExpectedArrivalReportDataSet(model.ReportDate) :
                          m_enttContext.ExpectedArrivalBranchReportDataSet(model.ReportDate, model.SelectedBranch);
                reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\Versus\ExpectedArrivalDestinationOffice.rdlc";

                var parameters = new List <ReportParameter>
                {
                    new ReportParameter("reportDate", model.ReportDate.ToShortDateString())
                };
                reportViewer.LocalReport.EnableHyperlinks = true;
                reportViewer.LocalReport.SetParameters(parameters);
                reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dataset.Tables[0]));
            }

            ViewBag.ReportViewer = reportViewer;
            ViewBag.Branches     = GetUserViewBranches().Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            return(View(model));
        }
예제 #4
0
        public ActionResult ExpectedArrivalReport()
        {
            var reportViewer = ReportEngine.Create();

            ViewBag.ReportViewer = reportViewer;
            ViewBag.Branches     = GetUserViewBranches().Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            var model = new StandardReportViewModel {
                ReportDate = DateTime.Today
            };

            return(View(model));
        }
예제 #5
0
        public ActionResult ItemUnderDeclared()
        {
            var reportViewer = ReportEngine.Create();

            ViewBag.Branches = GetUserViewBranches().Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            ViewBag.ReportViewer = reportViewer;
            ViewBag.ReportDays   = ApplicationHelper.GetReportDays().Select(w => new SelectListItem {
                Text = w.Value, Value = w.Key.ToString()
            });
            var model = new StandardReportViewModel {
                ReportDate = DateTime.Today
            };

            return(View(model));
        }
        public ActionResult SopVsNoHipDetails(string branchCode, double date, string day = "7")
        {
            var user = m_dbContext.Users.Single(u => u.UserName == User.Identity.Name);

            if (null != user && !string.IsNullOrEmpty(user.BranchCode) && user.BranchCode != branchCode)
            {
                return(new HttpStatusCodeResult(403, "You are not allow to view the data"));
            }

            var reportDate = DateTime.FromOADate(date);

            ViewBag.Branches = m_enttContext.GetBranchInfo(branchCode).Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            ViewBag.ReportDays = ApplicationHelper.GetReportDays().Select(w => new SelectListItem {
                Text = w.Value, Value = w.Key.ToString()
            });
            var reportViewer = ReportEngine.Create();

            var dataset = m_enttContext.GetSopVsNoHipDetailsReportDataSet(reportDate.Date, int.Parse(day), branchCode);

            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\Versus\SopVsNoHipDetails.rdlc";
            var parameters = new List <ReportParameter>
            {
                new ReportParameter("reportDate", reportDate.ToShortDateString()),
                new ReportParameter("day", day),
                new ReportParameter("branchCode", branchCode)
            };

            reportViewer.LocalReport.EnableHyperlinks = true;
            reportViewer.LocalReport.SetParameters(parameters);
            reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dataset.Tables[0]));
            ViewBag.TotalRows    = dataset.Tables[0].Rows.Count;
            ViewBag.ReportViewer = reportViewer;
            var model = new StandardReportViewModel {
                ReportDate = reportDate, SelectedBranch = branchCode
            };

            return(View(model));
        }
예제 #7
0
        public ActionResult AcceptanceDetails(string branchCode, double date)
        {
            var user = m_dbContext.Users.Single(u => u.UserName == User.Identity.Name);

            if (null != user && !string.IsNullOrEmpty(user.BranchCode) && user.BranchCode != branchCode)
            {
                if (!User.IsInRole("VersusHQ"))
                {
                    return(new HttpStatusCodeResult(403, "You are not allow to view the data"));
                }
            }

            var reportDate = DateTime.FromOADate(date);

            ViewBag.Branches = m_enttContext.GetBranchInfo(branchCode).Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            var reportViewer = ReportEngine.Create();

            var dataset = m_enttContext.AcceptanceBranchDetailsReportDataSet(reportDate.Date, branchCode);

            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\Entt\AcceptanceDetails.rdlc";
            var parameters = new List <ReportParameter>
            {
                new ReportParameter("reportDate", reportDate.ToShortDateString()),
                new ReportParameter("branchCode", branchCode)
            };

            reportViewer.LocalReport.SetParameters(parameters);
            reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dataset.Tables[0]));
            ViewBag.ReportViewer = reportViewer;
            var model = new StandardReportViewModel {
                ReportDate = reportDate, SelectedBranch = branchCode
            };

            return(View(model));
        }
예제 #8
0
 public ActionResult NearMe(StandardReportViewModel model)
 {
     return(View());
 }