Beispiel #1
0
        public JsonResult UpdateButton(SYS_Button button)
        {
            JsonResult result = new JsonResult();
            string     msg    = "";

            try
            {
                button.ModifiedTime = DateTime.Now;
                button.Modifier     = (Session["user"] as SYS_User)?.UserName;
                bool isSuccess = buttonService.UpdateButton(button);
                if (isSuccess)
                {
                    msg = "修改成功";
                }
                else
                {
                    msg = "修改失败";
                }
                log.Info(msg);
            }
            catch (DbEntityValidationException e)
            {
                log.Error(e.Message);
            }
            catch (Exception e)
            {
                log.Error(e.Message);
            }
            finally
            {
                result = Json(new { msg = msg }, JsonRequestBehavior.AllowGet);
            }
            return(result);
        }