Пример #1
0
        // GET: /Monitoring/Location/Delete/
        public ActionResult DeleteClientMonitoring(int?clientID, int?monitoringProfileID)
        {
            if (clientID == null)
            {
                throw new ArgumentNullException("ClientID");
            }
            if (monitoringProfileID == null)
            {
                throw new ArgumentNullException("MonitoringProfileID");
            }

            string ret;

            try
            {
                var service = new ClientMonitoringService().clientMonitoringService;

                var updatedBy = new BasePage().UserName;

                var result = service.Delete(clientID.Value, monitoringProfileID.Value, updatedBy);

                ret = result.IsSuccess ? "1" : "0";
            }
            catch (Exception ex)
            {
                ret = "0";
                new RMSWebException(this, "0500", "DeleteClientMonitoring failed. " + ex.Message, ex, true);
            }

            return(Json(ret));
        }
Пример #2
0
        public ActionResult AddClientMonitoring(int?clientID, int?monitoringProfileID, DateTime?effectiveDate)
        {
            if (clientID == null)
            {
                throw new ArgumentNullException("ClientID");
            }
            if (monitoringProfileID == null)
            {
                throw new ArgumentNullException("MonitoringProfileID");
            }
            if (effectiveDate == null)
            {
                throw new ArgumentNullException("EffectiveDate");
            }

            try
            {
                var service   = new ClientMonitoringService().clientMonitoringService;
                var updatedBy = new BasePage().UserName;
                var result    = service.Update(clientID.Value, monitoringProfileID.Value, null, effectiveDate.Value, updatedBy);

                var ret = new
                {
                    status = (result.IsSuccess) ? 1 : 0,
                    error  = (result.IsSuccess) ? "" : result.ErrorMessage
                };

                return(Json(ret));
            }
            catch (Exception ex)
            {
                var ret = new
                {
                    status = 0,
                    error  = ex.Message
                };

                new RMSWebException(this, "0500", "AddClientMonitoring failed. " + ex.Message, ex, true);

                return(Json(ret));
            }
        }
Пример #3
0
        public ActionResult ListClientMonitoring(JQueryDataTableParamModel param, int?clientID)
        {
            if (clientID == null)
            {
                throw new ArgumentNullException("ClientID");
            }

            try
            {
                var service = new ClientMonitoringService().clientMonitoringService;

                var result = service.ListByClient(clientID.Value);

                var ret = new
                {
                    sEcho                = param.sEcho,
                    iTotalRecords        = result.TotalRecords,
                    iTotalDisplayRecords = result.TotalRecords,
                    aaData               = result.ListMonitoringProfileInfos,
                    status               = (result.IsSuccess) ? 1 : 0,
                    error                = result.ErrorMessage
                };

                return(Json(ret));
            }
            catch (Exception ex)
            {
                var ret = new
                {
                    status = -1,
                    error  = ex.Message
                };
                new RMSWebException(this, "0500", "ListClientMonitoring failed. " + ex.Message, ex, true);

                return(Json(ret));
            }
        }