Ejemplo n.º 1
0
        // GET: /Monitoring/MessageAction/Delete/
        public ActionResult Delete(int?id)
        {
            try
            {
                if (id == null)
                {
                    throw new ArgumentNullException("MessageID");
                }
            }
            catch (ArgumentNullException ex)
            {
                new RMSWebException(this, "0500", "Delete failed. " + ex.Message, ex, true);
                throw;
            }
            string ret;

            try
            {
                var serviceClient = new RMS.Centralize.WebSite.Proxy.MessageActionService().messsageActionService;
                var result        = serviceClient.Delete(id);
                ret = result.IsSuccess ? "1" : "0";
            }
            catch (Exception ex)
            {
                ret = "0";
                new RMSWebException(this, "0500", "Delete failed. " + ex.Message, ex, true);
            }

            return(Json(ret));
        }
Ejemplo n.º 2
0
        // GET: /Monitoring/MessageAction/SearchMessageAction/
        public ActionResult SearchMessageAction(JQueryDataTableParamModel param, int?ddlMessageGroupID, string txtMessage, bool?ddlActiveStatus)
        {
            //JQueryDataTableParamModel param = new JQueryDataTableParamModel();
            //HttpContext Context = System.Web.HttpContext.Current;
            //param.sEcho = String.IsNullOrEmpty(Context.Request["sEcho"]) ? "0" : Context.Request["sEcho"];
            //param.sSearch = String.IsNullOrEmpty(Context.Request["sSearch"]) ? "" : Context.Request["sSearch"];
            //param.iDisplayStart = String.IsNullOrEmpty(Context.Request["iDisplayStart"]) ? 0 : Convert.ToInt32(Context.Request["iDisplayStart"]);
            //param.iDisplayLength = String.IsNullOrEmpty(Context.Request["iDisplayLength"]) ? 0 : Convert.ToInt32(Context.Request["iDisplayLength"]);

            var sortColumnIndex = Convert.ToInt32(Request["iSortCol_0"]);
            var sortDirection   = Request["sSortDir_0"]; // asc or desc

            param.iSortColumn = (Request["mDataProp_" + sortColumnIndex] + "_" + sortDirection).ToLower();
            try
            {
                var serviceClient = new RMS.Centralize.WebSite.Proxy.MessageActionService().messsageActionService;
                var result        = serviceClient.Search(param, ddlMessageGroupID, txtMessage, ddlActiveStatus);



                int?totalRecords = 0;
                totalRecords = result.TotalRecords;

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

                return(Json(data));
            }

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

                return(Json(data));
            }
        }