コード例 #1
0
        public ActionResult LoadTracerComplianceDepartmentGraph(Search search)
        {
            var tcService = new TracerDepartmentDashboard();

            try
            {
                var departments = new List <string>();
                if (search.OrgTypeLevel1IDs == "-1")
                {
                    departments = Array.ConvertAll(search.DepartmentNames.Split('€'), p => p.Trim()).ToList();
                    departments.RemoveAt(0);
                }
                else
                {
                    departments = Array.ConvertAll(search.OrgTypeLevel1SpecialCaseNames.Split('€'), p => p.Trim()).ToList();
                }
                if (departments.Count() > 100)
                {
                    ExceedLimt  = "TRUE";
                    departments = departments.Select(i => i).OrderBy(x => tcService.PadNumbers(x)).Distinct().Take(100).ToList();
                }
                if (departments.Count() == 0)
                {
                    throw new Exception("No Data");
                }
                else
                {
                    ViewBag.Header         = departments;
                    TempData["ExceedLimt"] = ExceedLimt;
                    return(PartialView("TracerComplianceDepartmentGraph"));
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.ToString() == "No Data")
                {
                    ModelState.AddModelError("Error", WebConstants.NO_DATA_FOUND_EXCEL_VIEW.ToString());
                }
                else
                {
                    ExceptionLog exceptionLog = new ExceptionLog
                    {
                        ExceptionText = "Reports: " + ex.Message,
                        PageName      = "_TracerComplianceDepartmentGraph",
                        MethodName    = "LoadTracerComplianceDepartmentGraph",
                        UserID        = Convert.ToInt32(AppSession.UserID),
                        SiteId        = Convert.ToInt32(AppSession.SelectedSiteId),
                        TransSQL      = "",
                        HttpReferrer  = null
                    };
                    exceptionService.LogException(exceptionLog);
                }
                return(RedirectToAction("Error", "Transfer"));
            }
        }
コード例 #2
0
        public ActionResult _TracerComplianceDepartmentExcel([DataSourceRequest] DataSourceRequest request, Search search)
        {
            var dcaService = new TracerDepartmentDashboard();

            DataSourceResult result = dcaService._tracerComplianceDepartmentExcel(request, search);
            JsonResult       jr     = new JsonResult();

            jr = Json(result, JsonRequestBehavior.AllowGet);
            jr.MaxJsonLength  = Int32.MaxValue;
            jr.RecursionLimit = 100;
            return(jr);
        }
コード例 #3
0
        public ActionResult LoadTracerComplianceDepartmentGrid([DataSourceRequest] DataSourceRequest request, Search search)
        {
            var tcService = new TracerDepartmentDashboard();

            DataSourceResult result = tcService.DynamicGroupByTracerDepartmentColumns(request, search);

            if (result.Errors != null && result.Errors.ToString() != "")
            {
                ModelState.AddModelError("Error", result.Errors.ToString());
            }

            var val = Json(result, JsonRequestBehavior.AllowGet);

            val.MaxJsonLength  = int.MaxValue;
            val.RecursionLimit = 100;
            return(val);
        }