Exemplo n.º 1
0
        public ActionResult indexMonitoringDirectPlus()
        {
            SettingFacade fac = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);
            DataTable     dt  = fac.DPMGetRegistration();
            //set Viewbag and viewbag bind in dropdown
            List <SelectListItem> lstMonitoringRegistrations = new List <SelectListItem>();

            if (dt != null && dt.Rows != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    lstMonitoringRegistrations.Add(new SelectListItem {
                        Value = Convert.ToString(dt.Rows[0]["MonitoringRegistrationName"]), Text = Convert.ToString(dt.Rows[0]["MonitoringRegistrationName"])
                    });
                }
            }
            ViewBag.dtMonitoringRegistrations = dt;
            MonitoringRegistrationDetailResponse monitoringRegistrationDetailResponse = new MonitoringRegistrationDetailResponse();

            if (lstMonitoringRegistrations != null && lstMonitoringRegistrations.Count > 0)
            {
                monitoringRegistrationDetailResponse = GetMonitoringRegistrationDetailResponseFromDB(lstMonitoringRegistrations.FirstOrDefault().Text.ToString());
            }
            if (monitoringRegistrationDetailResponse.messages == null)
            {
                monitoringRegistrationDetailResponse.messages = new Messages();
                monitoringRegistrationDetailResponse.messages.registration = new Registration();
                monitoringRegistrationDetailResponse.messages.references   = new List <string>();
            }

            // MP-1046 Create Individual URL redirection for all Tabs to make better format for URL
            if (Request.Headers["X-PJAX"] == "true")
            {
                return(PartialView(monitoringRegistrationDetailResponse));
            }
            else
            {
                ViewBag.SelectedTab = "Monitoring Direct Plus";
                return(View("~/Views/DandB/Index.cshtml", monitoringRegistrationDetailResponse));
            }
        }