public void insertNode(GroupAuthority g) { SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@GroupID", SqlDbType.Int, 4), new SqlParameter("@AuthorityID", SqlDbType.Int, 4) }; commandParameters[0].Value = g.GroupID; commandParameters[1].Value = g.AuthorityID; int num = SQLHelper.ExecuteNonQuery(SQLHelper.strCon, CommandType.StoredProcedure, "p_GroupAuthority_insertNewNode", commandParameters); }
public void insertGroupAuthority(int GroupID, int[] a) { for (int i = 0; i < a.Length; i++) { GroupAuthority g = new GroupAuthority(); g.GroupID = GroupID; g.AuthorityID = a[i]; this.groupAuthorityDAL.insertNode(g); } }
public List <GroupAuthority> getALLGroupAuthorityByGroupID(int GroupID) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@GroupID", SqlDbType.Int, 4) }; parameters[0].Value = GroupID; List <GroupAuthority> list = new List <GroupAuthority>(); SqlDataReader reader = SQLHelper.RunProcedure("p_GroupAuthority_getAll_ByGroupID", parameters); while (reader.Read()) { GroupAuthority item = new GroupAuthority(); item.ID = reader.GetInt32(reader.GetOrdinal("ID")); item.AuthorityID = reader.GetInt32(reader.GetOrdinal("AuthorityID")); item.GroupID = reader.GetInt32(reader.GetOrdinal("GroupID")); list.Add(item); } reader.Close(); return(list); }
/// <summary> /// 菜单绑定 type=1 /// </summary> protected void Databang() { AuthorityDAL bAuthority = Leyp.SQLServerDAL.Factory.getAuthorityDAL(); List <GroupAuthority> AL = new List <GroupAuthority>(); List <Authority> AL4 = new List <Authority>();//4 AL = Leyp.SQLServerDAL.Factory.getGroupAuthorityDAL().getALLGroupAuthorityByGroupID(getGroupID()); for (int i = 0; i < AL.Count; i++) { GroupAuthority g = AL[i]; Authority a = bAuthority.getByID(g.AuthorityID); if (a.TypeID == 4) { AL4.Add(a); } Menu.DataSource = AL4; Menu.DataBind(); } }
/// <summary> /// 添加一个关系 /// </summary> /// <param name="g">实体</param> public void insertNode(GroupAuthority g) { groupAuthority.insertNode(g); }
/// <summary> /// 根据权限初始化用户菜单 /// </summary> protected void Databang() { AuthorityDAL bAuthority = Leyp.SQLServerDAL.Factory.getAuthorityDAL(); List <GroupAuthority> AL = new List <GroupAuthority>(); List <Authority> AL0 = new List <Authority>(); //系统设置 0 List <Authority> AL1 = new List <Authority>(); //采购开单 1 List <Authority> AL2 = new List <Authority>(); //销售开单 2 List <Authority> AL3 = new List <Authority>(); //库存开单 3 List <Authority> AL4 = new List <Authority>(); //管理流程模块 4 AL = Leyp.SQLServerDAL.Factory.getGroupAuthorityDAL().getALLGroupAuthorityByGroupID(getGroupID()); for (int i = 0; i < AL.Count; i++) { GroupAuthority g = AL[i]; Authority a = bAuthority.getByID(g.AuthorityID); if (a.TypeID == 0) { AL0.Add(a); } if (a.TypeID == 1) { AL1.Add(a); } else if (a.TypeID == 2) { AL2.Add(a); } else if (a.TypeID == 3) { AL3.Add(a); } else if (a.TypeID == 4)//工作流 { AL4.Add(a); } // if(g. Hidden1.Value = AL0.Count.ToString(); //系统 Hidden2.Value = AL1.Count.ToString(); // Hidden3.Value = AL2.Count.ToString(); //销售开单 Hidden4.Value = AL3.Count.ToString(); //库存 Hidden5.Value = AL4.Count.ToString(); //管理 SystemSet.DataSource = AL0; SystemSet.DataBind(); purchaseMenu.DataSource = AL1; purchaseMenu.DataBind(); SalesMenu.DataSource = AL2; SalesMenu.DataBind(); StockMenu.DataSource = AL3; StockMenu.DataBind(); FlowRepeater.DataSource = AL4; FlowRepeater.DataBind(); } }