Esempio n. 1
0
        public ActionResult ModifyPM()
        {
            if (Request.HttpMethod == "GET")
            {
                if (!AppData.IsManagerLogin)
                {
                    return(Redirect("/Manage/Error/1.html"));
                }
                if (PrivilegeBLL.HasNotPrivilege(AppData.SessionUserID, 2103))
                {
                    return(Redirect("/Manage/Error/2.html"));
                }

                return(View());
            }

            if (!AppData.IsManagerLogin)
            {
                return(Json(new { success = false, msg = "您未登录后台或会话已过期" }));
            }
            if (PrivilegeBLL.HasNotPrivilege(AppData.SessionUserID, 2103))
            {
                return(Json(new { success = false, msg = "您没有执行该操作的权限" }));
            }

            Validation vld    = new Validation();
            int        pmID   = vld.GetInt("id");
            PM         pm     = new PM();
            PMInfo     pmInfo = pm.GetPM(pmID);

            if (pmInfo == null)
            {
                return(Json(new { success = false, msg = "该短消息不存在!" }));
            }
            pmInfo.Title      = vld.Get("title");
            pmInfo.Content    = HttpUtility.UrlDecode(vld.Get("content"), Encoding.UTF8);
            pmInfo.UserIDFrom = AppData.SessionUser.UserID;

            UserBLL userBLL = new UserBLL();

            pm.ModifyPM(pmInfo);

            return(Json(new { success = true }));
        }