/// <summary> /// 绑定已经有的权限 /// </summary> /// <param name="groupid"></param> private void EditGroupBang(int groupid) { GroupAuthorityDAL bga = Leyp.SQLServerDAL.Factory.getGroupAuthorityDAL(); List <GroupAuthority> list = bga.getALLGroupAuthorityByGroupID(groupid); for (int i = 0; i <= AuthorityList.Rows.Count - 1; i++) { int id = Convert.ToInt32(AuthorityList.DataKeys[i].Value.ToString()); for (int j = 0; j < list.Count; j++) { if (id == list[j].AuthorityID) { CheckBox cbox = (CheckBox)AuthorityList.Rows[i].FindControl("CheckBox1"); cbox.Checked = true; } } } }
public GroupAuthorityDAL groupAuthority = null;//数据库操作类 public BGroupAuthority() { groupAuthority = new GroupAuthorityDAL(); }