Example #1
0
        public JsonResult RemoveAuthInGroup(int groupAuthId)
        {
            string result = new GroupSv().RemoveAuthInGroup(groupAuthId);

            if (!string.IsNullOrEmpty(result))
            {
                return(Json(new ResultModel()
                {
                    suc = false, msg = result
                }));
            }
            return(Json(new ResultModel()
            {
                suc = true
            }));
        }
Example #2
0
        public JsonResult UpdateGroup(int id, FormCollection col)
        {
            string name        = col.Get("groupName");
            string description = col.Get("description");

            string result = new GroupSv().UpdateGroup(id, name, description);

            if (!string.IsNullOrEmpty(result))
            {
                return(Json(new ResultModel()
                {
                    suc = false, msg = result
                }, "text/html"));
            }
            return(Json(new ResultModel()
            {
                suc = true
            }, "text/html"));
        }
Example #3
0
        public JsonResult AddAuthInGroup(int groupId, string auth)
        {
            string[] auths  = auth.Split(',');
            string   result = "";

            foreach (string au in auths)
            {
                int autId = Int32.Parse(au);
                result = new GroupSv().AddAuthInGroup(groupId, autId);
                if (!string.IsNullOrEmpty(result))
                {
                    return(Json(new ResultModel()
                    {
                        suc = false, msg = result
                    }));
                }
            }
            return(Json(new ResultModel()
            {
                suc = true
            }));
        }
Example #4
0
        public JsonResult AddUserInGroup(int groupId, string users)
        {
            string[] userArr = users.Split(',');
            string   result  = "";

            foreach (string user in userArr)
            {
                int userId = Int32.Parse(user);
                result = new GroupSv().AddUserInGroup(groupId, userId);
                if (!string.IsNullOrEmpty(result))
                {
                    return(Json(new ResultModel()
                    {
                        suc = false, msg = result
                    }));
                }
            }

            return(Json(new ResultModel()
            {
                suc = true
            }));
        }