Beispiel #1
0
        public ActionResult AddPM()
        {
            if (Request.HttpMethod == "GET")
            {
                if (!AppData.IsManagerLogin)
                {
                    return(Redirect("/Manage/Error/1.html"));
                }
                if (PrivilegeBLL.HasNotPrivilege(AppData.SessionUserID, 2101))
                {
                    return(Redirect("/Manage/Error/2.html"));
                }

                return(View());
            }

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

            Validation vld    = new Validation();
            PMInfo     pmInfo = new PMInfo()
            {
                UserID     = vld.GetInt("userID"),
                UserIDFrom = AppData.SessionUser.UserID,
                Title      = vld.Get("title"),
                Content    = HttpUtility.UrlDecode(vld.Get("content"), Encoding.UTF8),
                PMTime     = DateTime.Now
            };

            UserBLL userBLL = new UserBLL();
            PM      pm      = new PM();

            pm.AddPM(pmInfo);

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