//查询用户信息 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 FormESSUBJ_Load(object sender, EventArgs e) { this.InitDevGridCustomButtons(); this.fgDevGridGroupInfo.EmbeddedNavigator.ButtonClick += new NavigatorButtonClickEventHandler(GroupInfoEmbeddedNavigator_ButtonClick); this.fgDevGridUserInfo.EmbeddedNavigator.ButtonClick += new NavigatorButtonClickEventHandler(UserInfoEmbeddedNavigator_ButtonClick); this.fgDevGridDeptInfo.EmbeddedNavigator.ButtonClick += new NavigatorButtonClickEventHandler(DeptInfoEmbeddedNavigator_ButtonClick); //查询用户管辖范围内的部门信息 getUserDept(); //获取当前系统中所有的APPNAME信息 RepositoryItemComboBox repstryItemGroupComboBoxApp = new RepositoryItemComboBox(); EI.EIInfo inBlockAPP = new EI.EIInfo(); EI.EIInfo outBlockAPP = new EI.EIInfo(); inBlockAPP.SetColName(1, "ename"); inBlockAPP.SetColVal(1, "ename", ""); outBlockAPP = EI.EITuxedo.CallService("epesappinfo", inBlockAPP); if (outBlockAPP.sys_info.flag != 0) { MessageBox.Show(string.Format(EP.EPES.EPESC0000061/*获取APPNAME信息错误:{0}*/, outBlockAPP.sys_info.msg), EP.EPES.EPESC0000024, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } String stemp = ""; //fgComboBoxApp.Items.Clear(); for (int i = 0; i < outBlockAPP.blk_info[0].Row; i++) { stemp = outBlockAPP.GetColVal(1, i + 1, "ename") + ": " + outBlockAPP.GetColVal(1, i + 1, "cname"); //fgComboBoxApp.Items.Add(stemp); fgDevComboBoxEditApp.Properties.Items.Add(stemp); repstryItemGroupComboBoxApp.Items.Add(outBlockAPP.GetColVal(1, i + 1, "ename")); } gridViewGroupInfo.Columns["APPNAME"].ColumnEdit = repstryItemGroupComboBoxApp; //群组信息的子系统列只允许从下拉列表中选择 repstryItemGroupComboBoxApp.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; if (outBlockAPP.blk_info[0].Row > 0) { //fgComboBoxApp.SelectedIndex = 0; fgDevComboBoxEditApp.SelectedIndex = 0; } //获取帐套信息 InitComboBoxCompany(); //用户信息的是否有效列只允许从下拉列表中选择 repstryItemComboBoxUserIsEnable.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; //用户信息的部门号列只允许从下拉列表中选择 repstryItemComboBoxUserDeptName.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; //设置checkbox选中行样式 DevExpress.Skins.Skin currentSkin; currentSkin = DevExpress.Skins.CommonSkins.GetSkin(DevExpress.LookAndFeel.UserLookAndFeel.Dfgault); Color textColor = currentSkin.Colors.GetColor(DevExpress.Skins.CommonColors.WindowText); Color highlightTextColor = currentSkin.Colors.GetColor(DevExpress.Skins.CommonColors.HighligthText); Color selectColor = currentSkin.Colors.GetColor(DevExpress.Skins.CommonColors.Highlight); StyleFormatCondition cnGroup; cnGroup = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridGroupInfo.SelectionColumn, null, false); cnGroup.ApplyToRow = true; cnGroup.Appearance.BackColor = Color.Empty; cnGroup.Appearance.ForeColor = textColor; gridViewGroupInfo.FormatConditions.Add(cnGroup); cnGroup = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridGroupInfo.SelectionColumn, null, true); cnGroup.ApplyToRow = true; cnGroup.Appearance.BackColor = selectColor; cnGroup.Appearance.ForeColor = highlightTextColor; gridViewGroupInfo.FormatConditions.Add(cnGroup); StyleFormatCondition cnUser; cnUser = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridUserInfo.SelectionColumn, null, false); cnUser.ApplyToRow = true; cnUser.Appearance.BackColor = Color.Empty; cnUser.Appearance.ForeColor = textColor; gridViewUserInfo.FormatConditions.Add(cnUser); cnUser = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridUserInfo.SelectionColumn, null, true); cnUser.ApplyToRow = true; cnUser.Appearance.BackColor = selectColor; cnUser.Appearance.ForeColor = highlightTextColor; gridViewUserInfo.FormatConditions.Add(cnUser); StyleFormatCondition cnDept; cnDept = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridDeptInfo.SelectionColumn, null, false); cnDept.ApplyToRow = true; cnDept.Appearance.BackColor = Color.Empty; cnDept.Appearance.ForeColor = textColor; gridViewDeptInfo.FormatConditions.Add(cnDept); cnDept = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridDeptInfo.SelectionColumn, null, true); cnDept.ApplyToRow = true; cnDept.Appearance.BackColor = selectColor; cnDept.Appearance.ForeColor = highlightTextColor; gridViewDeptInfo.FormatConditions.Add(cnDept); fgDevGridGroupInfo.ShowAddRowButton = false; fgDevGridGroupInfo.ShowAddCopyRowButton = false; fgDevGridGroupInfo.ShowDeleteRowButton = false; fgDevGridGroupInfo.SetAllColumnEditable(false); fgDevGridUserInfo.ShowAddRowButton = false; fgDevGridUserInfo.ShowAddCopyRowButton = false; fgDevGridUserInfo.ShowDeleteRowButton = false; fgDevGridUserInfo.SetAllColumnEditable(false); fgDevGridDeptInfo.ShowAddRowButton = false; fgDevGridDeptInfo.ShowAddCopyRowButton = false; fgDevGridDeptInfo.ShowDeleteRowButton = false; fgDevGridDeptInfo.SetAllColumnEditable(false); fgDevGridUserInfo.SelectionColumn.OptionsColumn.AllowEdit = true; }
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(); }
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(); }
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 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 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 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 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 void queryGroup() { //清除报信栏 //this.//EFMsgInfo = ""; EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock; inBlock.SetColName(1, "groupname"); inBlock.SetColVal(1, "groupname", fgtGroupName.Text); inBlock.SetColName(2, "adminuser"); inBlock.SetColName(2, "adminuser"); inBlock.SetColVal(1, "adminuser", fgtGroupAdmin.Text); inBlock.SetColName(3, "userid"); inBlock.SetColVal(1, "userid", "XXLoginUserIDXX"); inBlock.SetColName(4, "appname"); inBlock.SetColVal(1, "appname", fgDevComboBoxEditApp.EditValue.ToString().Split(':')[0]); inBlock.SetColName(5, "companycode"); inBlock.SetColVal(1, "companycode", this.selectedCompanyCode); inBlock.SetColName(6, "grouptype"); inBlock.SetColVal(1, "grouptype", 0); //调用SERVICE outBlock = EI.EITuxedo.CallService("epesgroup_inq2", inBlock); dataSetEPESSUBJ.TESGROUPINFO.Clear(); outBlock.ConvertToStrongType(dataSetEPESSUBJ); dataSetEPESSUBJ.TESGROUPINFO.AcceptChanges(); gridViewGroupInfo_FocusedRowChanged(null, null); //gridViewGroupInfo.BestFitColumns(); ShowReturnMsg(outBlock); groupSaveStatus = 0; }
//查询群组的子组和子用户 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; } }
//查询部门信息 private void queryDept() { //this.//EFMsgInfo = ""; EI.EIInfo inblku = new EI.EIInfo(); EI.EIInfo outBlock; inblku.SetColName(1, "ename"); inblku.SetColVal(1, 1, fgtDeptEname.Text); inblku.SetColName(2, "cname"); inblku.SetColVal(1, 2, fgtDetpCname.Text); inblku.SetColName(3, "user_name"); inblku.SetColVal(1, 3, "EventArgs.formUserId"); inblku.SetColName(4, "appname"); inblku.SetColVal(1, 4, this.fgDevComboBoxEditApp.EditValue.ToString().Split(':')[0]); outBlock = EI.EITuxedo.CallService("epesdept_inq2", inblku); dataSetEPESSUBJ.TESDEPTINFO.Rows.Clear(); outBlock.ConvertToStrongType(dataSetEPESSUBJ); dataSetEPESSUBJ.TESDEPTINFO.AcceptChanges(); //gridViewDeptInfo.BestFitColumns(); ShowReturnMsg(outBlock); deptSaveStatus = 0; }
//删除群组成员 private void barButtonItemDeleteUser_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { //if (this.treeListMain.FocusedNode == null || this.treeListMain.FocusedNode.ParentNode == null) //{ // return; //} if (treeListMain.Selection.Count == 0) { return; } EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock = new EI.EIInfo(); inBlock.SetColName(1, 1, "groupid"); inBlock.SetColName(1, 2, "user"); inBlock.SetColVal(1, 1, "groupid", ((List<string>)parent.Tag)[1]); inBlock.SetColVal(1, 1, "user", "XXLoginUserIDXX"); //子组 inBlock.AddNewBlock(); inBlock.SetColName(1, "id"); for (int i = 0, j = 1; i < this.treeListMain.Selection.Count; i++) { //子组节点 if (this.treeListMain.Selection[i].ImageIndex == GROUPICON || this.treeListMain.Selection[i].ImageIndex == GROUPICON_GRAY) { inBlock.SetColVal(2, j, "id", ((List<string>)this.treeListMain.Selection[i].Tag)[1]); j++; } } //子用户 inBlock.AddNewBlock(); inBlock.SetColName(1, "id"); for (int i = 0, j = 1; i < this.treeListMain.Selection.Count; i++) { //子用户节点 if (this.treeListMain.Selection[i].ImageIndex == USERICON) { inBlock.SetColVal(3, j, "id", ((List<string>)this.treeListMain.Selection[i].Tag)[1]); j++; } } outBlock = EI.EITuxedo.CallService("epessubmem_del", inBlock); ShowReturnMsg(outBlock); if (outBlock.sys_info.flag == 0) { queryMember(parent); parent = null; } }
//查询权限来源 private void barButtonItemAuthSource_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ES.FormESAUTHSOUR authsour = new ES.FormESAUTHSOUR(); //查询画面资源权限来源 if (xtraTabControlObj.SelectedTabPage == xtraTabPageList) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; inblk.SetColName(1,"subjname"); inblk.SetColName(2, "resname"); inblk.SetColName(3, "mode"); inblk.SetColName(4, "app"); inblk.SetColName(5, "company"); inblk.SetColName(6, "userid"); inblk.SetColName(7, "fname"); //按钮的父画面名 int mode = 0; string fname = ""; //画面 if (treeListForm.FocusedNode.ImageIndex == FORMICON) { mode = 0; } //按钮 else if (treeListForm.FocusedNode.ImageIndex == BUTTICON) { mode = 1; fname = treeListForm.FocusedNode.ParentNode.Tag.ToString(); } inblk.SetColVal(1, 1, "subjname", this.subjEname); inblk.SetColVal(1, 1, "resname", treeListForm.FocusedNode.Tag.ToString()); inblk.SetColVal(1, 1, "mode", mode); inblk.SetColVal(1, 1, "app", this.selectedAppname); inblk.SetColVal(1, 1, "company", this.selectedCompanyCode); inblk.SetColVal(1, 1, "userid", EF_Args.formUserId); inblk.SetColVal(1, 1, "fname", fname); outblk = EI.EITuxedo.CallService("epesauthsourinq",inblk); authsour.result = outblk; authsour.user = this.subjEname; authsour.res = treeListForm.FocusedNode.Tag.ToString(); //authsour.Icon = this.Icon; authsour.ShowDialog(); } //查询菜单树资源权限来源 else if (xtraTabControlObj.SelectedTabPage == xtraTabPageTree) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; inblk.SetColName(1, "subjname"); inblk.SetColName(2, "resname"); inblk.SetColName(3, "mode"); inblk.SetColName(4, "app"); inblk.SetColName(5, "company"); inblk.SetColName(6, "userid"); inblk.SetColName(7, "fname"); //按钮的父画面名 int mode = 0; string fname = ""; //画面 if (treeListRes.FocusedNode.ImageIndex == FORMICON) { mode = 0; } //按钮 else if (treeListRes.FocusedNode.ImageIndex == BUTTICON) { mode = 1; fname = treeListRes.FocusedNode.ParentNode.Tag.ToString(); } inblk.SetColVal(1, 1, "subjname", this.subjEname); inblk.SetColVal(1, 1, "resname", treeListRes.FocusedNode.Tag.ToString()); inblk.SetColVal(1, 1, "mode", mode); inblk.SetColVal(1, 1, "app", this.selectedAppname); inblk.SetColVal(1, 1, "company", this.selectedCompanyCode); inblk.SetColVal(1, 1, "userid", EF_Args.formUserId); inblk.SetColVal(1, 1, "fname", fname); outblk = EI.EITuxedo.CallService("epesauthsourinq", inblk); authsour.result = outblk; authsour.user = this.subjEname; authsour.res = treeListRes.FocusedNode.Tag.ToString(); authsour.ShowDialog(); } //查询细部资源权限来源 else if (xtraTabControlObj.SelectedTabPage == xtraTabPageOtherRes) { EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk; inblk.SetColName(1, "subjname"); inblk.SetColName(2, "resname"); inblk.SetColName(3, "mode"); inblk.SetColName(4, "app"); inblk.SetColName(5, "company"); inblk.SetColName(6, "userid"); inblk.SetColName(7, "fname"); //按钮的父画面名 inblk.SetColVal(1, 1, "subjname", this.subjEname); inblk.SetColVal(1, 1, "resname", treeListOthRes.FocusedNode.Tag.ToString()); inblk.SetColVal(1, 1, "mode", 2); inblk.SetColVal(1, 1, "app", this.selectedAppname); inblk.SetColVal(1, 1, "company", this.selectedCompanyCode); inblk.SetColVal(1, 1, "userid", EF_Args.formUserId); inblk.SetColVal(1, 1, "fname", ""); outblk = EI.EITuxedo.CallService("epesauthsourinq", inblk); authsour.result = outblk; authsour.user = this.subjEname; authsour.res = treeListOthRes.FocusedNode.Tag.ToString(); authsour.ShowDialog(); } }
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 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 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 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 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 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(); }
/// <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); }
//查询用户管辖范围内的部门信息 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 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 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 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; }
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 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 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 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 fgDevGridOth_MouseMove(object sender, MouseEventArgs e) { if (dataSetESOBJ.TESOTHERRESINFO.Rows.Count == 0) { return; } if (e.Button != MouseButtons.Lfgt) return; if (fgDevGridOth.EFChoiceCount == 0 /*getChoiceCount(gridViewOthInfo) == 0*/) { return; } EI.EIInfo inBlock = new EI.EIInfo(); inBlock.SetColName(1, 1, "groupid"); inBlock.SetColName(1, 2, "appname"); inBlock.SetColName(1, 3, "restype"); inBlock.SetColName(1, 4, "groupname"); inBlock.AddNewBlock(); inBlock.SetColName(2, 1, "resid"); inBlock.SetColName(2, 2, "resname"); inBlock.SetColName(2, 3, "fname"); inBlock.SetColName(2, 4, "desc"); inBlock.SetColVal(1, 1, "appname", comboApp.EditValue.ToString().Split(':')[0]); inBlock.SetColVal(1, 1, "restype", "other"); for (int i = 0, j = 1; i < this.gridViewOthInfo.RowCount; i++) { //取出选中行 if (fgDevGridOth.GetSelectedColumnChecked(i)) { inBlock.SetColVal(2, j, "resid", dataSetESOBJ.TESOTHERRESINFO.Rows[i]["ACLID"].ToString()); inBlock.SetColVal(2, j, "resname", dataSetESOBJ.TESOTHERRESINFO.Rows[i]["NAME"].ToString()); inBlock.SetColVal(2, j, "fname", " "); inBlock.SetColVal(2, j, "desc", dataSetESOBJ.TESOTHERRESINFO.Rows[i]["DESCRIPTION"].ToString()); j++; } } dragFromGrid = true; fgDevGridOth.DoDragDrop(inBlock, DragDropEffects.Copy); }