Exemple #1
0
        public ActionResult SetBatchInterval(BatchMonitoringViewModel batchMonitoringVM)
        {
            Logger.Info(_logMsg.Clear().SetPrefixMsg("SetBatchInterval").Add("intervalTime", batchMonitoringVM.IntervalTime).ToInputLogString());
            try
            {
                if (ModelState.IsValid)
                {
                    _auditlogFacade = new AuditLogFacade();
                    if (_auditlogFacade.SaveBatchInterval(batchMonitoringVM.IntervalTimeInput.ToNullable <int>().Value))
                    {
                        return(RedirectToAction("BatchMonitoring", "AuditLog"));
                    }
                }

                TempData["BatchMonitoringVM"] = batchMonitoringVM;
                return(BatchMonitoring());
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
                Logger.Info(_logMsg.Clear().SetPrefixMsg("SetBatchInterval").Add("Error Message", ex.Message).ToFailLogString());
                return(Json(new
                {
                    Valid = false,
                    Error = Resource.Error_System,
                    Errors = string.Empty
                }));
            }
        }
Exemple #2
0
        public ActionResult BatchMonitoring()
        {
            Logger.Info(_logMsg.Clear().SetPrefixMsg("BatchMonitoring").ToInputLogString());
            try
            {
                _auditlogFacade = new AuditLogFacade();
                BatchMonitoringViewModel batchMonitorVM = null;

                if (TempData["BatchMonitoringVM"] != null)
                {
                    batchMonitorVM = (BatchMonitoringViewModel)TempData["BatchMonitoringVM"];
                }
                else
                {
                    batchMonitorVM = new BatchMonitoringViewModel();
                    int intervalTime = _auditlogFacade.GetBatchInterval();
                    batchMonitorVM.IntervalTime      = intervalTime;
                    batchMonitorVM.IntervalTimeInput = intervalTime.ToString(CultureInfo.InvariantCulture);
                }

                batchMonitorVM.BatchProcessList = _auditlogFacade.GetBatchProcess();
                batchMonitorVM.MonitorDateTime  = DateTime.Now.FormatDateTime(Constants.DateTimeFormat.DefaultFullDateTime);

                return(View("~/Views/AuditLog/BatchMonitoring.cshtml", batchMonitorVM));
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
                Logger.Info(_logMsg.Clear().SetPrefixMsg("BatchMonitoring").Add("Error Message", ex.Message).ToFailLogString());
                return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(),
                                                 this.ControllerContext.RouteData.Values["action"].ToString())));
            }
        }
Exemple #3
0
        public ActionResult BatchProcessList()
        {
            Logger.Info(_logMsg.Clear().SetPrefixMsg("BatchProcessList").ToInputLogString());
            try
            {
                _auditlogFacade = new AuditLogFacade();
                var batchMonitorVM = new BatchMonitoringViewModel();
                batchMonitorVM.BatchProcessList = _auditlogFacade.GetBatchProcess();
                batchMonitorVM.MonitorDateTime  = DateTime.Now.FormatDateTime(Constants.DateTimeFormat.DefaultFullDateTime);

                return(PartialView("~/Views/AuditLog/_BatchProcessList.cshtml", batchMonitorVM));
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
                Logger.Info(_logMsg.Clear().SetPrefixMsg("BatchProcessList").Add("Error Message", ex.Message).ToFailLogString());
                return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(),
                                                 this.ControllerContext.RouteData.Values["action"].ToString())));
            }
        }