//查询用户信息 private EI.EIInfo queryUser() { //this.//EFMsgInfo = ""; EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk = new EI.EIInfo(); inblk.SetColName(1, "ename"); inblk.SetColName(2, "cname"); inblk.SetColName(3, "userid"); inblk.SetColName(4, "dept_ename"); inblk.SetColName(5, "q_appname"); inblk.SetColName(6, "page_index"); inblk.SetColVal(1, "cname", userCname); inblk.SetColVal(1, "ename", userEname); inblk.SetColVal(1, "userid", "XXLoginUserIDXX"); inblk.SetColVal(1, "dept_ename", userDeptName); inblk.SetColVal(1, "q_appname", fgDevComboBoxEditApp.EditValue.ToString().Split(':')[0]); inblk.SetColVal(1, "page_index", pageIndex); outblk = EI.EITuxedo.CallService("epesuser_inq2", inblk); dataSetEPESSUBJ.TESUSERINFO.Clear(); outblk.ConvertToStrongType(dataSetEPESSUBJ); dataSetEPESSUBJ.TESUSERINFO.AcceptChanges(); gridViewUserInfo_FocusedRowChanged(null, null); ShowReturnMsg(outblk); userSaveStatus = 0; return outblk; }
private void treeListResGroup_DoubleClick(object sender, EventArgs e) { TreeListNode fnode = treeListResGroup.FocusedNode; if (fnode == null || hiResGroup.HitInfoType == DevExpress.XtraTreeList.HitInfoType.Empty) return; if (fnode.Nodes.Count > 0) { fnode.Expanded = fnode.Expanded ? false : true; return; } fnode.Nodes.Clear(); EI.EIInfo inblk = new EI.EIInfo(); inblk.AddColName(1, "groupid"); inblk.AddColName(1, "appname"); inblk.SetColVal(1, 1, "groupid", fnode.GetValue(treeListColumnRGID).ToString()); inblk.SetColVal(1, 1, "appname", this.selectedAppname); EI.EIInfo outblk = EI.EITuxedo.CallService("epesres_inq", inblk); if (outblk.sys_info.flag < 0) { MessageBox.Show(outblk.sys_info.msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { string aclid = "", name = "", description = "", res_name = "", res_type = ""; for (int i = 0; i < outblk.Tables[0].Rows.Count; i++) { aclid = outblk.Tables[0].Rows[i]["aclid"].ToString(); name = outblk.Tables[0].Rows[i]["name"].ToString(); description = outblk.Tables[0].Rows[i]["description"].ToString(); res_name = outblk.Tables[0].Rows[i]["res_name"].ToString(); res_type = outblk.Tables[0].Rows[i]["res_type"].ToString(); TreeListNode node = treeListResGroup.AppendNode(new object[2] , fnode, CheckState.Indeterminate); node.SetValue(treeListColumnRGName, name + "[" + description + "]"); node.SetValue(treeListColumnRGID, aclid); //node.Tag = aclid; switch (res_type) { case "FORM": node.ImageIndex = node.SelectImageIndex = FORMICON; break; case "BUTT": node.ImageIndex = node.SelectImageIndex = BUTTICON; break; case "OTH": node.ImageIndex = node.SelectImageIndex = OTHICON; break; } } fnode.ExpandAll(); } fnode.ExpandAll(); }
private void treeListUser_DoubleClick(object sender, EventArgs e) { TreeListNode node = treeListUser.FocusedNode; if (node == null) return; node.Nodes.Clear(); string ename = node.GetDisplayText(0); string company = EPESCommon.AuthMode == AUTHMODE.MODE_9672 ? "" : selectedCompanyCode; if (node.ImageIndex == USERICON) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk = new EI.EIInfo(); inblk.SetColName(1, "username"); inblk.SetColName(2, "appname"); inblk.SetColName(3, "companycode"); inblk.SetColName(4, "loginuser"); inblk.SetColVal(1, 1, ename); inblk.SetColVal(1, 2, selectedAppname); inblk.SetColVal(1, "companycode", company); inblk.SetColVal(1, "loginuser", "XXLoginUserIDXX"); //查询用户所属/所管理的群组 outblk = EI.EITuxedo.CallService("epesugroup_inq", inblk); string groupID = "", groupName = "", groupDesc = "", admin1 = "", admin2 = ""; string isadmin = outblk.GetColVal(2, 1, "isadmin"); for (int i = 0; i < outblk.blk_info[0].Row; i++) { groupID = outblk.GetColVal(1, i + 1, "id"); groupName = outblk.GetColVal(1, i + 1, "name"); groupDesc = outblk.GetColVal(1, i + 1, "groupdescription"); admin1 = outblk.GetColVal(1, i + 1, "adminuserename1"); admin2 = outblk.GetColVal(1, i + 1, "adminuserename2"); TreeListNode treeNode; treeNode = this.treeListUser.AppendNode(new object[5], node); node.Nodes[i].SetValue(0, groupName); node.Nodes[i].SetValue(1, groupDesc); node.Nodes[i].SetValue(2, admin1); node.Nodes[i].SetValue(3, admin2); node.Nodes[i].SetValue(4, groupID); treeNode.Tag = groupName; if (admin1 == "XXLoginUserIDXX" || admin2 == "XXLoginUserIDXX" || isadmin == "1") { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUPICON; } else { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUPICON2; } } } else if (node.ImageIndex == GROUPICON) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk = new EI.EIInfo(); inblk.SetColName(1, "username"); inblk.SetColName(2, "mode"); inblk.SetColName(3, "appname"); inblk.SetColName(4, "companycode"); inblk.SetColName(5, "loginuser"); inblk.SetColVal(1, 1, ename); inblk.SetColVal(1, 2, 5); inblk.SetColVal(1, 3, selectedAppname); inblk.SetColVal(1, "companycode", company); inblk.SetColVal(1, "loginuser", "XXLoginUserIDXX"); //查询群组的父组 outblk = EI.EITuxedo.CallService("epesusergrp_inq", inblk); string groupID = "", groupName = "", groupDesc = "", admin1 = "", admin2 = ""; string isadmin = outblk.GetColVal(2, 1, "isadmin"); for (int i = 0; i < outblk.blk_info[0].Row; i++) { groupID = outblk.GetColVal(1, i + 1, "id"); groupName = outblk.GetColVal(1, i + 1, "ename"); groupDesc = outblk.GetColVal(1, i + 1, "cname"); admin1 = outblk.GetColVal(1, i + 1, "adminuserename1"); admin2 = outblk.GetColVal(1, i + 1, "adminuserename2"); TreeListNode treeNode; treeNode = this.treeListUser.AppendNode(new object[5], node); node.Nodes[i].SetValue(0, groupName); node.Nodes[i].SetValue(1, groupDesc); node.Nodes[i].SetValue(2, admin1); node.Nodes[i].SetValue(3, admin2); node.Nodes[i].SetValue(4, groupID); treeNode.Tag = groupName; if (admin1 == "XXLoginUserIDXX" || admin2 == "XXLoginUserIDXX" || isadmin == "1") { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUPICON; } else { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUPICON2; } } } treeListUser.FocusedNode.ExpandAll(); }
/// <summary> /// 资源到群组模式 /// </summary> private void SaveResGroupToGroup() { EI.EIInfo inblk = new EI.EIInfo(); inblk.AddColName(1, "appname"); inblk.SetColVal(1, 1, "appname", "EventArgs.epEname"); if (htResGroupAdd.Count > 0) { DataTable dt = new DataTable("RES_GROUP_ADD"); dt.Columns.Add("groupid"); dt.Columns.Add("resgroupid"); foreach (System.Collections.DictionaryEntry item in htResGroupAdd) { string groupid = item.Key.ToString(); string resgroupid = item.Value.ToString(); dt.Rows.Add(new object[] { groupid, resgroupid }); } inblk.Tables.Add(dt); } if (htResGroupRmv.Count > 0) { DataTable dt = new DataTable("RES_GROUP_RMV"); dt.Columns.Add("groupid"); dt.Columns.Add("resgroupid"); foreach (System.Collections.DictionaryEntry item in htResGroupRmv) { string groupid = item.Key.ToString(); string resgroupid = item.Value.ToString(); dt.Rows.Add(new object[] { groupid, resgroupid }); } inblk.Tables.Add(dt); } EI.EIInfo outblk = EI.EITuxedo.CallService("epesgrgr_upd", inblk); if (outblk.sys_info.flag == 0) { TreeListNode node = treeListResGroup.FocusedNode.Level == 0 ? treeListResGroup.FocusedNode : treeListResGroup.FocusedNode.ParentNode; QryGroupInResGroup(node.GetValue(treeListColumnRGID).ToString()); htResGroupAdd.Clear(); htResGroupRmv.Clear(); fgButtonGroupSave.Enabled = false; //this.//EFMsgInfo = EP.EPES.EPESC0000156/*操作成功!*/; } else { MessageBox.Show(outblk.sys_info.msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private EI.EIInfo CallSelectService(string name, string fname, long treeno, long mode, string cursystem) { EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock = null; inBlock.SetColName(1, "name"); inBlock.SetColName(2, "fname"); inBlock.SetColName(3, "treeno"); inBlock.SetColName(4, "mode"); inBlock.SetColName(5, "cursystem"); inBlock.SetColVal(1, "name", name); inBlock.SetColVal(1, "fname", fname); inBlock.SetColVal(1, "treeno", treeno); inBlock.SetColVal(1, "mode", mode); inBlock.SetColVal(1, "cursystem", cursystem); outBlock = EI.EITuxedo.CallService("epestree_inqb", inBlock);//根据mode不同,查询条件不同 return outBlock; }
/// <summary> /// 对于展开的树查询上面画面、按钮的权限 /// </summary> private void RfgreshTree() { nodeName.Clear(); GetFormName(treeListRes.Nodes); EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; int mode = -1; if (subjType == SUBJTYPE.USER) mode = 2; else if (subjType == SUBJTYPE.GROUP && EPESCommon.AuthMode == AUTHMODE.MODE_9672) mode = 0; else mode = 1; inblk.SetColName(1, "ename"); inblk.SetColName(2, "formname"); inblk.SetColName(3, "mode"); inblk.SetColName(4, "appname"); inblk.SetColName(5, "companycode"); inblk.SetColVal(1, 1, "ename", subjEname); for (int i = 0; i < nodeName.Count; i++) { inblk.SetColVal(1, i + 1, "formname", nodeName[i]); } inblk.SetColVal(1, 1, "mode", mode); inblk.SetColVal(1, 1, "appname", this.selectedAppname); inblk.SetColVal(1, 1, "companycode", this.selectedCompanyCode); outblk = EI.EITuxedo.CallService("epesformauthinq", inblk); forminfo.Clear(); auth.Clear(); for (int j = 1; j <= outblk[0].Row; j++) { string formname = outblk.GetColVal(1, j, "formname"); string buttname = outblk.GetColVal(1, j, "buttname"); string formcount = outblk.GetColVal(2, j, "formcount"); string buttcount = outblk.GetColVal(2, j, "buttcount"); if (!forminfo.ContainsKey(formname)) { forminfo.Add(formname, formcount); if (!auth.ContainsKey(formname)) { auth.Add(formname, new Dictionary<string, object>()); } } if (buttname.Trim().Length > 0 && !((Dictionary<string, object>)auth[formname]).ContainsKey(buttname)) { ((Dictionary<string, object>)auth[formname]).Add(buttname, buttcount); } } SetNodeCheck(treeListRes.Nodes); }
/// <summary> /// 群组到资源模式 /// </summary> private bool SaveGroupToResGroup() { EI.EIInfo inblk = new EI.EIInfo(); inblk.AddColName(1, "appname"); inblk.SetColVal(1, 1, "appname", "EventArgs.epEname"); if (htGroupResAdd.Count > 0) { DataTable dt = new DataTable("GROUP_RES_ADD"); dt.Columns.Add("groupid"); dt.Columns.Add("resgroupid"); foreach (System.Collections.DictionaryEntry item in htGroupResAdd) { string resgroupid = item.Key.ToString(); string groupid = item.Value.ToString(); dt.Rows.Add(new object[] { groupid, resgroupid }); } inblk.Tables.Add(dt); } if (htGroupResRmv.Count > 0) { DataTable dt = new DataTable("GROUP_RES_RMV"); dt.Columns.Add("groupid"); dt.Columns.Add("resgroupid"); foreach (System.Collections.DictionaryEntry item in htGroupResRmv) { string resgroupid = item.Key.ToString(); string groupid = item.Value.ToString(); dt.Rows.Add(new object[] { groupid, resgroupid }); } inblk.Tables.Add(dt); } EI.EIInfo outblk = EI.EITuxedo.CallService("epesgrgr_upd", inblk); if (outblk.sys_info.flag == 0) { QryParentResGroup(); htGroupResAdd.Clear(); htGroupResRmv.Clear(); fgButtonResGroup.Enabled = false; //this.//EFMsgInfo = EP.EPES.EPESC0000156/*操作成功!*/; return true; } else { MessageBox.Show(outblk.sys_info.msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } }
private EI.EIInfo QryButtAuth(string formName) { EI.EIInfo inblks = new EI.EIInfo(); EI.EIInfo outblks = new EI.EIInfo(); int mode = -1; if (subjType == SUBJTYPE.USER) mode = 2; else if (subjType == SUBJTYPE.GROUP && EPESCommon.AuthMode == AUTHMODE.MODE_9672) mode = 0; else mode = 1; inblks.SetColName(1, "subjename"); inblks.SetColName(2, "formname"); inblks.SetColName(3, "mode"); inblks.SetColName(4, "appname"); inblks.SetColName(5, "companycode"); inblks.SetColVal(1, "subjename", subjEname); inblks.SetColVal(1, "formname", formName); inblks.SetColVal(1, "mode", mode); inblks.SetColVal(1, "appname", this.selectedAppname); inblks.SetColVal(1, "companycode", this.selectedCompanyCode); outblks = EI.EITuxedo.CallService("epesbuttauthinq", inblks); return outblks; }
private EI.EIInfo QryFormButt(string formName) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; int col; col = 1; inblk.SetColName(col++, "bname"); //按钮名 inblk.SetColName(col++, "aclid"); //fgLabelText2.EFEname.ToLower() inblk.SetColName(col++, "mode"); inblk.SetColName(col++, "fname"); inblk.SetColName(col++, "appname"); inblk.SetColVal(1, 1, "fname", formName); inblk.SetColVal(1, 1, "mode", 0); inblk.SetColVal(1, 1, "appname", this.selectedAppname); inblk.AddNewBlock(); inblk.SetColName(2, 1, "userid"); inblk.SetColName(2, 2, "appname"); inblk.SetColVal(2, 1, "userid", "XXLoginUserIDXX"); inblk.SetColVal(2, 1, "appname", "EventArgs.epEname"); outblk = EI.EITuxedo.CallService("epesbutt_inq2", inblk); return outblk; }
private void fgDevGridUserInfo_DoubleClick(object sender, EventArgs e) { //this.//EFMsgInfo = ""; if (this.gridViewUserInfo.RowCount == 0 || this.gridViewUserInfo.FocusedRowHandle < 0) return; this.treeListMain.Nodes.Clear(); string username = ""; if (this.gridViewUserInfo.GetRowCellValue(gridViewUserInfo.FocusedRowHandle, "ENAME") != null) { username = gridViewUserInfo.GetRowCellValue(gridViewUserInfo.FocusedRowHandle, "ENAME").ToString(); } EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk = new EI.EIInfo(); inblk.SetColName(1, "username"); inblk.SetColName(2, "appname"); inblk.SetColName(3, "companycode"); inblk.SetColName(4, "loginuser"); inblk.SetColVal(1, 1, username); inblk.SetColVal(1, 2, fgDevComboBoxEditApp.EditValue.ToString().Split(':')[0]); inblk.SetColVal(1, "companycode", ""); inblk.SetColVal(1, "loginuser", "XXLoginUserIDXX"); //查询用户所属/所管理的群组 outblk = EI.EITuxedo.CallService("epesugroup_inq", inblk); string groupID = "", groupName = "", groupDesc = "", admin1 = "", admin2 = ""; string isadmin = outblk.GetColVal(2, 1, "isadmin"); this.treeListMain.Nodes.Clear(); for (int i = 0; i < outblk.blk_info[0].Row; i++) { groupID = outblk.GetColVal(1, i + 1, "id"); groupName = outblk.GetColVal(1, i + 1, "name"); groupDesc = outblk.GetColVal(1, i + 1, "groupdescription"); admin1 = outblk.GetColVal(1, i + 1, "adminuserename1"); admin2 = outblk.GetColVal(1, i + 1, "adminuserename2"); List<string> tag = new List<string>(); tag.Add(groupName); tag.Add(groupID); TreeListNode treeNode = this.treeListMain.AppendNode(new object[] { groupName + "(" + groupDesc + ")" }, null, tag); //treeNode.Tag = groupName; if (admin1 == "XXLoginUserIDXX" || admin2 == "XXLoginUserIDXX" || isadmin == "1") { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUPICON; } else { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUPICON_GRAY; } } this.treeListMain.ExpandAll(); }
//查询用户管辖范围内的部门信息 private void getUserDept() { //获取部门信息 EI.EIInfo inblku = new EI.EIInfo(); EI.EIInfo outblku = new EI.EIInfo(); inblku.SetColName(1, "ename"); inblku.SetColVal(1, 1, ""); inblku.SetColName(2, "cname"); inblku.SetColVal(1, 2, ""); inblku.SetColName(3, "user_name"); inblku.SetColVal(1, 3, "formUserId"); inblku.SetColName(4, "appname"); inblku.SetColVal(1, 4, "epAppName"); outblku = EI.EITuxedo.CallService("epesusdept_inq", inblku); if (outblku.sys_info.flag < 0) { MessageBox.Show(string.Format(EP.EPES.EPESC0000106/*获取用户管辖部门信息错误:{0}*/, outblku.sys_info.msg), EP.EPES.EPESC0000009/*错误*/, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } object obj_qry = 0; string v_all = ""; fgDevComboBoxEditDept.Properties.Items.Add(EP.EPES.EPESC0000107/*ALL:所有部门*/); combDept.Properties.Items.Add(EP.EPES.EPESC0000107/*ALL:所有部门*/); for (int i = 1; i <= outblku.blk_info[0].Row; i++) { v_all = outblku.GetColVal(i, "ename") + ": " + outblku.GetColVal(i, "cname"); obj_qry = v_all; fgDevComboBoxEditDept.Properties.Items.Add(obj_qry); combDept.Properties.Items.Add(obj_qry); repstryItemComboBoxUserDeptName.Items.Add(outblku.GetColVal(i, "ename")); } if (outblku.blk_info[0].Row > 0) { fgDevComboBoxEditDept.SelectedIndex = 0; combDept.SelectedIndex = 0; } //获取用户信息的部门标识列下拉列表集合 //this.repositoryItemLookUpEditDeptNo.DisplayMember = "id"; //this.repositoryItemLookUpEditDeptNo.ValueMember = "id"; //this.repositoryItemLookUpEditDeptNo.DataSource = outblku.Tables[0]; this.repositoryItemLookUpEditDeptName.DisplayMember = "ename"; this.repositoryItemLookUpEditDeptName.ValueMember = "ename"; this.repositoryItemLookUpEditDeptName.DataSource = outblku.Tables[0]; }
private void treeListMain_DragDrop(object sender, DragEventArgs e) { //this.//EFMsgInfo = ""; DevExpress.XtraTreeList.TreeListHitInfo hi = treeListMain.CalcHitInfo(treeListMain.PointToClient(new Point(e.X, e.Y))); TreeListNode parentNode = null; //拖拽至用户节点 if (hi.Node.ImageIndex == USERICON) { parentNode = hi.Node.ParentNode; } //拖拽至群组节点 else if (hi.Node.ImageIndex == GROUPICON || hi.Node.ImageIndex == GROUPICON_GRAY) { parentNode = hi.Node; } EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock = new EI.EIInfo(); //为群组新增子组 if (xtraTabControl1.SelectedTabPage == xtraTabPageGroup) { string parentGroup = ((List<string>)parentNode.Tag)[0]; if (parentGroup == "admingroup" || parentGroup == "formgroup" || parentGroup == "usermanager" || parentGroup == "groupmanager" || parentGroup == "resourcemanager") { MessageBox.Show(EP.EPES.EPESC0000193/*系统群组下不可挂子组,请将角色用户直接添加到该组下!*/, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } inBlock.SetColName(1, 1, "ID"); inBlock.SetColName(1, 2, "userid"); inBlock.SetColVal(1, 1, "ID", ((List<string>)parentNode.Tag)[1]); inBlock.SetColVal(1, 1, "userid", "XXLoginUserIDXX"); inBlock.AddNewBlock(); inBlock.SetColName(1, "ID"); for (int i = 0, j = 1; i < this.gridViewGroupInfo.RowCount; i++) { if (fgDevGridGroupInfo.GetSelectedColumnChecked(i)) { inBlock.SetColVal(2, j, "ID", this.gridViewGroupInfo.GetRowCellValue(i, "ID").ToString()); j++; } } outBlock = EI.EITuxedo.CallService("epesgrgr_ins", inBlock); if (outBlock.sys_info.flag == 0) { queryMember(parentNode); //取消列表框中所有checkbox选中状态 UnCheckAll(fgDevGridGroupInfo, gridViewGroupInfo); } } //为群组新增子用户 else if (xtraTabControl1.SelectedTabPage == xtraTabPageUser) { inBlock.SetColName(1, 1, "groupid"); inBlock.SetColName(1, 2, "groupname"); inBlock.SetColName(1, 3, "user"); inBlock.SetColName(1, 4, "authmode"); inBlock.SetColVal(1, 1, "groupid", ((List<string>)parentNode.Tag)[1]); inBlock.SetColVal(1, 1, "groupname", ((List<string>)parentNode.Tag)[0]); inBlock.SetColVal(1, 1, "user", "XXLoginUserIDXX"); inBlock.SetColVal(1, 1, "authmode", (EPESCommon.AuthMode == AUTHMODE.MODE_9672) ? 1 : 0); inBlock.AddNewBlock(); inBlock.SetColName(1, "userid"); inBlock.SetColName(2, "username"); for (int i = 0, j = 1; i < this.gridViewUserInfo.RowCount; i++) { if (fgDevGridUserInfo.GetSelectedColumnChecked(i)) { inBlock.SetColVal(2, j, "userid", this.gridViewUserInfo.GetRowCellValue(i, "ID").ToString()); inBlock.SetColVal(2, j, "username", this.gridViewUserInfo.GetRowCellValue(i, "ENAME").ToString()); j++; } } outBlock = EI.EITuxedo.CallService("epesgrus_ins", inBlock); if (outBlock.sys_info.flag == 0) { queryMember(parentNode); // 取消列表框中所有checkbox选中状态 UnCheckAll(fgDevGridUserInfo, gridViewUserInfo); } } ShowReturnMsg(outBlock); treeListMain.OptionsBehavior.DragNodes = false; }
//保存 private bool SaveUserInfo() { DataTable instable = this.dataSetEPESSUBJ.TESUSERINFO.Clone(); DataTable deltable = null; DataTable updtable = this.dataSetEPESSUBJ.TESUSERINFO.Clone(); //FilterData(instable); //FilterData(updtable); DataRow dr = null; for (int rowIndex = 0; rowIndex < gridViewUserInfo.RowCount; ++rowIndex) { if (fgDevGridUserInfo.GetSelectedColumnChecked(rowIndex)) { dr = gridViewUserInfo.GetDataRow(rowIndex); if (dr.RowState == DataRowState.Added) { instable.Rows.Add(dr.ItemArray); } else if (dr.RowState == DataRowState.Modified) { updtable.Rows.Add(dr.ItemArray); } } } deltable = dataSetEPESSUBJ.TESUSERINFO.GetChanges(DataRowState.Deleted); EI.EIInfo inBlock = new EI.EIInfo(); inBlock.SetColName(1, "userid"); inBlock.SetColVal(1, "userid", "XXLoginUserIDXX"); inBlock.SetColName(2, "appname"); inBlock.SetColVal(1, "appname", this.fgDevComboBoxEditApp.EditValue.ToString().Split(':')[0]); if (instable != null && instable.Rows.Count > 0) { instable.TableName = "INSERT_BLOCK"; inBlock.Tables.Add(instable); } if (deltable != null && deltable.Rows.Count > 0) { deltable.RejectChanges(); deltable.TableName = "DELETE_BLOCK"; inBlock.Tables.Add(deltable); } if (updtable != null && updtable.Rows.Count > 0) { updtable.TableName = "UPDATE_BLOCK"; inBlock.Tables.Add(updtable); } if (inBlock.Tables.Count > 1) { EI.EIInfo outBlock = EI.EITuxedo.CallService("epesuser_do", inBlock); if (outBlock.sys_info.flag < 0) { MessageBox.Show(outBlock.sys_info.msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } } return true; }
private void repositoryItemLookUpEditAdmin1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { //this.//EFMsgInfo = ""; LookUpEdit be = sender as LookUpEdit; string admin1 = be.Text; if (admin1.Length < 2) { //this.//EFMsgInfo = EP.EPES.EPESC0000109/*请输入两位查询字符*/; return; } string app = gridViewGroupInfo.GetRowCellValue(this.gridViewGroupInfo.FocusedRowHandle, "APPNAME").ToString(); //if (app.Length < 2) //{ // MessageBox.Show("请先选择需要新增的群组子系统!"); // return; //} //FormESSUBJADMIN frm = new FormESSUBJADMIN(val.ToString(), app, MousePosition); //frm.ShowDialog(); EI.EIInfo inBlocks = new EI.EIInfo(); EI.EIInfo outBlocks; inBlocks.SetColName(1, "ename"); inBlocks.SetColName(2, "cname"); inBlocks.SetColName(3, "userid"); inBlocks.SetColName(4, "dept_ename"); inBlocks.SetColName(5, "q_appname"); inBlocks.SetColVal(1, "ename", admin1); inBlocks.SetColVal(1, "cname", " "); inBlocks.SetColVal(1, "userid", "EventArgs.formUserId"); inBlocks.SetColVal(1, "dept_ename", " "); inBlocks.SetColVal(1, "q_appname", app); outBlocks = EI.EITuxedo.CallService("epesuser_inq2", inBlocks); DataSet ds = new DataSet(); outBlocks.GetBlockVal(ds); repositoryItemLookUpEditAdmin1.DataSource = ds.Tables[0]; repositoryItemLookUpEditAdmin1.DisplayMember = "ename"; repositoryItemLookUpEditAdmin1.ValueMember = "cname"; LookUpColumnInfoCollection coll = repositoryItemLookUpEditAdmin1.Properties.Columns; coll.Add(new LookUpColumnInfo("ename", 0)); coll.Add(new LookUpColumnInfo("cname", 0)); repositoryItemLookUpEditAdmin1.Properties.BestFitMode = BestFitMode.BestFitResizePopup; string rst = repositoryItemLookUpEditAdmin1.ValueMember; if (rst != string.Empty) { gridViewGroupInfo.SetRowCellValue(gridViewGroupInfo.FocusedRowHandle, colADMINUSERNAME1, rst); } }
private EI.EIInfo QryUser() { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; inblk.SetColName(1, "ename"); inblk.SetColName(2, "cname"); inblk.SetColName(3, "userid"); inblk.SetColName(4, "dept_ename"); inblk.SetColName(5, "q_appname"); inblk.SetColName(6, "page_index"); inblk.SetColVal(1, "cname", fgtUCname.Text); inblk.SetColVal(1, "ename", fgtUEname.Text); inblk.SetColVal(1, "userid", "XXLoginUserIDXX"); inblk.SetColVal(1, "dept_ename", "ALL"); inblk.SetColVal(1, "q_appname", selectedAppname); inblk.SetColVal(1, "page_index", page_index); outblk = EI.EITuxedo.CallService("epesuser_inq2", inblk); outblk.Tables[0].Columns.Add("adminuserename1"); outblk.Tables[0].Columns.Add("adminuserename2"); for (int i = 0; i < outblk.Tables[0].Columns.Count; i++) { outblk.Tables[0].Columns[i].AllowDBNull = true; outblk.Tables[0].Columns[i].ColumnName = outblk.Tables[0].Columns[i].ColumnName.ToLower(); } treeListUser.DataSource = outblk.Tables[0]; return outblk; }
private void QryFormGroup(string formName) { EI.EIInfo inblks = new EI.EIInfo(); EI.EIInfo outblks = new EI.EIInfo(); // 设置调用服务的查询条件 inblks.SetColName(1, "fname"); inblks.SetColName(2, "appname"); inblks.SetColName(3, "mode"); inblks.SetColName(4, "buttname"); inblks.SetColName(5, "username"); inblks.SetColName(6, "companycode"); inblks.SetColName(7, "groupname"); inblks.SetColName(8, "adminuser"); inblks.SetColName(9, "loginuser"); inblks.SetColVal(1, 1, "fname", formName); inblks.SetColVal(1, 1, "appname", this.selectedAppname); inblks.SetColVal(1, 1, "mode", 1); inblks.SetColVal(1, 1, "buttname", ""); inblks.SetColVal(1, 1, "username", "XXLoginUserIDXX".Trim()); inblks.SetColVal(1, 1, "companycode", this.selectedCompanyCode); inblks.SetColVal(1, 1, "groupname", fgtGEname.Text); inblks.SetColVal(1, 1, "adminuser", fgtGAdmin.Text); inblks.SetColVal(1, 1, "loginuser", "XXLoginUserIDXX"); // 调用后台服务并将结果赋给Grid控件 outblks = EI.EITuxedo.CallService("epesresgrp_inq", inblks); outblks.blk_now = 0; this.treeListGroup.Nodes.Clear(); string groupName = ""; string groupDesc = ""; string admin1 = ""; string admin2 = ""; string isadmin = outblks.GetColVal(3, 1, "isadmin"); for (int i = 0; i < outblks.blk_info[0].Row; i++) { groupName = outblks.GetColVal(1, i + 1, "name"); groupDesc = outblks.GetColVal(1, i + 1, "groupdescription"); admin1 = outblks.GetColVal(1, i + 1, "adminuserename"); admin2 = outblks.GetColVal(1, i + 1, "adminuserename2"); TreeListNode treeNode = this.treeListGroup.AppendNode(new object[] { groupName, groupDesc, admin1, admin2 }, null, CheckState.Checked); treeNode.Tag = groupName; if (admin1 == "XXLoginUserIDXX" || admin2 == "XXLoginUserIDXX" || isadmin == "1") { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUP_ICON; } else { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUP_GRAY; } } outblks.blk_now = 1; for (int i = 0; i < outblks.blk_info[1].Row; i++) { groupName = outblks.GetColVal(2, i + 1, "name"); groupDesc = outblks.GetColVal(2, i + 1, "groupdescription"); admin1 = outblks.GetColVal(2, i + 1, "adminuserename"); admin2 = outblks.GetColVal(2, i + 1, "adminuserename2"); TreeListNode treeNode = this.treeListGroup.AppendNode(new object[] { groupName, groupDesc, admin1, admin2 }, null, CheckState.Unchecked); treeNode.Tag = groupName; if (admin1 == "XXLoginUserIDXX" || admin2 == "XXLoginUserIDXX" || isadmin == "1") { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUP_ICON; } else { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUP_GRAY; } } }
private void QueryResGroup() { //this.//EFMsgInfo = ""; this.treeListResGroup.Nodes.Clear(); this.treeListResGroup.DataSource = null; EI.EIInfo inblk = new EI.EIInfo(); inblk.AddColName(1, "id"); inblk.AddColName(1, "groupname"); inblk.AddColName(1, "appname"); inblk.AddColName(1, "companycode"); inblk.AddColName(1, "mode"); inblk.AddColName(1, "inodes"); inblk.SetColVal(1, 1, "id", "0"); inblk.SetColVal(1, 1, "appname", this.selectedAppname); inblk.SetColVal(1, 1, "groupname", fgtRGName.Text); inblk.SetColVal(1, 1, "companycode", this.selectedCompanyCode); inblk.SetColVal(1, 1, "inodes", treeListResGroup.Nodes.Count); inblk.SetColVal(1, 1, "mode", 1); EI.EIInfo outblk = EI.EITuxedo.CallService("epesgrgr_inq", inblk); if (outblk.sys_info.flag == 0) { treeListResGroup.DataSource = outblk.Tables[0]; //this.//EFMsgInfo = EP.EPES.EPESC0000156/*操作成功!*/; } /* EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock; inBlock.SetColName(1, "groupname"); inBlock.SetColVal(1, "groupname", ""); inBlock.SetColName(2, "adminuser"); inBlock.SetColName(2, "adminuser"); inBlock.SetColVal(1, "adminuser", ""); inBlock.SetColName(3, "userid"); inBlock.SetColVal(1, "userid", "XXLoginUserIDXX"); inBlock.SetColName(4, "appname"); inBlock.SetColVal(1, "appname", this.selectedAppname); inBlock.SetColName(5, "companycode"); inBlock.SetColVal(1, "companycode", ""); inBlock.SetColName(6, "grouptype"); inBlock.SetColVal(1, "grouptype", 1); //调用SERVICE outBlock = EI.EITuxedo.CallService("epesgroup_inq2", inBlock); for (int i = 0; i < outBlock.Tables[0].Rows.Count; i++) { string resGroupID = outBlock.Tables[0].Rows[i]["ID"].ToString(); string resGroupName = outBlock.Tables[0].Rows[i]["NAME"].ToString(); string resGroupDesc = outBlock.Tables[0].Rows[i]["GROUPDESCRIPTION"].ToString(); TreeListNode node = treeListResGroup.AppendNode(new object[] { resGroupDesc + "[" + resGroupName + "]" }, null); node.Tag = resGroupID; node.ImageIndex = node.SelectImageIndex = RESGROUPICON; } */ treeListResGroup.FocusedNode = null; }
private void QryForms() { treeListForm.Nodes.Clear(); EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock = null; inBlock.SetColName(1, "name"); inBlock.SetColName(2, "cname"); inBlock.SetColName(3, "subjename"); inBlock.SetColName(4, "mode"); inBlock.SetColName(5, "appname"); inBlock.SetColName(6, "companycode"); inBlock.SetColName(7, "not_in_tree"); inBlock.SetColVal(1, "name", fgtFormName.Text); inBlock.SetColVal(1, "cname", fgtFormDesc.Text); inBlock.SetColVal(1, "subjename", "admingroup"); inBlock.SetColVal(1, "mode", 1); inBlock.SetColVal(1, "appname", this.selectedAppname); inBlock.SetColVal(1, "companycode", this.selectedCompanyCode); inBlock.SetColVal(1, "not_in_tree", this.checkNotInTree.Checked ? 1 : 0); outBlock = EI.EITuxedo.CallService("epesformlistinq", inBlock); string formName = "", formDesc = ""; for (int i = 0; i < outBlock.blk_info[0].Row; i++) { formName = outBlock.Tables[0].Rows[i]["NAME"].ToString(); formDesc = outBlock.Tables[0].Rows[i]["DESCRIPTION"].ToString(); TreeListNode tnode = this.treeListForm.AppendNode(new object[] { formDesc , formName}, null); tnode.Tag = formName; tnode.SelectImageIndex = tnode.ImageIndex = FORMICON; } treeListForm.FocusedNode = null; }
private void SaveAuth() { //this.//EFMsgInfo = ""; if (listFormGrant.Count > 0) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; string code = subjEname; int mode = 2; inblk.SetColName(1, "ei_row_num"); inblk.SetColName(2, "name"); inblk.SetColName(3, "cname"); inblk.SetColName(5, "mode"); inblk.SetColName(6, "code"); inblk.SetColName(7, "username"); inblk.SetColName(8, "appname"); inblk.AddNewBlock(); inblk.SetColName(2, 1, "userid"); inblk.SetColName(2, 2, "appname"); for (int i = 0; i < listFormGrant.Count; i++ ) { inblk.SetColVal(1, i+1, "name", listFormGrant[i]); } inblk.SetColVal(1, 5, mode); inblk.SetColVal(1, 6, code); inblk.SetColVal(1, 7, "XXLoginUserIDXX".Trim()); inblk.SetColVal(1, "appname", this.selectedAppname); inblk.SetColVal(2, 1, "userid", "XXLoginUserIDXX"); inblk.SetColVal(2, 1, "appname", this.selectedAppname); outblk = EI.EITuxedo.CallService("epesform_grant", inblk); if (outblk.sys_info.flag == 0) { //this.//EFMsgInfo = string.Format(EP.EPES.EPESC0000118/*成功执行 sqlcode is {0}*/, outblk.sys_info.sqlcode.ToString()); } else { MessageBox.Show(outblk.sys_info.msg, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); } } if (listFormRevok.Count > 0) { EI.EIInfo inblk2 = new EI.EIInfo(); EI.EIInfo outblk2; string code = subjEname; int mode = 2; inblk2.SetColName(2, "name"); inblk2.SetColName(3, "cname"); inblk2.SetColName(5, "mode"); inblk2.SetColName(6, "code"); inblk2.SetColName(7, "username"); inblk2.SetColName(8, "appname"); inblk2.AddNewBlock(); inblk2.SetColName(2, 1, "userid"); inblk2.SetColName(2, 2, "appname"); for (int j = 0; j < listFormRevok.Count; j++ ) { inblk2.SetColVal(1, j+1, "name", listFormRevok[j]); } inblk2.SetColVal(1, 5, mode); inblk2.SetColVal(1, 6, code); inblk2.SetColVal(1, 7, "XXLoginUserIDXX".Trim()); inblk2.SetColVal(1, "appname", this.selectedAppname); inblk2.SetColVal(2, 1, "userid", "XXLoginUserIDXX"); inblk2.SetColVal(2, 1, "appname", this.selectedAppname); outblk2 = EI.EITuxedo.CallService("epesform_revoke", inblk2); if (outblk2.sys_info.flag == 0) { //this.//EFMsgInfo = string.Format(EP.EPES.EPESC0000118/*成功执行 sqlcode is {0}*/, outblk2.sys_info.sqlcode.ToString()); } else { MessageBox.Show(outblk2.sys_info.msg, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); } } if (listButtGrant.Count > 0 || listButtRevok.Count > 0) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; inblk.SetColName(1, "buttname"); inblk.SetColName(2, "formname"); inblk.SetColName(3, "groupname"); inblk.SetColName(4, "mode"); inblk.SetColName(5, "appname"); inblk.SetColName(10, "username"); string buttname = "", formname = ""; int i = 0; for ( i = 0; i < listButtGrant.Count; i++) { int len = listButtGrant[i].Length; buttname = listButtGrant[i].Substring(listButtGrant[i].IndexOf(',')+1, len - listButtGrant[i].IndexOf(',')-1); formname = listButtGrant[i].Substring(0,listButtGrant[i].IndexOf(',')); inblk.SetColVal(1, i + 1, 1, buttname); inblk.SetColVal(1, i + 1, 2, formname); inblk.SetColVal(1, i + 1, 4, 1); } for (int j = i ; j < i + listButtRevok.Count; j++) { int len = listButtRevok[j-i].Length; buttname = listButtRevok[j - i].Substring(listButtRevok[j - i].IndexOf(',') + 1, len - listButtRevok[j - i].IndexOf(',') - 1); formname = listButtRevok[j - i].Substring(0, listButtRevok[j - i].IndexOf(',')); inblk.SetColVal(1, j + 1, 1, buttname); inblk.SetColVal(1, j + 1, 2, formname); inblk.SetColVal(1, j + 1, 4, 0); } inblk.SetColVal(1, 3, subjEname); inblk.SetColVal(1, "appname", this.selectedAppname); inblk.SetColVal(1, "username", "XXLoginUserIDXX"); outblk = EI.EITuxedo.CallService("epesbuttauthupd", inblk); if (outblk.sys_info.flag == 0) { //this.//EFMsgInfo = string.Format(EP.EPES.EPESC0000118/*成功执行 sqlcode is {0}*/, outblk.sys_info.sqlcode.ToString()); } else { MessageBox.Show(outblk.sys_info.msg, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); } } //刷新结果 if (xtraTabControlObj.SelectedTabPage == xtraTabPageList) { RfgreshFormList(); } else if(xtraTabControlObj.SelectedTabPage == xtraTabPageTree) { RfgreshTree(); } listFormGrant.Clear(); listFormRevok.Clear(); listButtGrant.Clear(); listButtRevok.Clear(); SaveOthResAuth(); }
private void QryGroup() { //this.//EFMsgInfo = ""; this.treeListGroup.Nodes.Clear(); EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock; inBlock.SetColName(1, "groupname"); inBlock.SetColVal(1, "groupname", fgtGEname.Text); inBlock.SetColName(2, "adminuser"); inBlock.SetColVal(1, "adminuser", fgtGAdmin.Text); inBlock.SetColName(3, "userid"); inBlock.SetColVal(1, "userid", "XXLoginUserIDXX"); inBlock.SetColName(4, "appname"); inBlock.SetColVal(1, "appname", this.selectedAppname); inBlock.SetColName(5, "companycode"); string comp = EPESCommon.AuthMode == AUTHMODE.MODE_9672 ? "" : this.selectedCompanyCode; inBlock.SetColVal(1, "companycode", comp); inBlock.SetColName(6, "grouptype"); inBlock.SetColVal(1, "grouptype", 0); outBlock = EI.EITuxedo.CallService("epesgroup_inq2", inBlock); treeListGroup.DataSource = outBlock.Tables[0]; }
private bool SaveOthResAuth() { //this.//EFMsgInfo = ""; if (listOthResGrant.Count > 0) { EI.EIInfo inblki = new EI.EIInfo(); EI.EIInfo outblki = new EI.EIInfo(); long type = 0; //设置列名 inblki.SetColName(1, "name"); inblki.SetColName(2, "owner"); inblki.SetColName(3, "ownertype"); inblki.SetColName(4, "type"); inblki.SetColName(5, "appname"); for (int j = 0; j < listOthResGrant.Count; j++) { inblki.SetColVal(1, j + 1, "name", listOthResGrant[j]); inblki.SetColVal(1, j + 1, "owner", this.subjEname); inblki.SetColVal(1, j + 1, "appname",this.selectedAppname); inblki.SetColVal(1, j + 1, "ownertype", 2); if ((!read.Checked) && (!write.Checked) && (!execute.Checked)) { MessageBox.Show(EP.EPES.EPESC0000102/*请给资源分配相应的权限!*/, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; } type = 0; string substr = ""; if (listOthResGrant[j].Length >= 2) substr = listOthResGrant[j].Substring(0, 2); if (substr == "BB" || substr == "BS") { if (execute.Checked) { type = 0 + 1; } if (write.Checked) { type = type + 2; } type = type + 10; inblki.SetColVal(1, j+1, "type", "13"); } else { if (execute.Checked) { type = 0 + 1; } if (write.Checked) { type = type + 2; } type = type + 20; inblki.SetColVal(1, j + 1, "type", "23"); } } outblki = EI.EITuxedo.CallService("epesgroth_ins", inblki); if (outblki.sys_info.flag != 0) { MessageBox.Show(outblki.sys_info.msg, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } } if (listOthResRevok.Count > 0) { EI.EIInfo inblkd = new EI.EIInfo(); EI.EIInfo outblkd = new EI.EIInfo(); //设置列名 inblkd.SetColName(1, "name"); inblkd.SetColName(2, "owner"); inblkd.SetColName(3, "ownertype"); inblkd.SetColName(4, "appname"); for (int j = 0; j < listOthResRevok.Count; j++) { inblkd.SetColVal(1, j + 1, "name", listOthResRevok[j]); inblkd.SetColVal(1, j + 1, "owner", this.subjEname); inblkd.SetColVal(1, j + 1, "appname", this.selectedAppname); inblkd.SetColVal(1, j + 1, "ownertype", 2); } outblkd = EI.EITuxedo.CallService("epesgroth_del", inblkd); if (outblkd.sys_info.flag != 0) { MessageBox.Show(outblkd.sys_info.msg, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } } //刷新结果 QryOthResAuth(); listOthResGrant.Clear(); listOthResRevok.Clear(); return true; }
private void QryGroupInResGroup(string resGroupID) { EI.EIInfo inblk = new EI.EIInfo(); inblk.AddColName(1, "resgroupid"); inblk.AddColName(1, "appname"); inblk.AddColName(1, "companycode"); inblk.AddColName(1, "name"); inblk.AddColName(1, "adminusername"); inblk.AddColName(1, "inodes"); inblk.SetColVal(1, "resgroupid", resGroupID); inblk.SetColVal(1, "appname", this.selectedAppname); string comp = EPESCommon.AuthMode == AUTHMODE.MODE_9672 ? "" : this.selectedCompanyCode; inblk.SetColVal(1, "companycode", comp); inblk.SetColVal(1, "name", fgtGEname.Text); inblk.SetColVal(1, "adminusername", fgtGAdmin.Text); inblk.SetColVal(1, "inodes", treeListGroup.Nodes.Count); EI.EIInfo outblk = EI.EITuxedo.CallService("epesresgr_inq", inblk); if (outblk.sys_info.flag == 0) { Hashtable ht = new Hashtable(); if (treeListGroup.Nodes.Count == 0) { string groupID = "", groupName = "", groupDesc = "", groupAdmin1 = "", groupAdmin2 = ""; for (int i = 0; i < outblk.Tables[0].Rows.Count; i++) { groupID = outblk.Tables[0].Rows[i]["id"].ToString(); groupName = outblk.Tables[0].Rows[i]["name"].ToString(); groupDesc = outblk.Tables[0].Rows[i]["description"].ToString(); groupAdmin1 = outblk.Tables[0].Rows[i]["adminuserename1"].ToString(); groupAdmin2 = outblk.Tables[0].Rows[i]["adminuserename2"].ToString(); TreeListNode node = treeListGroup.AppendNode(new object[] { groupName, groupDesc, groupAdmin1, groupAdmin2, groupID }, null); node.Tag = groupID; } } for (int i = 0; i < outblk.Tables[1].Rows.Count; i++) { ht.Add(outblk.Tables[1].Rows[i]["id"].ToString(), outblk.Tables[1].Rows[i]["name"].ToString()); } foreach (TreeListNode node in treeListGroup.Nodes) { if (node.Level == 0) { node.Checked = ht.ContainsKey(node.Tag.ToString()) ? true : false; } } } else { MessageBox.Show(outblk.sys_info.msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void SaveResToGroup() { //this.//EFMsgInfo = ""; if (objType == OBJTYPE.FORM) { if (listGroupGrant.Count > 0) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; inblk.SetColName(1, "name"); inblk.SetColName(7, "fname"); inblk.SetColName(8, "mode"); inblk.SetColName(9, "buttname"); inblk.SetColName(10, "username"); inblk.SetColName(11, "appname"); for (int i = 0; i < listGroupGrant.Count; i++) { inblk.SetColVal(1, i + 1, "name", listGroupGrant[i]); } inblk.SetColVal(1, 1, "fname", formEname); inblk.SetColVal(1, 1, "mode", 1); //mode==1 新增群组权限 inblk.SetColVal(1, 1, "buttname", ""); inblk.SetColVal(1, 1, "username", "XXLoginUserIDXX".Trim()); inblk.SetColVal(1, 1, "appname", this.selectedAppname); outblk = EI.EITuxedo.CallService("epesresauth_inq", inblk); if (outblk.sys_info.flag != 0) { MessageBox.Show(outblk.sys_info.msg, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); } } if (listGroupRevok.Count > 0) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; inblk.SetColName(1, "name"); inblk.SetColName(7, "fname"); inblk.SetColName(8, "mode"); inblk.SetColName(9, "buttname"); inblk.SetColName(10, "username"); inblk.SetColName(11, "appname"); for (int i = 0; i < listGroupRevok.Count; i++) { inblk.SetColVal(1, i + 1, "name", listGroupRevok[i]); } inblk.SetColVal(1, 1, "fname", formEname); inblk.SetColVal(1, 1, "mode", 2); //mode==2 删除群组权限 inblk.SetColVal(1, 1, "buttname", ""); inblk.SetColVal(1, 1, "username", "XXLoginUserIDXX".Trim()); inblk.SetColVal(1, 1, "appname", this.selectedAppname); outblk = EI.EITuxedo.CallService("epesresauth_inq", inblk); if (outblk.sys_info.flag != 0) { MessageBox.Show(outblk.sys_info.msg, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); } } } else //修改按钮群组权限 { if (listGroupGrant.Count > 0) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; inblk.SetColName(1, "name"); inblk.SetColName(7, "fname"); inblk.SetColName(8, "mode"); inblk.SetColName(9, "buttname"); inblk.SetColName(10, "username"); inblk.SetColName(11, "appname"); for (int i = 0; i < listGroupGrant.Count; i++) { inblk.SetColVal(1, i + 1, "name", listGroupGrant[i]); } inblk.SetColVal(1, 1, "fname", formEname); inblk.SetColVal(1, 1, "mode", 1); inblk.SetColVal(1, 1, "buttname", buttEname); inblk.SetColVal(1, 1, "username", "XXLoginUserIDXX".Trim()); inblk.SetColVal(1, 1, "appname", this.selectedAppname); outblk = EI.EITuxedo.CallService("epesresauth_inq", inblk); if (outblk.sys_info.flag != 0) { MessageBox.Show(outblk.sys_info.msg, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); } } if (listGroupRevok.Count > 0) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; inblk.SetColName(1, "name"); inblk.SetColName(7, "fname"); inblk.SetColName(8, "mode"); inblk.SetColName(9, "buttname"); inblk.SetColName(10, "username"); inblk.SetColName(11, "appname"); for (int i = 0; i < listGroupRevok.Count; i++) { inblk.SetColVal(1, i + 1, "name", listGroupRevok[i]); } inblk.SetColVal(1, 1, "fname", formEname); inblk.SetColVal(1, 1, "mode", 2); inblk.SetColVal(1, 1, "buttname", buttEname); inblk.SetColVal(1, 1, "username", "XXLoginUserIDXX".Trim()); inblk.SetColVal(1, 1, "appname", this.selectedAppname); outblk = EI.EITuxedo.CallService("epesresauth_inq", inblk); if (outblk.sys_info.flag != 0) { MessageBox.Show(outblk.sys_info.msg, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); } else { fgButtonResGroup.Enabled = false; } } } if (objType == OBJTYPE.FORM) { QryFormGroup(formEname); } else { QryButtGroup(formEname, buttEname); } listGroupGrant.Clear(); listGroupRevok.Clear(); fgButtonGroupSave.Enabled = false; }
private void QryOthResAuth() { treeListOthRes.Nodes.Clear(); if (subjEname == string.Empty || subjType == SUBJTYPE.NOAUTHGROUP) { //EFMsgInfo = EP.EPES.EPESC0000101/*选择群组或用户查询其有权限的资源*/; return; } string type = ""; string[] array = comboOthResType.Text.Split('|'); type = array[0]; if (type.Length < 1) { type = "0"; } int mode = -1; if (subjType == SUBJTYPE.USER) mode = 2; else mode = 1; EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk = new EI.EIInfo(); inblk.SetColName(1, "name"); inblk.SetColVal(1, 1, fgtOthName.Text); inblk.SetColName(2, "username"); inblk.SetColVal(1, 2, subjEname); inblk.SetColName(3, "type"); inblk.SetColVal(1, 3, type); inblk.SetColName(4, "appname"); inblk.SetColVal(1, 4, this.selectedAppname); inblk.SetColName(5, "companycode"); inblk.SetColVal(1, 5, this.selectedCompanyCode); inblk.SetColName(6, "mode"); inblk.SetColVal(1, 6, mode); outblk = EI.EITuxedo.CallService("epesothauth_inq", inblk); if (outblk != null) { if (outblk.blk_info[0] != null && outblk.blk_info[1] != null) { string name = ""; string desc = ""; for (int i = 0; i < outblk.blk_info[0].Row; i++) { name = outblk.GetColVal(1, i + 1, "name"); desc = outblk.GetColVal(1, i + 1, "desc"); if (outblk.blk_info[1].colvalue[i, 0] == "0") { TreeListNode tnode = this.treeListOthRes.AppendNode(new object[] { name, desc }, null, CheckState.Unchecked); tnode.Tag = name; } else { TreeListNode tnode = this.treeListOthRes.AppendNode(new object[] { name, desc }, null, CheckState.Checked); tnode.Tag = name; } } treeListOthRes.FocusedNode = null; } } }
private void treeListGroup_DoubleClick(object sender, EventArgs e) { TreeListNode node = treeListGroup.FocusedNode; if (node == null || node.ImageIndex == GROUP_USER) return; if (subjType == SUBJTYPE.NOAUTHGROUP) { // //EFMsgInfo = EP.EPES.EPESC0000087/*您没有该群组的查询权限!*/; return; } node.Nodes.Clear(); treeListGroup.ClearSorting(); EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock; int mode = 2; if (formEname != string.Empty) { if (this.objType == OBJTYPE.BUTTON) mode = 1; else if (this.objType == OBJTYPE.FORM) mode = 0; } inBlock.SetColName(1, "groupname"); inBlock.SetColName(2, "userid"); inBlock.SetColName(3, "formname"); inBlock.SetColName(4, "buttname"); inBlock.SetColName(5, "mode"); inBlock.SetColName(6, "appname"); inBlock.SetColName(7, "companycode"); inBlock.SetColName(8, "loginuser"); inBlock.SetColName(9, "deptename"); inBlock.SetColVal(1, 1, node.GetDisplayText(0)); inBlock.SetColVal(1, 2, "XXLoginUserIDXX"); //资源到群组,带权限查询 if (fgDevCheckEdit2.Checked) { inBlock.SetColVal(1, "formname", this.formEname); inBlock.SetColVal(1, "buttname", this.buttEname); } else { inBlock.SetColVal(1, "formname", ""); inBlock.SetColVal(1, "buttname", ""); } inBlock.SetColVal(1, "mode", mode);//FROM == 0, BUTTON == 1, other == 2 inBlock.SetColVal(1, "appname", this.selectedAppname); string comp = (EPESCommon.AuthMode == AUTHMODE.MODE_9672) ? "" : this.selectedCompanyCode; inBlock.SetColVal(1, "companycode", comp); inBlock.SetColVal(1, "loginuser", "XXLoginUserIDXX"); inBlock.SetColVal(1, "deptename", "ALL"); //调用SERVICE outBlock = EI.EITuxedo.CallService("epessubmem_inq", inBlock); string groupName = "", groupDesc = "", admin1 = "", admin2 = "", groupid = ""; string isadmin = outBlock.GetColVal(4, 1, "isadmin"); int i = 0; for (i = 0; i < outBlock.blk_info[0].Row; i++) { groupName = outBlock.GetColVal(1, i + 1, "name"); groupDesc = outBlock.GetColVal(1, i + 1, "groupdescription"); admin1 = outBlock.GetColVal(1, i + 1, "adminuserename1"); admin2 = outBlock.GetColVal(1, i + 1, "adminuserename2"); groupid = outBlock.GetColVal(1, i + 1, "id"); TreeListNode treeNode; if (outBlock.blk_info[1].colvalue[i, 0] == "0") { treeNode = this.treeListGroup.AppendNode(new object[5], node, CheckState.Unchecked); } else if (outBlock.blk_info[1].colvalue[i, 0] == "cnt") { treeNode = this.treeListGroup.AppendNode(new object[5], node, CheckState.Indeterminate); } else { treeNode = this.treeListGroup.AppendNode(new object[5], node, CheckState.Checked); } node.Nodes[i].SetValue(0, groupName); node.Nodes[i].SetValue(1, groupDesc); node.Nodes[i].SetValue(2, admin1); node.Nodes[i].SetValue(3, admin2); node.Nodes[i].SetValue(4, groupid); treeNode.Tag = groupName; if (admin1 == "XXLoginUserIDXX" || admin2 == "XXLoginUserIDXX" || isadmin == "1") { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUP_ICON; } else { treeNode.ImageIndex = treeNode.SelectImageIndex = GROUP_GRAY; } } string ename = "", cname = "", userid = ""; for (int j = 0; j < outBlock.blk_info[2].Row; j++) { ename = outBlock.GetColVal(3, j + 1, "ename"); cname = outBlock.GetColVal(3, j + 1, "cname"); userid = outBlock.GetColVal(3, j + 1, "id"); TreeListNode treeNode = this.treeListGroup.AppendNode(new object[5], node, CheckState.Indeterminate); node.Nodes[i+j].SetValue(0, ename); node.Nodes[i+j].SetValue(1, cname); node.Nodes[i + j].SetValue(4, userid); treeNode.Tag = ename; treeNode.SelectImageIndex = treeNode.ImageIndex = GROUP_USER; } treeListGroup.FocusedNode.ExpandAll(); }
//Hashtable htResGroup = new Hashtable(); private void QryParentResGroup() { EI.EIInfo inblk = new EI.EIInfo(); inblk.AddColName(1, "id"); inblk.AddColName(1, "groupname"); inblk.AddColName(1, "appname"); inblk.AddColName(1, "companycode"); inblk.AddColName(1, "mode"); inblk.AddColName(1, "inodes"); string groupid = GetSubjID(); if(groupid == string.Empty) return; inblk.SetColVal(1, 1, "id", groupid); inblk.SetColVal(1, 1, "appname", this.selectedAppname); inblk.SetColVal(1, 1, "groupname", fgtRGName.Text); inblk.SetColVal(1, 1, "companycode", comboComp.SelectedItem.ToString().Split(':')[0]); inblk.SetColVal(1, 1, "inodes", treeListResGroup.Nodes.Count); int mode = -1; mode = (subjType == SUBJTYPE.USER) ? 2 : 1; inblk.SetColVal(1, 1, "mode", mode); EI.Logger.Info("begin call service @ "+DateTime.Now.ToString("HH:mm:ss.fff")); EI.EIInfo outblk = EI.EITuxedo.CallService("epesgrgr_inq", inblk); EI.Logger.Info("call service end @ " + DateTime.Now.ToString("HH:mm:ss.fff")); if (outblk.sys_info.flag == 0) { Hashtable ht = new Hashtable(); //htResGroup.Clear(); //treeListResGroup.TopVisibleNodeIndexChanged -= new EventHandler(treeListResGroup_TopVisibleNodeIndexChanged); //treeListResGroup.SizeChanged -= new EventHandler(treeListResGroup_TopVisibleNodeIndexChanged); if (treeListResGroup.Nodes.Count == 0) { treeListResGroup.DataSource = outblk.Tables[0]; } EI.Logger.Info("binding data end @ " + DateTime.Now.ToString("HH:mm:ss.fff")); for (int i = 0; i < outblk.Tables[1].Rows.Count; i++) { ht.Add(outblk.Tables[1].Rows[i]["ID"].ToString(), outblk.Tables[1].Rows[i]["NAME"].ToString()); } EI.Logger.Info("begin to foreach @ " + DateTime.Now.ToString("HH:mm:ss.fff")); foreach (TreeListNode node in treeListResGroup.Nodes) { if (node.Level == 0) { node.Checked = ht.ContainsKey(node.GetValue(treeListColumnRGID)) ? true : false; } } //for (int i = treeListResGroup.; // i < GetNodeNum(); // i++) //{ // treeListResGroup.Nodes[i].Checked = htResGroup.ContainsKey(treeListResGroup.Nodes[i].GetValue(treeListColumnRGID)) ? true : false; //} //treeListResGroup.TopVisibleNodeIndexChanged += new EventHandler(treeListResGroup_TopVisibleNodeIndexChanged); //treeListResGroup.SizeChanged += new EventHandler(treeListResGroup_TopVisibleNodeIndexChanged); EI.Logger.Info("end @ " + DateTime.Now.ToString("HH:mm:ss.fff")); //this.//EFMsgInfo = EP.EPES.EPESC0000156/*操作成功!*/; } else { MessageBox.Show(outblk.sys_info.msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private EI.EIInfo ESOTHER_Get_Resource_ALL() { EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock; inBlock.SetColName(1, "code_class"); inBlock.SetColVal(1, 1, "code_class", "ES03"); outBlock = EI.EITuxedo.CallService("epep01_inq3", inBlock); if (outBlock.GetSys().flag == 0) { return outBlock; } else { MessageBox.Show(EP.EPES.EPESC0000100/*获取资源代码信息错误!*/, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); return null; } }
private void QrySubAuthTree(TreeListNode node) { node.Nodes.Clear(); if (subjEname == string.Empty) return; EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock ; int mode = -1; //user mode if (subjType == SUBJTYPE.USER) mode = 2; //group nested mode else if (subjType == SUBJTYPE.GROUP && EPESCommon.AuthMode == AUTHMODE.MODE_9672) mode = 0; //group mode else mode = 1; inBlock.SetColName(1, "subjename"); inBlock.SetColName(2, "fname"); inBlock.SetColName(3, "mode"); inBlock.SetColName(4, "appname"); inBlock.SetColName(5, "companycode"); inBlock.SetColVal(1, "subjename", subjEname); inBlock.SetColVal(1, "fname", node.Tag.ToString()); inBlock.SetColVal(1, "mode", mode); inBlock.SetColVal(1, "appname", this.selectedAppname); inBlock.SetColVal(1, "companycode", this.selectedCompanyCode); outBlock = EI.EITuxedo.CallService("epessubtree_inq", inBlock); for (int i = 0; i < outBlock.Tables[0].Rows.Count; i++) { string name = outBlock.Tables[0].Rows[i]["NAME"].ToString(); string resname = outBlock.Tables[0].Rows[i]["RESNAME"].ToString(); string description = outBlock.Tables[0].Rows[i]["DESCRIPTION"].ToString(); string cnt = outBlock.Tables[0].Rows[i]["CNT"].ToString(); if (name == "MYFAVORITE") continue; if (resname == "FOLDER") { TreeListNode tnode = this.treeListRes.AppendNode(new object[] { description + "(" + name + ")" }, node, CheckState.Indeterminate); tnode.Tag = name; tnode.SelectImageIndex = tnode.ImageIndex = FOLDERICON; } else { if (cnt == "0") { TreeListNode tnode = this.treeListRes.AppendNode(new object[] { description + "(" + resname + ")" }, node, CheckState.Unchecked); tnode.Tag = resname; tnode.SelectImageIndex = tnode.ImageIndex = FORMICON; } else { TreeListNode tnode = this.treeListRes.AppendNode(new object[] { description + "(" + resname + ")" }, node, CheckState.Checked); tnode.Tag = resname; tnode.SelectImageIndex = tnode.ImageIndex = FORMICON; } } } }
private void QryAuthForm() { if (subjEname == string.Empty || subjType == SUBJTYPE.NOAUTHGROUP) { //EFMsgInfo = EP.EPES.EPESC0000097/*选择群组查询其有权限的资源*/; return; } //if (fgtFormName.Text.Length < 2 && fgtFormDesc.Text.Length < 2) //{ // MessageBox.Show(EP.EPES.EPESC0000098/*请输入至少两位画面名!*/, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; //} EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock = null; int mode = -1; if (subjType == SUBJTYPE.USER) mode = 2; else if (subjType == SUBJTYPE.GROUP && checkEditNested.Checked) mode = 0; else mode = 1; inBlock.SetColName(1, "name"); inBlock.SetColName(2, "cname"); inBlock.SetColName(3, "subjename"); inBlock.SetColName(4, "mode"); inBlock.SetColName(5, "appname"); inBlock.SetColName(6, "companycode"); inBlock.SetColName(7, "not_in_tree"); inBlock.SetColVal(1, "name", fgtFormName.Text); inBlock.SetColVal(1, "cname", fgtFormDesc.Text); inBlock.SetColVal(1, "subjename", subjEname); inBlock.SetColVal(1, "mode", mode); inBlock.SetColVal(1, "appname", this.selectedAppname); inBlock.SetColVal(1, "companycode", this.selectedCompanyCode); inBlock.SetColVal(1, "not_in_tree", this.checkNotInTree.Checked ? 1 : 0); outBlock = EI.EITuxedo.CallService("epesformlistinq", inBlock); string formName = "", formDesc = "", cnt = ""; for (int i = 0; i < outBlock.blk_info[0].Row; i++) { formName = outBlock.Tables[0].Rows[i]["NAME"].ToString(); formDesc = outBlock.Tables[0].Rows[i]["DESCRIPTION"].ToString(); cnt = outBlock.Tables[0].Rows[i]["CNT"].ToString(); if (cnt == "0") { TreeListNode tnode = this.treeListForm.AppendNode(new object[] { formDesc, formName }, null, CheckState.Unchecked); tnode.Tag = formName; tnode.SelectImageIndex = tnode.ImageIndex = FORMICON; } else { TreeListNode tnode = this.treeListForm.AppendNode(new object[] { formDesc, formName }, null, CheckState.Checked); tnode.Tag = formName; tnode.SelectImageIndex = tnode.ImageIndex = FORMICON; } //if (i > 500) //{ // MessageBox.Show(EP.EPES.EPESC0000099/*查询画面数量超出范围,请输入查询条件限制查询结果!*/, EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); // break; //} } treeListForm.FocusedNode = null; }
//查询群组的子组和子用户 private void queryMember(TreeListNode parentNode) { parentNode.Nodes.Clear(); EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock; inBlock.SetColName(1, "groupname"); inBlock.SetColName(2, "userid"); inBlock.SetColName(3, "formname"); inBlock.SetColName(4, "buttname"); inBlock.SetColName(5, "mode"); inBlock.SetColName(6, "appname"); inBlock.SetColName(7, "companycode"); inBlock.SetColName(8, "loginuser"); inBlock.SetColName(9, "deptename"); inBlock.SetColVal(1, 1, ((List<string>)parentNode.Tag)[0]); inBlock.SetColVal(1, 2, "XXLoginUserIDXX"); inBlock.SetColVal(1, "formname", ""); inBlock.SetColVal(1, "buttname", ""); inBlock.SetColVal(1, "mode", 2); inBlock.SetColVal(1, "appname", this.fgDevComboBoxEditApp.EditValue.ToString().Split(':')[0]); inBlock.SetColVal(1, "companycode", this.selectedCompanyCode); inBlock.SetColVal(1, "loginuser", "XXLoginUserIDXX"); inBlock.SetColVal(1, "deptename", this.combDept.EditValue.ToString().Trim().Split(':')[0]); //调用SERVICE outBlock = EI.EITuxedo.CallService("epessubmem_inq", inBlock); if (outBlock.sys_info.flag != 0) { MessageBox.Show(outBlock.sys_info.msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //返回子组 string groupName = ""; string groupDesc = ""; string groupID = ""; string admin1 = ""; string admin2 = ""; string isadmin = outBlock.GetColVal(4, 1, "isadmin"); for (int i = 0; i < outBlock.blk_info[0].Row; i++) { groupName = outBlock.GetColVal(1, i + 1, "name"); groupDesc = outBlock.GetColVal(1, i + 1, "groupdescription"); groupID = outBlock.GetColVal(1, i + 1, "id"); admin1 = outBlock.GetColVal(1, i + 1, "adminuserename1"); admin2 = outBlock.GetColVal(1, i + 1, "adminuserename2"); TreeListNode treeNode = this.treeListMain.AppendNode(new object[] { groupName + "(" + groupDesc + ")", " " }, parentNode); treeNode.Tag = new List<string>(); ((List<string>)treeNode.Tag).Add(groupName); ((List<string>)treeNode.Tag).Add(groupID); if ("XXLoginUserIDXX" == admin1 || "XXLoginUserIDXX" == admin2 || isadmin == "1") { treeNode.SelectImageIndex = treeNode.ImageIndex = GROUPICON; } else { treeNode.SelectImageIndex = treeNode.ImageIndex = GROUPICON_GRAY; } } //返回子用户 string ename = ""; string cname = ""; string userid = ""; string dept = ""; for (int i = 0; i < outBlock.blk_info[2].Row; i++) { ename = outBlock.GetColVal(3, i + 1, "ename"); cname = outBlock.GetColVal(3, i + 1, "cname"); userid = outBlock.GetColVal(3, i + 1, "id"); dept = outBlock.GetColVal(3, i + 1, "dept"); TreeListNode treeNode = this.treeListMain.AppendNode(new object[] { ename + "(" + cname +")", dept }, parentNode); treeNode.Tag = new List<string>(); ((List<string>)treeNode.Tag).Add(ename); ((List<string>)treeNode.Tag).Add(userid); treeNode.SelectImageIndex = treeNode.ImageIndex = USERICON; } }