Exemplo n.º 1
0
        // GET: /Monitoring/ActionProfile/DeleteActionProfile/
        public ActionResult DeleteActionProfile(int?ActionProfileID)
        {
            if (ActionProfileID == null)
            {
                throw new ArgumentNullException("ActionProfileID");
            }

            string ret;

            try
            {
                var apClient = new RMS.Centralize.WebSite.Proxy.ActionProfileService().actionProfileService;

                var result = apClient.Delete(ActionProfileID);

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



            return(Json(ret));
        }
Exemplo n.º 2
0
        // GET: /Monitoring/ActionProfile/GetActionProfile/
        public ActionResult GetActionProfile(int?id)
        {
            if (id == null)
            {
                throw new ArgumentNullException("ActionProfileID");
            }

            try
            {
                var apClient = new RMS.Centralize.WebSite.Proxy.ActionProfileService().actionProfileService;

                var result = apClient.Get(id);


                var ret = new
                {
                    status            = (result.IsSuccess) ? 1 : 0,
                    ActionProfileID   = result.ActionProfile.ActionProfileId,
                    ActionProfileName = result.ActionProfile.ActionProfileName,
                    data = JsonConvert.SerializeObject(result.ActionProfile, Formatting.Indented, new JsonSerializerSettings()
                    {
                        ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                    })
                };
                return(Json(ret));
            }
            catch (Exception ex)
            {
                var ret = new
                {
                    status = -1,
                    error  = ex.Message
                };
                new RMSWebException(this, "0500", "GetActionProfile failed. " + ex.Message, ex, true);

                return(Json(ret));
            }
        }