Exemplo n.º 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));
        }
Exemplo n.º 2
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.º 3
0
 /// <summary>
 /// Gets the Alerts and returns the Alerts view.
 /// </summary>
 /// <param name="mediaServer"></param>
 /// <returns></returns>
 public ActionResult Alert(string mediaServer)
 {
     Trace.WriteLine("Entering Alert method");
     try
     {
         ViewBag.DateSortParm = "date_desc";
         IEnumerable <Alert> alerts = DocumentDBDataController.GetAlerts(mediaServer);
         ViewBag.Mediaserver = mediaServer;
         ViewBag.Alerts      = alerts;
         if (ViewBag.Name == null)
         {
             ViewBag.Name = "Name";
         }
         if (ViewBag.Severity == null)
         {
             ViewBag.Severity = "Severity";
         }
         if (ViewBag.Category == null)
         {
             ViewBag.Category = "Category";
         }
         var mediaServer1 = DocumentDBDataController.GetMediaServers();
         return(View(alerts));
     }
     catch (Exception ex)
     {
         Trace.TraceError("Error:" + ex.Message);
         return(View("Error"));
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the media server details and returns the FilterPanel view.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="mediaServer"></param>
        /// <param name="befilter"></param>
        /// <returns></returns>
        public ActionResult FilterPanel(string id, string[] mediaServer, string[] befilter)
        {
            Trace.WriteLine("Entering FilterPanel method");
            ViewBag.Customer    = id;
            ViewBag.MediaServer = mediaServer;
            ViewBag.BEFilter    = befilter;

            var mediaServer1 = DocumentDBDataController.GetMediaServers();

            return(View(mediaServer1));
        }
Exemplo n.º 5
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.º 6
0
 /// <summary>
 /// Gets the Media server information and returns the GroupNew view
 /// </summary>
 /// <returns></returns>
 public ActionResult GroupNew()
 {
     Trace.WriteLine("Entering GroupNew method");
     try
     {
         Trace.TraceInformation(DateTime.Now.ToLongTimeString() + "Fetch the Media Server details");
         var mediaServer = DocumentDBDataController.GetMediaServers();
         return(View(mediaServer));
     }
     catch (Exception ex)
     {
         Trace.TraceError("Error:" + ex.Message);
         return(View("Error"));
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Gets the MediaServers and returns the AlertTab view.
 /// </summary>
 /// <param name="mediaServer"></param>
 /// <returns></returns>
 public ActionResult AlertTab(string mediaServer)
 {
     Trace.WriteLine("Entering AlertTab method");
     try
     {
         ViewBag.DateSortParm = "date_desc";
         ViewBag.Mediaserver  = mediaServer;
         var mediaServer1 = DocumentDBDataController.GetMediaServers();
         return(View(mediaServer1));
     }
     catch (Exception ex)
     {
         Trace.TraceError("Error:" + ex.Message);
         return(View("Error"));
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// Add Media servers into the Group and returns the GroupInfo view
        /// </summary>
        /// <param name="customer"></param>
        /// <returns></returns>
        public async Task <ActionResult> GroupAddServersFinal(string customer, string[] mediaServer)
        {
            Trace.WriteLine("Entering GroupAddServersFinal method");
            try
            {
                Trace.TraceInformation(DateTime.Now.ToLongTimeString() + "Fetch the Media Server details");
                var mediaServer1 = DocumentDBDataController.GetMediaServers();
                var medialist    = mediaServer1.Where(o => o.CustomerName.Equals(customer));
                await DocumentDBDataController.SaveGroupData("", "", mediaServer, customer);

                return(RedirectToAction("GroupInfo", "MediaServer", new { @customer = customer }));
            }
            catch (Exception ex)
            {
                Trace.TraceError("Error:" + ex.Message);
                return(View("Error"));
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Remove the Group and return GroupPage View
        /// </summary>
        /// <param name="customer"></param>
        /// <returns></returns>
        public async Task <ActionResult> RemoveGroup(string customer)
        {
            Trace.WriteLine("Entering RemoveGroup method");
            try
            {
                Trace.TraceInformation(DateTime.Now.ToLongTimeString() + "Fetch the Media Server details");
                var mediaServer1 = DocumentDBDataController.GetMediaServers();
                var medialist    = mediaServer1.Where(o => o.CustomerName.Equals(customer));
                var mediaServer  = medialist.Select(o => o.Name).Distinct();
                await DocumentDBDataController.SaveGroupData("", "", mediaServer, "Default Group");

                var mediaServer2 = DocumentDBDataController.GetMediaServers();
                ViewBag.MediaServer = mediaServer2;
                return(RedirectToAction("GroupPage", "MediaServer"));
            }
            catch (Exception ex)
            {
                Trace.TraceError("Error:" + ex.Message);
                return(View("Error"));
            }
        }
Exemplo n.º 10
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"));
     }
 }