Example #1
0
        public PartialViewResult _GetEPScoringDetailData(SearchEPScoringParams search, Email emailInput)
        {
            ReportViewer reportViewer = new ReportViewer();

            try
            {
                if (String.IsNullOrEmpty(search.ScoreValueList))
                {
                    search.ScoreValueList = "";
                }

                var findingsService = new EPScoringService();
                if (emailInput.To != null)
                {
                    ViewBag.FromEmail        = true;
                    ViewBag.FromEmailSuccess = WebConstants.Email_Success;
                }

                reportViewer = findingsService.EPScoringDetailRDLC(search, emailInput);
                if (Session["EmailSuccess"] != null)
                {
                    if (Session["EmailSuccess"].ToString() == "false")
                    {
                        ViewBag.FromEmailSuccess = WebConstants.Email_Failed;
                    }
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.ToString() != "Email")
                {
                    if (ex.Message.ToString() == "No Data")
                    {
                        ModelState.AddModelError("Error", WebConstants.NO_DATA_FOUND_RDLC_VIEW_TSR);
                    }
                    else
                    {
                        ViewBag.DataLimit = true;
                        ModelState.AddModelError("Error", "Maximum limit of " + ConfigurationManager.AppSettings["ReportOutputLimit"].ToString() + " records reached. Refine your criteria to narrow the result.");
                    }
                }
                else
                {
                    ViewBag.FromEmail = true;
                    ModelState.AddModelError("Error", WebConstants.Email_Failed);
                }
            }
            finally
            {
                if (Session["EmailSuccess"] != null)
                {
                    Session.Remove("EmailSuccess");
                }
            }

            Session["MyReportViewer"] = reportViewer;
            return(PartialView("_ReportViewer"));
        }
Example #2
0
        public PartialViewResult _GetEPScoringSummaryData(SearchEPScoringParams search, Email emailInput)
        {
            ReportViewer reportViewer = new ReportViewer();

            try
            {
                if (String.IsNullOrEmpty(search.ScoreValueList))
                {
                    search.ScoreValueList = "";
                }

                var findingsService = new EPScoringService();
                if (emailInput.To != null)
                {
                    ViewBag.FromEmail        = true;
                    ViewBag.FromEmailSuccess = WebConstants.Email_Success;
                }

                reportViewer = findingsService.EPScoringSummaryRDLC(search, emailInput);
                if (Session["EmailSuccess"] != null)
                {
                    if (Session["EmailSuccess"].ToString() == "false")
                    {
                        ViewBag.FromEmailSuccess = WebConstants.Email_Failed;
                    }
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.ToString() != "Email")
                {
                    if (ex.Message.ToString() == "No Data")
                    {
                        ModelState.AddModelError("Error", WebConstants.NO_DATA_FOUND_RDLC_VIEW_TSR);
                    }
                }
                else
                {
                    ViewBag.FromEmail = true;
                    ModelState.AddModelError("Error", WebConstants.Email_Failed);
                }
            }
            finally
            {
                if (Session["EmailSuccess"] != null)
                {
                    Session.Remove("EmailSuccess");
                }
            }

            Session["MyReportViewer"] = reportViewer;
            return(PartialView("_ReportViewer"));
        }