Ejemplo n.º 1
0
        public void ModifyPrivilegeGroup(PrivilegeGroupObj groupObj)
        {
            using (helper = new SqlHelper())
            {
                helper.AddIntParameter("@GroupID", groupObj.GroupID);
                helper.AddStringParameter("@GroupName", 200, groupObj.GroupName);

                helper.ExecuteNonQuery("update PrivilegeGroups set GroupName=@GroupName where GroupID=@GroupID", CommandType.Text);
            }
        }
Ejemplo n.º 2
0
        public ActionResult ModifyGroup()
        {
            if (Request.HttpMethod == "POST")
            {
                if (!AppData.IsManagerLogin)
                {
                    return(Json(new { success = false, msg = "您未登录后台或会话已过期" }));
                }
                if (PrivilegeBLL.HasNotPrivilege(AppData.SessionUserID, 1402))
                {
                    return(Json(new { success = false, msg = "您没有执行该操作的权限" }));
                }

                Validation vld = new Validation();

                PrivilegeGroupObj groupObj = new PrivilegeGroupObj();
                groupObj.GroupID   = vld.GetInt("groupID", emptyAble: false, emptyText: "请传入用户组编号!");
                groupObj.GroupName = vld.Get("groupName", emptyAble: false, emptyText: "请填写用户组!");
                if (vld.HasError)
                {
                    return(Json(new { success = false, msg = vld.GetError() }));
                }

                PrivilegeBLL privilegeBLL = new PrivilegeBLL();
                privilegeBLL.ModifyPrivilegeGroup(groupObj);

                return(Json(new { success = true }));
            }
            else
            {
                if (!AppData.IsManagerLogin)
                {
                    return(Redirect("/Manage/Error/1.html"));
                }
                if (PrivilegeBLL.HasNotPrivilege(AppData.SessionUserID, 1402))
                {
                    return(Redirect("/Manage/Error/2.html"));
                }

                return(View());
            }
        }
Ejemplo n.º 3
0
        public PrivilegeGroupObj GetGroupByID(int groupID)
        {
            using (helper = new SqlHelper())
            {
                helper.AddIntParameter("@GroupID", groupID);
                using (SqlDataReader dr = helper.ExecuteReader("select GroupName from PrivilegeGroups where GroupID=@GroupID", CommandType.Text))
                {
                    if (dr.HasRows && dr.Read())
                    {
                        PrivilegeGroupObj groupObj = new PrivilegeGroupObj();
                        groupObj.GroupID   = groupID;
                        groupObj.GroupName = dr[0] == DBNull.Value ? null : (string)dr[0];

                        return(groupObj);
                    }

                    return(null);
                }
            }
        }
Ejemplo n.º 4
0
 public void ModifyPrivilegeGroup(PrivilegeGroupObj groupObj)
 {
     dal.ModifyPrivilegeGroup(groupObj);
 }