public static void SubNode(TreeListNode tn, GridView dgvTmp) { foreach (TreeListNode tnSub in tn.Nodes) { string s1 = tnSub[1].ToString(); if (tnSub.Checked == true && !DataTypeConvert.GetString(tnSub.Tag).Contains(":Role")) { if (DataTypeConvert.GetString(tnSub.Tag) == "button") { //将设定的用户“按钮”权限保存到数据库 DataRow dr = dgvTmp.GetFocusedDataRow(); string menuname = DataTypeConvert.GetString(tnSub.ParentNode["MenuName"]); string mn = DataTypeConvert.GetString(tnSub["MenuName"]); FrmRightDAO.AddSqlStatement_SaveUserMenuButton(DataTypeConvert.GetInt(dgvTmp.GetFocusedDataRow()[0]), FrmRightDAO.GetMenuButtonId(menuname, mn)); } else { //将设定的用户“菜单”权限保存到数据库 FrmRightDAO.AddSqlStatement_SaveUserMenuButton(DataTypeConvert.GetInt(dgvTmp.GetFocusedDataRow()[0]), FrmRightDAO.GetMenuButtonId(DataTypeConvert.GetString(tnSub["MenuName"]), "menuItemFlag")); } } SubNode(tnSub, dgvTmp); } }
public static void SubNode(TreeNode tn, DataGridView dgvTmp) { foreach (TreeNode tnSub in tn.Nodes) { if (tnSub.Checked == true && !tnSub.Tag.ToString().Contains(":Role")) { if (tnSub.Tag.ToString() == "button") { //将设定的用户“按钮”权限保存到数据库 FrmRightDAO.AddSqlStatement_SaveUserMenuButton((int)dgvTmp.CurrentRow.Cells[0].Value, FrmRightDAO.GetMenuButtonId(tnSub.Parent.Name, tnSub.Name)); } else { //将设定的用户“菜单”权限保存到数据库 FrmRightDAO.AddSqlStatement_SaveUserMenuButton((int)dgvTmp.CurrentRow.Cells[0].Value, FrmRightDAO.GetMenuButtonId(tnSub.Name, "menuItemFlag")); } } SubNode(tnSub, dgvTmp); } }