Example #1
0
        /// <summary>
        /// Returns the filtered data to Home Page view
        /// </summary>
        /// <param name="customer"></param>
        /// <returns></returns>
        public ActionResult GetCustomer(string customer)
        {
            Trace.WriteLine("Entering GetCustomer method");
            ViewBag.TimeFilter = "Time Filter";
            if (customer.Equals("All"))
            {
                Trace.TraceInformation(DateTime.Now.ToLongTimeString() + "Fetching Media servers, critical alerts, failed Jobs, Missed Jobs, Succeeded jobs and Job completed with exception");
                var mediaServer1 = DocumentDBDataController.GetMediaServers();
                ViewBag.Alerts                  = DocumentDBDataController.GetCrititcalAlerts();
                ViewBag.FailedJobs              = DocumentDBDataController.GetFailedJobHistories();
                ViewBag.MissedJobs              = DocumentDBDataController.GetMissedJobHistories();
                ViewBag.SucceededJobs           = DocumentDBDataController.GetSucceededJobHistories();
                ViewBag.SucceededWithExceptions = DocumentDBDataController.GetExceptionJobHistories();
                ViewBag.Group = "All";
                return(PartialView("HomePage", mediaServer1));
            }

            var mediaServer = DocumentDBDataController.GetMediaServersByCustomerName(customer);

            ViewBag.Alerts                  = DocumentDBDataController.GetCrititcalAlerts();
            ViewBag.FailedJobs              = DocumentDBDataController.GetFailedJobHistories();
            ViewBag.MissedJobs              = DocumentDBDataController.GetMissedJobHistories();
            ViewBag.SucceededJobs           = DocumentDBDataController.GetSucceededJobHistories();
            ViewBag.SucceededWithExceptions = DocumentDBDataController.GetExceptionJobHistories();
            ViewBag.Group = customer;
            return(PartialView("HomePage", mediaServer));
        }