public bool SetGroupAuthority(int add) { int intIndex = -1; Chain.BLL.SysGroupAuthority bllGroupAuthority = new Chain.BLL.SysGroupAuthority(); Chain.Model.SysGroupAuthority modelGroupAuthority = new Chain.Model.SysGroupAuthority(); bllGroupAuthority.DeleteList(int.Parse(this.HidGid.Value)); DataTable dtGroup = this.bllGroup.GetList(" GroupID=" + add).Tables[0]; for (int i = 0; i < this.gdGroupPermission.Items.Count; i++) { CheckBoxList Permission = (CheckBoxList)this.gdGroupPermission.Items[i].FindControl("ChkListPerm"); Label lblMenuID = (Label)this.gdGroupPermission.Items[i].FindControl("lblMenuID"); foreach (ListItem it in Permission.Items) { modelGroupAuthority.GroupID = new int?(int.Parse(dtGroup.Rows[0]["GroupID"].ToString())); modelGroupAuthority.ModuleID = new int?(int.Parse(lblMenuID.Text)); modelGroupAuthority.ActionValue = it.Selected; modelGroupAuthority.ActionID = new int?(int.Parse(it.Value)); intIndex = bllGroupAuthority.Add(modelGroupAuthority); } } bllGroupAuthority.CheckChildGroup(add); PubFunction.UpdateGroupAuthority(this._UserGroupID); return(intIndex > 0); }
public int DeleteGroup(Chain.Model.SysGroup model) { int result; if (model == null || model.GroupID == 0) { result = -1; } else { SysGroupAuthority bllSGA = new SysGroupAuthority(); this.UpdateParentId(model.GroupID, model.ParentGroupID); this.Delete(model.GroupID); bllSGA.DeleteList(model.GroupID); result = 1; } return(result); }