Пример #1
0
        public ActionResult PostRole()
        {
            int    id   = DoRequest.GetFormInt("roleid");
            string name = DoRequest.GetFormString("rolename").Trim();
            string desc = DoRequest.GetFormString("roledesc").Trim();
            int    type = DoRequest.GetFormInt("roletype", 2);

            RoleInfo role = new RoleInfo();

            role.role_id   = id;
            role.role_name = name;
            role.role_desc = desc;
            role.role_type = type;

            var returnValue = -1;
            var res         = OpRole.Do(role);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (returnValue == 0)
            {
                DoCache cache = new DoCache();
                cache.RemoveCacheStartsWith("user");
                return(Json(new { error = false, message = "操作成功!" }));
            }

            return(Json(new { error = true, message = "操作失败" }));
        }
Пример #2
0
        public ActionResult ResetMobile()
        {
            int    id        = DoRequest.GetFormInt("userid");
            string newmobile = DoRequest.GetFormString("newmobile");

            int returnValue = -1;
            var res         = ModifyUserMoblie.Do(id, newmobile);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (returnValue == 0)
            {
                DoCache cache = new DoCache();
                cache.RemoveCacheStartsWith("user");
                return(Json(new { error = false, mobile = newmobile, message = "操作成功!" }));
            }
            if (returnValue == 135251)
            {
                return(Json(new { error = true, message = "该手机号,已经使用,请更换手机号!" }));
            }

            return(Json(new { error = true, message = "操作失败!" }));
        }
Пример #3
0
        public ActionResult ResetUserState()
        {
            string idString = DoRequest.GetFormString("visitid").Trim();
            int    status   = DoRequest.GetFormInt("status");

            if (string.IsNullOrEmpty(idString))
            {
                return(Json(new { error = true, message = "没有选择任何项" }));
            }

            int returnValue = -1;
            var res         = ModifyUserState.Do(idString, status);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (returnValue == 0)
            {
                DoCache cache = new DoCache();
                cache.RemoveCacheStartsWith("user");
                return(Json(new { error = false, message = "操作成功!" }));
            }

            return(Json(new { error = true, message = "操作失败" }));
        }
Пример #4
0
        public ActionResult DeleteRoleInfo()
        {
            int id = DoRequest.GetFormInt("id");

            int returnValue = -1;
            var res         = DeleteRole.Do(id);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (returnValue == 0)
            {
                DoCache cache = new DoCache();
                cache.RemoveCacheStartsWith("user");
                return(Json(new { error = false, message = "操作成功!" }));
            }

            return(Json(new { error = true, message = "操作失败" }));
        }