Esempio n. 1
0
        public ActionResult UpdateMenu(Menu_Resource_Model model)
        {
            try {
                if (model == null)
                {
                    return(Json(new NBCMSResultJson {
                        Status = StatusType.Error,
                        Data = "Request is illegal!"
                    }));
                }

                if (model.MR_ID == 0)
                {
                    return(Json(new NBCMSResultJson {
                        Status = StatusType.Error,
                        Data = "Request paramter is null!"
                    }));
                }
                string             cookis      = Request[ConfigurationManager.AppSettings["userInfoCookiesKey"]];
                var                serializer  = new JavaScriptSerializer();
                string             decCookies  = CryptTools.Decrypt(cookis);
                User_Profile_Model curUserInfo = serializer.Deserialize(decCookies, typeof(User_Profile_Model)) as User_Profile_Model;
                MenuServices       mns         = new MenuServices();
                if (mns.EditMenu(model, curUserInfo.User_Account))
                {
                    return(Json(new NBCMSResultJson {
                        Status = StatusType.OK,
                        Data = "Successfully edit menu"
                    }));
                }
                else
                {
                    return(Json(new NBCMSResultJson {
                        Status = StatusType.Error,
                        Data = "faile to edit menu"
                    }));
                }
            }
            catch (Exception ex) {
                NBCMSLoggerManager.Fatal(ex.Message);
                NBCMSLoggerManager.Fatal(ex.StackTrace);
                NBCMSLoggerManager.Error("");
                return(Json(new NBCMSResultJson {
                    Status = StatusType.Exception,
                    Data = ex.Message
                }));
            }
        }