Exemplo n.º 1
0
        /// <summary>
        /// Gets the Media server, Critical alerts and Job status information and returns HomePage View
        /// </summary>
        /// <returns></returns>
        public ActionResult HomePage()
        {
            Trace.WriteLine("Entering HomePage method");
            Trace.WriteLine("Entering HomePage method");
            try
            {
                Trace.TraceInformation(DateTime.Now.ToLongTimeString() + "Fetching Media servers, critical alerts, failed Jobs, Missed Jobs, Succeeded jobs and Job completed with exception");
                var mediaServer = DocumentDBDataController.GetMediaServers();

                ViewBag.Alerts                  = DocumentDBDataController.GetCrititcalAlerts();
                ViewBag.FailedJobs              = DocumentDBDataController.GetFailedJobHistories();
                ViewBag.MissedJobs              = DocumentDBDataController.GetMissedJobHistories();
                ViewBag.SucceededJobs           = DocumentDBDataController.GetSucceededJobHistories();
                ViewBag.SucceededWithExceptions = DocumentDBDataController.GetExceptionJobHistories();
                if (ViewBag.Group == null)
                {
                    ViewBag.Group = "Select Group";
                }
                if (ViewBag.TimeFilter == null)
                {
                    ViewBag.TimeFilter = "Time Filter";
                }
                return(View(mediaServer));
            }
            catch (Exception ex)
            {
                Exception baseException = ex.GetBaseException();
                Trace.TraceError("Error:" + ex.Message + "Message:" + baseException.Message);
                return(View("Error"));
            }
        }
Exemplo n.º 2
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));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns the filtered data to Home Page view
        /// </summary>
        /// <param name="mediaServer"></param>
        /// <param name="alerts"></param>
        /// <param name="failedJobs"></param>
        /// <param name="missedJobs"></param>
        /// <param name="succeededJobs"></param>
        /// <param name="succeededWithExceptionsJobs"></param>
        /// <param name="TimeFilter"></param>
        /// <returns></returns>
        public ActionResult FilteredImportantEvents(IEnumerable <MediaServer> mediaServer, List <Alert> alerts, List <JobHistory> failedJobs, List <JobHistory> missedJobs, List <JobHistory> succeededJobs, List <JobHistory> succeededWithExceptionsJobs, string TimeFilter)
        {
            Trace.WriteLine("Entering FileterImportatntEvents method");
            ViewBag.Group = "Select Group";
            var               media        = DocumentDBDataController.GetMediaServers();
            List <Alert>      alert        = DocumentDBDataController.GetCrititcalAlerts();
            List <JobHistory> failedJob    = DocumentDBDataController.GetFailedJobHistories();
            List <JobHistory> missedJob    = DocumentDBDataController.GetMissedJobHistories();
            List <JobHistory> succeededJob = DocumentDBDataController.GetSucceededJobHistories();
            List <JobHistory> succeededWithExceptionsJob = DocumentDBDataController.GetExceptionJobHistories();

            if (TimeFilter.Equals("All"))
            {
                ViewBag.Alerts                  = alert;
                ViewBag.FailedJobs              = failedJob;
                ViewBag.MissedJobs              = missedJob;
                ViewBag.SucceededJobs           = succeededJob;
                ViewBag.SucceededWithExceptions = succeededWithExceptionsJob;
                ViewBag.TimeFilter              = "All";
                return(PartialView("HomePage", media));
            }
            if (TimeFilter.Equals("-24"))
            {
                ViewBag.TimeFilter = "24 hrs";
            }
            if (TimeFilter.Equals("-48"))
            {
                ViewBag.TimeFilter = "48 hrs";
            }
            if (TimeFilter.Equals("-72"))
            {
                ViewBag.TimeFilter = "72 hrs";
            }
            if (TimeFilter.Equals("-168"))
            {
                ViewBag.TimeFilter = "1 Week";
            }
            if (TimeFilter.Equals("-730"))
            {
                ViewBag.TimeFilter = "1 Month";
            }
            int      hrs = Convert.ToInt32(TimeFilter);
            DateTime now = DateTime.Now;

            ViewBag.Alerts                  = alert.Where(o => o.Date > now.AddHours(hrs) && o.Date <= now).ToList();
            ViewBag.FailedJobs              = failedJob.Where(o => o.StartTime > now.AddHours(hrs) && o.StartTime <= now).ToList();
            ViewBag.MissedJobs              = missedJob.Where(o => o.StartTime > now.AddHours(hrs) && o.StartTime <= now).ToList();
            ViewBag.SucceededJobs           = succeededJob.Where(o => o.StartTime > now.AddHours(hrs) && o.StartTime <= now).ToList();
            ViewBag.SucceededWithExceptions = succeededWithExceptionsJob.Where(o => o.StartTime > now.AddHours(hrs) && o.StartTime <= now).ToList();
            return(PartialView("HomePage", media));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Gets the Media server, Critical alerts and Job status information and returns MediaServerInfo View
 /// </summary>
 /// <param name="mediaServer"></param>
 /// <returns></returns>
 public ActionResult MediaServerInfo(string mediaServer)
 {
     Trace.WriteLine("Entering MediaServerInfo method");
     try
     {
         Trace.TraceInformation(DateTime.Now.ToLongTimeString() + "Fetching  critical alerts, failed Jobs, Missed Jobs, Succeeded jobs and Job completed with exception");
         ViewBag.MediaServer             = mediaServer;
         ViewBag.Alerts                  = DocumentDBDataController.GetCrititcalAlerts();
         ViewBag.FailedJobs              = DocumentDBDataController.GetFailedJobHistories();
         ViewBag.MissedJobs              = DocumentDBDataController.GetMissedJobHistories();
         ViewBag.SucceededJobs           = DocumentDBDataController.GetSucceededJobHistories();
         ViewBag.SucceededWithExceptions = DocumentDBDataController.GetExceptionJobHistories();
         var mediaServer1 = DocumentDBDataController.GetMediaServers();
         return(View(mediaServer1));
     }
     catch (Exception ex)
     {
         Exception baseException = ex.GetBaseException();
         Trace.TraceError("Error:" + ex.Message + "Message:" + baseException.Message);
         return(View("Error"));
     }
 }