Ejemplo n.º 1
0
        /// <summary>
        /// Get tracers list based on selected site id or tracer category change
        /// </summary>
        /// <returns>PartialView</returns>
        public ActionResult GetTracerSectionsList(int selectedsiteid, string selectedsitename, string tracerCustomIDs, int tracerTypeID = 1)
        {
            CheckSession(selectedsiteid, selectedsitename);
            SearchInputService reportservice = new SearchInputService();

            return(PartialView("Search/_TracerSectionsList", reportservice.GetTracerSectionsList(tracerCustomIDs, "1,2,3", "7,8", tracerTypeID)));
        }
Ejemplo n.º 2
0
        public ActionResult GetPrograms(int selectedsiteid, string selectedsitename, bool allPrograms = true, bool redirectToHome = false)
        {
            // M.Orlando: When user is on Tracers Report page (http://localhost:49179/Tracer/Home/Index),
            // this is where code POSTS back to the server when the user selects a different site.

            var menuService = new JCR.Reports.Services.MenuService();

            menuService.SaveArg(AppSession.UserID.GetValueOrDefault(), "SiteID", selectedsiteid.ToString());
            //menuService.SaveArg(AppSession.UserID.GetValueOrDefault(), "SiteName", selectedsitename.ToString());
            //menuService.RefreshUserMenuState(AppSession.UserID.GetValueOrDefault());

            if (redirectToHome)
            {
                return(new EmptyResult());
            }


            CheckSession(selectedsiteid, selectedsitename);
            SearchInputService reportService = new SearchInputService();
            var programsList = reportService.GetPrograms();

            if (!allPrograms)
            {
                programsList = programsList.Where(item => item.ProgramID == 2 || item.ProgramID == 69).ToList();
            }

            //Set the default program when the site is changed
            reportService.SetProgramPreference(programsList);


            return(PartialView("Search/_Programs", programsList));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get tracers chapters based on selected program
        /// </summary>
        /// <returns>PartialView</returns>
        public ActionResult GetTracersChapters(int selectedsiteid, string selectedsitename)
        {
            CheckSession(selectedsiteid, selectedsitename);
            SearchInputService reportservice = new SearchInputService();

            return(PartialView("Search/_ChaptersList", reportservice.GetTracersChapters()));
        }
 public async Task <JsonResult> SIGetOwner(string id, string aid)
 {
     try {
         var data = SearchInputService.GetByOIDAPI(Guid.Parse(id), Guid.Parse(aid));
         return(Success(SearchInputsDataVM.MsToVMs(data)));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Get tracers list based on selected site id or tracer category change
        /// </summary>
        /// <returns>PartialView</returns>
        public ActionResult GetTracersList(string TracerCategoryIDs, string TracerFrequencyIDs)
        {
            SearchInputService reportservice = new SearchInputService();

            return(PartialView("Search/_TracersList", reportservice.GetAllTracerScheduleFrequencyList(TracerFrequencyIDs,
                                                                                                      TracerCategoryIDs)));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Get frequency list based on category id
        /// </summary>
        /// <returns>PartialView</returns>
        public ActionResult GetTracersDepartmentFrequency(string TracerCategoryIDs)
        {
            //SearchList search = new SearchList();
            SearchInputService reportservice = new SearchInputService();

            return(PartialView("Search/_TracerFrequency", reportservice.GetTracerFreqencyLists(TracerCategoryIDs)));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Get tracers EP based on selected standard
        /// </summary>
        /// <returns>PartialView</returns>
        public ActionResult GetTracersEPs(int selectedsiteid, string selectedsitename, string chapterid, string standardtextid)
        {
            CheckSession(selectedsiteid, selectedsitename);
            SearchInputService reportservice = new SearchInputService();

            return(PartialView("Search/_EPsList", reportservice.GetTracersEPs(chapterid, standardtextid)));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Get tracers categories based on selected site id
        /// </summary>
        /// <returns>PartialView</returns>
        public ActionResult GetTracersCategories(int selectedsiteid, string selectedsitename, int tracerTypeID = 1)
        {
            CheckSession(selectedsiteid, selectedsitename);
            SearchInputService reportservice = new SearchInputService();

            return(PartialView("Search/_TracersCategory", reportservice.GetTracersCategories(tracerTypeID)));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Get Orgnization Type List level1 based on selected site id
        /// </summary>
        /// <returns>PartialView</returns>
        public ActionResult GetOrganizationTypelevel1(Search search, int selectedSiteIDs = -1, int selectedProgramIDs = -1)
        {
            SearchInputService reportservice = new SearchInputService();
            SearchList         tracerslist   = new SearchList();

            tracerslist = reportservice.DistributeOrgTypeListLevel1(tracerslist, search, selectedSiteIDs, selectedProgramIDs);
            return(PartialView("Search/_DepartmentList", tracerslist));
        }
Ejemplo n.º 10
0
        public SearchList GetOrgnizationTypeList(SearchList searchlist, Search search, int selectedSiteID, int selectedProgramID)
        {
            SearchInputService searchService = new SearchInputService();

            searchlist = searchService.GetOrgnizationTypeList(searchlist, search, selectedSiteID, selectedProgramID);

            return(searchlist);
        }
Ejemplo n.º 11
0
        public ActionResult Index(int id, int?actionType)
        {
            try
            {
                if (!AppSession.HasValidSession)
                {
                    SessionExpired();
                }

                HelperClasses.SetReportOrScheduleID(id, (int)ReportsListEnum.TracerByCMS);

                SearchInputService reportservice = new SearchInputService();
                var list = reportservice.GetSearchLists(WebConstants.TRACER_REPORT_TITLE_TRACE_BY_CMS_REPORT);
                list.TracersChapters = reportservice.GetTracersChapters().TracersChapters;
                ViewBag.allSites     = false;
                if (AppSession.ReportScheduleID > 0)
                {
                    //Load the saved parameters
                    var oSaveAndScheduleService = new SaveAndScheduleService();
                    var savedParameters         = oSaveAndScheduleService.LoadUserSchedule(AppSession.ReportScheduleID);
                    TempData["SavedParameters"] = savedParameters; //This tempdata will be used by the Ajax call to avoid loading the saved parameters again from DB
                    TempData["ActionType"]      = actionType;

                    //Show/Hide Save to my reports button
                    ViewBag.HideSaveReport = HelperClasses.HideSaveToMyReports(AppSession.RoleID, savedParameters.UserID, AppSession.UserID, actionType);

                    int?chapterID = null;
                    if (savedParameters.ReportParameters.Find(param => param.ReportParameterName == WebConstants.TRACERS_CHAPTER) != null)
                    {
                        chapterID = Convert.ToInt32(savedParameters.ReportParameters.Find(param => param.ReportParameterName == WebConstants.TRACERS_CHAPTER).ParameterValue);
                    }

                    list.CMSTags = reportservice.GetTracersCMS(chapterID == -1 ? null : chapterID).CMSTags;
                }
                else
                {
                    list.CMSTags = reportservice.GetTracersCMS(null).CMSTags;
                }

                return(View(list));
            }
            catch (Exception ex)
            {
                ExceptionLog exceptionLog = new ExceptionLog
                {
                    ExceptionText = "Reports: " + ex.Message,
                    PageName      = "TracerByCMS",
                    MethodName    = "Index",
                    UserID        = Convert.ToInt32(AppSession.UserID),
                    SiteId        = Convert.ToInt32(AppSession.SelectedSiteId),
                    TransSQL      = "",
                    HttpReferrer  = null
                };
                exceptionService.LogException(exceptionLog);

                return(RedirectToAction("Error", "Transfer"));
            }
        }
Ejemplo n.º 12
0
        public ActionResult ERLevelSites()
        {
            string selectedSiteIds = "";
            var    reportService   = new SearchInputService();

            var sites    = AppSession.Sites.Where(m => m.IsTracersAccess == 1).ToList();
            var levelMap = reportService.GetLevelMap(sites);

            AppSession.SessionERLevelInformation = reportService.GetLevelInformation(AppSession.SelectedSiteId);
            levelMap = levelMap.OrderByDescending(l => l.ERLevel1.ERLevel1ID)
                       .ThenBy(l => l.ERLevel2.ERLevel2Name)
                       .ThenBy(l => l.ERLevel3.ERLevel3Name)
                       .ToList();

            bool hasLevel1 = levelMap.Where(l => l.ERLevel1ID > 0).Count() > 0 ? true : false;
            bool hasLevel2 = levelMap.Where(l => l.ERLevel2ID > 0).Count() > 0 ? true : false;
            bool hasLevel3 = levelMap.Where(l => l.ERLevel3ID > 0).Count() > 0 ? true : false;

            // if there are no level 1 names (or (None)), set to false
            if (hasLevel1)
            {
                if (levelMap.Where(l => !String.IsNullOrEmpty(l.ERLevel1.ERLevel1Name)).Count() == 0)
                {
                    hasLevel1 = false;
                }
            }

            //Get the selected sites for the saved report
            if (AppSession.ReportScheduleID > 0 && TempData["SavedParameters"] != null)
            {
                var oScheduleDate = new SaveAndSchedule();
                oScheduleDate   = (SaveAndSchedule)TempData["SavedParameters"];
                selectedSiteIds = string.Join(",", oScheduleDate.ReportSiteMaps.Select(siteMaps => siteMaps.SiteID).ToList());
            }

            var siteSelectorViewModel = new SiteSelectorViewModel
            {
                ERLevelMap      = levelMap,
                HasLevel1       = hasLevel1,
                HasLevel2       = hasLevel2,
                HasLevel3       = hasLevel3,
                SelectedSiteIds = selectedSiteIds
            };

            //var dataContext = new SampleEntities();

            //var employees = from e in dataContext.Employees
            //                where (id.HasValue ? e.ReportsTo == id : e.ReportsTo == null)
            //                select new
            //                {
            //                    id = e.EmployeeID,
            //                    Name = e.FirstName + " " + e.LastName,
            //                    hasChildren = e.Employees1.Any()
            //                };
            return(PartialView("Search/_SitesTree", siteSelectorViewModel));
            // return Json(siteSelectorViewModel, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 13
0
        public ActionResult GetTracersOrgEnteredBy(int selectedsiteid, string selectedsitename, Search search)
        {
            CheckSession(selectedsiteid, selectedsitename);
            SearchInputService reportservice = new SearchInputService();
            SearchList         searchlist    = new SearchList();

            searchlist = reportservice.DistributeTracerOrgEnteredBy(searchlist, search);
            return(PartialView("Search/_TracerObservationEnteredBy", searchlist));
        }
Ejemplo n.º 14
0
        public ActionResult GetTaskAssignedTo(int selectedsiteid, string selectedsitename)
        {
            CheckSession(selectedsiteid, selectedsitename);

            SearchInputService reportservice = new SearchInputService();
            SearchList         searchlist    = new SearchList();

            //  searchlist = reportservice.GetTaskAssignedTo(searchlist);
            return(PartialView("Search/_UserAssignedTo", reportservice.GetTaskAssignedTo(searchlist)));
        }
Ejemplo n.º 15
0
        public ActionResult GetTracersCMS(int selectedsiteid, string selectedsitename, int?chapterid)
        {
            CheckSession(selectedsiteid, selectedsitename);
            SearchInputService reportservice = new SearchInputService();

            if (chapterid == -1)
            {
                chapterid = null;
            }
            return(PartialView("Search/_CMSTagsList", reportservice.GetTracersCMS(chapterid)));
        }
 public async Task <JsonResult> SIRemove()
 {
     try {
         var id  = Guid.Parse(Request.Form["id"]);
         var oid = Guid.Parse(Request.Form["oid"]);
         var aid = Guid.Parse(Request.Form["aid"]);
         if (SearchInputService.Remove(id, oid, aid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedRemove("Input")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Ejemplo n.º 17
0
        /// <summary>
        /// Get tracers list based on selected site id or tracer category change
        /// </summary>
        /// <returns>PartialView</returns>
        public ActionResult GetTracersList(int selectedsiteid, string selectedsitename, string TracerStatus)
        {
            CheckSession(selectedsiteid, selectedsitename);
            SearchInputService reportservice = new SearchInputService();

            if (AppSession.RoleID == (int)Role.GlobalAdmin)
            {
                return(PartialView("Search/_TemplatesList", reportservice.GetAllTracersList(TracerStatus)));
            }
            else
            {
                return(PartialView("Search/_TracersList", reportservice.GetAllTracersList(TracerStatus)));
            }
        }
 public async Task <JsonResult> SIUpdate()
 {
     try {
         var id     = Guid.Parse(Request.Form["id"]);
         var sinput = Request.Form["input"];
         var oid    = Guid.Parse(Request.Form["oid"]);
         var dtid   = Guid.Parse(Request.Form["dtid"]);
         var api    = Guid.Parse(Request.Form["aid"]);
         if (SearchInputService.Update(id, sinput, oid, dtid, api))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("Input")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Ejemplo n.º 19
0
        /// <summary>
        /// Get tracers list based on selected site id or tracer category change
        /// </summary>
        /// <returns>PartialView</returns>
        public ActionResult GetTracersListForComplianceSumary(int selectedsiteid, string selectedsitename, string tracerCategoryIDs)
        {
            CheckSession(selectedsiteid, selectedsitename);
            SearchInputService reportservice = new SearchInputService();
            SearchList         oSearchList   = reportservice.GetTracersList(tracerCategoryIDs);

            var qryTracers = oSearchList.TracersLists.Where(item => item.TracerCustomID != -1);

            oSearchList.TracersLists = qryTracers;

            //if (qryTracers.Count() > 5)
            //    oSearchList.TracersLists = qryTracers;

            return(PartialView("Search/_TracersListForComplianceSummary", oSearchList));
        }
Ejemplo n.º 20
0
        public ActionResult Index(int id, int?actionType)
        {
            try
            {
                HelperClasses.SetReportOrScheduleID(id, (int)ReportsListEnum.TracerComplianceSummary);

                SearchInputService reportservice = new SearchInputService();
                SearchList         oSearchList   = new SearchList();
                if (AppSession.ReportScheduleID > 0)
                {
                    //Load the saved parameters
                    var oSaveAndScheduleService = new SaveAndScheduleService();
                    var savedParameters         = oSaveAndScheduleService.LoadUserSchedule(AppSession.ReportScheduleID);
                    TempData["SavedParameters"] = savedParameters; //This tempdata will be used by the Ajax call to avoid loading the saved parameters again from DB
                    TempData["ActionType"]      = actionType;

                    //Show/Hide Save to my reports button
                    ViewBag.HideSaveReport = HelperClasses.HideSaveToMyReports(AppSession.RoleID, savedParameters.UserID, AppSession.UserID, actionType);

                    oSearchList = reportservice.GetSearchListsForSavedParameters(AppSession.ReportScheduleID, savedParameters, WebConstants.TRACER_REPORT_TITLE_TRACER_COMPLIANCE_SUMMARY_REPORT);
                }
                else
                {
                    oSearchList = reportservice.GetSearchLists(WebConstants.TRACER_REPORT_TITLE_TRACER_COMPLIANCE_SUMMARY_REPORT);
                }

                var qryTracers = oSearchList.TracersLists.Where(item => item.TracerCustomID != -1);
                oSearchList.TracersLists = qryTracers;

                return(View(oSearchList));
            }
            catch (Exception ex)
            {
                ExceptionLog exceptionLog = new ExceptionLog
                {
                    ExceptionText = "Reports: " + ex.Message,
                    PageName      = "TracerCompliance",
                    MethodName    = "Index",
                    UserID        = Convert.ToInt32(AppSession.UserID),
                    SiteId        = Convert.ToInt32(AppSession.SelectedSiteId),
                    TransSQL      = "",
                    HttpReferrer  = null
                };
                exceptionService.LogException(exceptionLog);

                return(RedirectToAction("Error", "Transfer"));
            }
        }
        // GET: Corporate/EPScoringReportFinalMockSurvey
        public ActionResult Index(int id, int?actionType)
        {
            try
            {
                HelperClasses.SetReportOrScheduleID(id, (int)ReportsListEnum.EPScoringReportFinalMockSurvey);
                string reportTitle = WebConstants.AMP_EP_SCORING_REPORT_FINAL;

                if (AppSession.IsCorporateSite == true)
                {
                    reportTitle = WebConstants.AMP_EP_SCORING_REPORT_FINAL_AND_MOCK_SURVEY;
                }

                SearchInputService reportservice = new SearchInputService();
                if (AppSession.ReportScheduleID > 0)
                {
                    //Load the saved parameters
                    var oSaveAndScheduleService = new SaveAndScheduleService();
                    var savedParameters         = oSaveAndScheduleService.LoadUserSchedule(AppSession.ReportScheduleID);
                    TempData["SavedParameters"] = savedParameters; //This tempdata will be used by the Ajax call to avoid loading the saved parameters again from DB
                    TempData["ActionType"]      = actionType;

                    //Show/Hide Save to my reports button
                    ViewBag.HideSaveReport = HelperClasses.HideSaveToMyReports(AppSession.RoleID, savedParameters.UserID, AppSession.UserID, actionType);

                    return(View(reportservice.GetCorpSearchListsForSavedParameters(AppSession.ReportScheduleID, savedParameters, reportTitle)));
                }
                else
                {
                    return(View(reportservice.GetCorpSearchLists(reportTitle)));
                }
            }
            catch (Exception ex)
            {
                ExceptionLog exceptionLog = new ExceptionLog
                {
                    ExceptionText = "Reports: " + ex.Message,
                    PageName      = "EPScoringReportFinalMockSurvey",
                    MethodName    = "Index",
                    UserID        = Convert.ToInt32(AppSession.UserID),
                    SiteId        = Convert.ToInt32(AppSession.SelectedSiteId),
                    TransSQL      = "",
                    HttpReferrer  = null
                };
                exceptionService.LogException(exceptionLog);

                return(RedirectToAction("Error", "Transfer"));
            }
        }
        public ActionResult Questions_Details(int TracerCustomID, int QuestionID, int tracerTypeID = 1)
        {
            SearchInputService reportservice = new SearchInputService();

            List <TracerQuestionDetail> tracerquestiondetaillist = new List <TracerQuestionDetail>();

            tracerquestiondetaillist = reportservice.GetQuestionDetails(TracerCustomID, QuestionID, tracerTypeID).TracerQuestionDetailList.ToList();


            JsonResult jr = new JsonResult();

            jr = Json(tracerquestiondetaillist, JsonRequestBehavior.AllowGet);
            jr.MaxJsonLength  = Int32.MaxValue;
            jr.RecursionLimit = 100;
            return(jr);
        }
        public ActionResult Questions_Read(string TracerCustomID, string TracerQuestionCategoryID, string SearchKeyword, int SiteID, int ProgramID, int tracerTypeID)
        {
            SearchInputService reportservice = new SearchInputService();

            List <TracerQuestion> tracerquestionlist = new List <TracerQuestion>();

            tracerquestionlist = reportservice.GetSearchQuestions(TracerCustomID, TracerQuestionCategoryID, SearchKeyword, SiteID, ProgramID, tracerTypeID).TracerQuestionList.ToList();


            JsonResult jr = new JsonResult();

            jr = Json(tracerquestionlist, JsonRequestBehavior.AllowGet);
            jr.MaxJsonLength  = Int32.MaxValue;
            jr.RecursionLimit = 100;
            return(jr);
        }
Ejemplo n.º 24
0
        // GET: Tracer/TracerDepartmentAssignment
        public ActionResult Index(int id, int?actionType)
        {
            try
            {
                HelperClasses.SetReportOrScheduleID(id, (int)ReportsListEnum.TracerDepartmentAssignment);

                // NEVER SET THIS VARIABLE TO FALSE. The value is set based on licensing for selected site and program. - Mark Orlando.
                // AppSession.IsCMSProgram = false;

                ViewBag.ScheduledTracerReport = true;
                SearchInputService reportservice = new SearchInputService();
                if (AppSession.ReportScheduleID > 0)
                {
                    //Load the saved parameters
                    var oSaveAndScheduleService = new SaveAndScheduleService();
                    var savedParameters         = oSaveAndScheduleService.LoadUserSchedule(AppSession.ReportScheduleID);
                    TempData["SavedParameters"] = savedParameters; //This tempdata will be used by the Ajax call to avoid loading the saved parameters again from DB
                    TempData["ActionType"]      = actionType;

                    //Show/Hide Save to my reports button
                    ViewBag.HideSaveReport = HelperClasses.HideSaveToMyReports(AppSession.RoleID, savedParameters.UserID, AppSession.UserID, actionType);

                    return(View(reportservice.GetSavedParameters_DepartmentAssignment(AppSession.ReportScheduleID, savedParameters, WebConstants.TRACER_REPORT_TITLE_TRACERDEPARTMENT_ASSIGNMENT_REPORT)));
                }
                else
                {
                    return(View(reportservice.GetSearchLists_DepartmentAssignment(WebConstants.TRACER_REPORT_TITLE_TRACERDEPARTMENT_ASSIGNMENT_REPORT)));
                }
            }
            catch (Exception ex)
            {
                ExceptionLog exceptionLog = new ExceptionLog
                {
                    ExceptionText = "Reports: " + ex.Message,
                    PageName      = "_TracerDepartmentAssignment",
                    MethodName    = "Index",
                    UserID        = Convert.ToInt32(AppSession.UserID),
                    SiteId        = Convert.ToInt32(AppSession.SelectedSiteId),
                    TransSQL      = "",
                    HttpReferrer  = null
                };
                exceptionService.LogException(exceptionLog);

                return(RedirectToAction("Error", "Transfer"));
            }
        }
Ejemplo n.º 25
0
        // GET: TracerER/ERTracerDashboard
        public ActionResult Index(int id, int?actionType)
        {
            try
            {
                if (!AppSession.HasValidSession)
                {
                    return(RedirectToAction("IndexER", "Transfer", new { area = "" }));
                }

                HelperClasses.SetReportOrScheduleID(id, (int)ReportsListEnum.ERTracerDashboard);

                SearchInputService reportservice = new SearchInputService();
                if (AppSession.ReportScheduleID > 0)
                {
                    //Load the saved parameters
                    var oSaveAndScheduleService = new SaveAndScheduleService();
                    var savedParameters         = oSaveAndScheduleService.LoadUserSchedule(AppSession.ReportScheduleID);
                    TempData["SavedParameters"] = savedParameters; //This tempdata will be used by the Ajax call to avoid loading the saved parameters again from DB
                    TempData["ActionType"]      = actionType;

                    //Show/Hide Save to my reports button
                    ViewBag.HideSaveReport = HelperClasses.HideSaveToMyReports(AppSession.RoleID, savedParameters.UserID, AppSession.UserID, actionType);
                }

                ERSearchList list = new ERSearchList();
                list = reportservice.GetERComplianceByTracer(WebConstants.ERTRACER_REPORT_TITLE_Tracer_Dashboard_Report);

                return(View(list));
            }
            catch (Exception ex)
            {
                ExceptionLog exceptionLog = new ExceptionLog
                {
                    ExceptionText = "ER Reports: " + ex.Message,
                    PageName      = "ERTracerDashboard",
                    MethodName    = "Index",
                    UserID        = Convert.ToInt32(AppSession.UserID),
                    SiteId        = Convert.ToInt32(AppSession.SelectedSiteId),
                    TransSQL      = "",
                    HttpReferrer  = null
                };
                exceptionService.LogException(exceptionLog);

                return(RedirectToAction("Error", "Transfer"));
            }
        }
Ejemplo n.º 26
0
        // GET: Corporate/PriorityTjcRFI
        public ActionResult Index(int id, int?actionType)
        {
            try
            {
                HelperClasses.SetReportOrScheduleID(id, (int)ReportsListEnum.RFIFindingReport);


                SearchInputService reportservice = new SearchInputService();


                if (AppSession.ReportScheduleID > 0)
                {
                    //Load the saved parameters
                    var oSaveAndScheduleService = new SaveAndScheduleService();
                    var savedParameters         = oSaveAndScheduleService.LoadUserSchedule(AppSession.ReportScheduleID);
                    TempData["SavedParameters"] = savedParameters; //This tempdata will be used by the Ajax call to avoid loading the saved parameters again from DB
                    TempData["ActionType"]      = actionType;

                    //Show/Hide Save to my reports button
                    ViewBag.HideSaveReport = HelperClasses.HideSaveToMyReports(AppSession.RoleID, savedParameters.UserID, AppSession.UserID, actionType);

                    return(View(reportservice.GetCorpSearchListsForSavedParameters(AppSession.ReportScheduleID, savedParameters, WebConstants.RFI_REPORT_TITLE_FINDING_REPORT)));
                }
                else
                {
                    return(View(reportservice.GetCorpSearchLists(WebConstants.RFI_REPORT_TITLE_FINDING_REPORT)));
                }
            }
            catch (Exception ex)
            {
                ExceptionLog exceptionLog = new ExceptionLog
                {
                    ExceptionText = "Reports: " + ex.Message,
                    PageName      = "PriorityFindingRFI",
                    MethodName    = "RFIFindingSummaryIndex",
                    UserID        = Convert.ToInt32(AppSession.UserID),
                    SiteId        = Convert.ToInt32(AppSession.SelectedSiteId),
                    TransSQL      = "",
                    HttpReferrer  = null
                };
                exceptionService.LogException(exceptionLog);

                return(RedirectToAction("Error", "Transfer"));
            }
        }
Ejemplo n.º 27
0
        //
        // GET: Tracer/ComplianceDepartment
        public ActionResult Index(int id, int?actionType)
        {
            try
            {
                HelperClasses.SetReportOrScheduleID(id, (int)ReportsListEnum.ComplianceByDepartment);
                ViewBag.ShowCMSRadio = true;

                SearchInputService reportservice = new SearchInputService();
                if (AppSession.ReportScheduleID > 0)
                {
                    //Load the saved parameters
                    var oSaveAndScheduleService = new SaveAndScheduleService();
                    var savedParameters         = oSaveAndScheduleService.LoadUserSchedule(AppSession.ReportScheduleID);
                    TempData["SavedParameters"] = savedParameters; //This tempdata will be used by the Ajax call to avoid loading the saved parameters again from DB
                    TempData["ActionType"]      = actionType;

                    //Show/Hide Save to my reports button
                    ViewBag.HideSaveReport = HelperClasses.HideSaveToMyReports(AppSession.RoleID, savedParameters.UserID, AppSession.UserID, actionType);

                    return(View(reportservice.GetSavedParameters_ComplianceDepartment(AppSession.ReportScheduleID, savedParameters, WebConstants.TRACER_REPORT_TITLE_COMPLIANCE_BY_DEPARTMENT)));
                }
                else
                {
                    return(View(reportservice.GetSearchLists_ComplianceDepartment(WebConstants.TRACER_REPORT_TITLE_COMPLIANCE_BY_DEPARTMENT)));
                }
            }
            catch (Exception ex)
            {
                ExceptionLog exceptionLog = new ExceptionLog
                {
                    ExceptionText = "Reports: " + ex.Message,
                    PageName      = "ComplianceDepartment",
                    MethodName    = "Index",
                    UserID        = Convert.ToInt32(AppSession.UserID),
                    SiteId        = Convert.ToInt32(AppSession.SelectedSiteId),
                    TransSQL      = "",
                    HttpReferrer  = null
                };
                exceptionService.LogException(exceptionLog);

                return(RedirectToAction("Error", "Transfer"));
            }
        }
        public ActionResult Index(int id, int?actionType)
        {
            HelperClasses.SetReportOrScheduleID(id, (int)ReportsListEnum.OrganizationPriorityFindings);

            if (AppSession.ReportScheduleID > 0)
            {
                //Load the saved parameters
                var oSaveAndScheduleService = new SaveAndScheduleService();
                var savedParameters         = oSaveAndScheduleService.LoadUserSchedule(AppSession.ReportScheduleID);
                TempData["SavedParameters"] = savedParameters; //This tempdata will be used by the Ajax call to avoid loading the saved parameters again from DB
                TempData["ActionType"]      = actionType;

                //Show/Hide Save to my reports button
                ViewBag.HideSaveReport = HelperClasses.HideSaveToMyReports(AppSession.RoleID, savedParameters.UserID, AppSession.UserID, actionType);
            }

            SearchInputService reportservice = new SearchInputService();

            return(View(reportservice.GetOrgFindingsSearchParams(WebConstants.TRACER_REPORT_TITLE_TRACER_PRIORITY_FINDING)));
        }
Ejemplo n.º 29
0
        public PartialViewResult LoadPrograms()
        {
            SearchInputService oUserSites = new SearchInputService();
            var model = oUserSites.GetPrograms();

            if (AppSession.SelectedProgramId > 0 && model.Count > 0)
            {
                //Update SelectedCertificationItemID variable which is used for Tracers Reports to AMP navigation
                AppSession.SelectedCertificationItemID = 0;
                AppSession.IsCertificationProgram      = model.Exists(prg => prg.BaseProgramID == AppSession.SelectedProgramId && prg.ProductID == 2);
                if (AppSession.IsCertificationProgram)
                {
                    var queryAdvancedCert = model.Find(prg => prg.BaseProgramID == AppSession.SelectedProgramId && prg.ProductID == 2 && prg.AdvCertListTypeID > 0);
                    if (queryAdvancedCert != null)
                    {
                        AppSession.SelectedCertificationItemID = (int)queryAdvancedCert.AdvCertListTypeID;
                    }
                }
            }
            return(PartialView("Search/_Programs", model));
        }
Ejemplo n.º 30
0
        public EmptyResult ReloadPage(UserSite _site, bool _redirectToHome = false)
        {
            // M.Orlando: When user is on Compliance page (http://localhost:49179/Corporate/Home/Index),
            // this is where code POSTS back to the server when the user selects different site.

            var menuService = new JCR.Reports.Services.MenuService();

            menuService.SaveArg(AppSession.UserID.GetValueOrDefault(), "SiteID", _site.SiteID.ToString());
            //menuService.SaveArg(AppSession.UserID.GetValueOrDefault(), "SiteName", _site.SiteFullName.ToString());
            //menuService.RefreshUserMenuState(AppSession.UserID.GetValueOrDefault());

            if (_redirectToHome)
            {
                return(new EmptyResult());
            }


            var commonService = new CommonService();

            AppSession.SelectedSiteId   = _site.SiteID;
            AppSession.SelectedSiteName = _site.SiteFullName;
            AppSession.IsCorporateSite  = commonService.CheckCorporateAccess(AppSession.SelectedSiteId);
            AppSession.HasTracersAccess = _site.IsTracersAccess == 1 ? true : false;
            CMSService.UpdateCMSSessionValue();

            SearchInputService reportService = new SearchInputService();

            var lstPrograms = AppSession.Sites.Where(m => m.SiteID == AppSession.SelectedSiteId).FirstOrDefault().Programs;

            //Set the default program when the site is changed
            reportService.SetProgramPreference(lstPrograms);



            return(new EmptyResult());
        }