Пример #1
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));
            }
        }