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 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 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 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 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 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 repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { Assembly assembForm; Type type; Object obj = null; MethodInfo EFShow; object[] objects = new object[1]; EF_Args fg_args = new EF_Args(); string dllName = ""; string dllPath = ""; string subSystem = ""; string subPath = ""; string CallMode = ""; string fullName = ""; string formENameBase = ""; string startPath = EC.ProjectConfig.Instance.EPDirectory + "\\..\\"; //this.EFMsgInfo = ""; if (this.formName != string.Empty) { subSystem = this.formName.Substring(0, 2); } else { //this.EFMsgInfo = "FormName is empty"; return; } if ((subSystem.Substring(0, 1) == "E") && subSystem != "EM") { subPath = "EP"; } else { subPath = subSystem; } //获取dllname EI.EIInfo inblk = new EI.EIInfo(); EI.EIInfo outblk = new EI.EIInfo(); inblk.SetColName(1, "name"); inblk.SetColName(3, "mode"); inblk.SetColName(4, "appname"); inblk.SetColVal(1, 1, 1, this.formName); inblk.SetColVal(1, 1, 3, 0); inblk.SetColVal(1, 1, "appname", comboApp.EditValue.ToString().Split(':')[0]); outblk = EI.EITuxedo.CallService("epesformactual", inblk); if (outblk.sys_info.flag < 0 /*|| outblk.GetColVal(1, "dllname") == string.Empty*/) { //this.EFMsgInfo = string.Format(EP.EPES.EPESC0000045/*获取画面{0}的dllname失败*/, formName); return; } else { dllName = outblk.GetColVal(1, "dllname"); CallMode = outblk.GetColVal(1, "form_call_mode"); } dllPath = startPath + subPath + "\\" + dllName; if (CallMode == "1" || CallMode == "9") { formENameBase = outblk[1][0, "form_base_name"]; fullName = subSystem + ".Form" + formENameBase; } else { fullName = subSystem + ".Form" + formName; } //生成画面实例 try { assembForm = Assembly.LoadFrom(dllPath); type = assembForm.GetType(fullName); obj = Activator.CreateInstance(type); } catch { //this.EFMsgInfo = string.Format(EP.EPES.EPESC0000046/*{0}载入失败*/, dllPath); if (obj != null) ((DevExpress.XtraEditors.XtraForm)obj).Close(); return; } //为授权按钮加标签 this.SetControls(obj); ((System.Windows.Forms.Form)obj).Text = EP.EPES.EPESC0000123/*按钮展示*/; EFShow = type.GetMethod("EFShow"); fg_args.formEName = "BUTTONTIPS"; fg_args.eventId = "START_FORM_BY_EF"; fg_args.formDllName = dllName; fg_args.formDllPath = dllPath; fg_args.formCName = EP.EPES.EPESC0000124/*按钮提示*/; objects[0] = fg_args; EFShow.Invoke(obj, objects); }
private void FormESOBJ_Load(object sender, EventArgs e) { InitCompany(); InitDevGridCustomButtons(); InitOthType(this.GetResType()); if (EPESCommon.AuthMode == AUTHMODE.MODE_CLASSIC) { this.xtraTabPageResGroup.PageVisible = false; this.chkAuth.Visible = false; this.chkOth.Visible = false; } //按钮操作模式 DataTable dt = new DataTable(); dt.Columns.Add("value").Caption = " "; dt.Columns.Add("desc").Caption = EP.EPES.EPESC0000030/*操作模式*/; dt.Rows.Add("A", EP.EPES.EPESC0000058/*单步操作*/); dt.Rows.Add("B", EP.EPES.EPESC0000032/*多步操作*/); RepositoryItemLookUpEdit repositoryItemLookUpEdit = new RepositoryItemLookUpEdit(); //RepositoryItemComboBox repositoryItemComboBox = new RepositoryItemComboBox(); if (repositoryItemLookUpEdit != null) { repositoryItemLookUpEdit.DataSource = dt; repositoryItemLookUpEdit.DisplayMember = "desc"; repositoryItemLookUpEdit.ValueMember = "value"; gridViewButtInfo.Columns["OPTYPE"].ColumnEdit = repositoryItemLookUpEdit; } this.fgDevGridFormInfo.EmbeddedNavigator.ButtonClick += new NavigatorButtonClickEventHandler(FormInfoEmbeddedNavigator_ButtonClick); this.fgDevGridButtInfo.EmbeddedNavigator.ButtonClick += new NavigatorButtonClickEventHandler(ButtInfoEmbeddedNavigator_ButtonClick); this.fgDevGridOth.EmbeddedNavigator.ButtonClick += new NavigatorButtonClickEventHandler(OthEmbeddedNavigator_ButtonClick); //获取当前系统中所有的APPNAME信息 EI.EIInfo inBlockAPP = new EI.EIInfo(); EI.EIInfo outBlockAPP = new EI.EIInfo(); RepositoryItemComboBox repositoryItemComboBox = new RepositoryItemComboBox(); 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)); return; } string stemp = ""; for (int i = 0; i < outBlockAPP.blk_info[0].Row; i++) { stemp = outBlockAPP.GetColVal(1, i + 1, "ename") + ": " + outBlockAPP.GetColVal(1, i + 1, "cname"); comboApp.Properties.Items.Add(stemp); repositoryItemComboBox.Items.Add(outBlockAPP.GetColVal(1, i + 1, "ename")); } gridViewFormInfo.Columns["APPNAME"].ColumnEdit = repositoryItemComboBox; repositoryItemComboBox.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; if (outBlockAPP.blk_info[0].Row > 0) { comboApp.SelectedIndex = 0; } //设置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 cnForm; cnForm = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridFormInfo.SelectionColumn, null, false); cnForm.ApplyToRow = true; cnForm.Appearance.BackColor = Color.Empty; cnForm.Appearance.ForeColor = textColor; gridViewFormInfo.FormatConditions.Add(cnForm); cnForm = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridFormInfo.SelectionColumn, null, true); cnForm.ApplyToRow = true; cnForm.Appearance.BackColor = selectColor; cnForm.Appearance.ForeColor = highlightTextColor; gridViewFormInfo.FormatConditions.Add(cnForm); StyleFormatCondition cnBtn; cnBtn = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridButtInfo.SelectionColumn, null, false); cnBtn.ApplyToRow = true; cnBtn.Appearance.BackColor = Color.Empty; cnBtn.Appearance.ForeColor = textColor; gridViewButtInfo.FormatConditions.Add(cnBtn); cnBtn = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridButtInfo.SelectionColumn, null, true); cnBtn.ApplyToRow = true; cnBtn.Appearance.BackColor = selectColor; cnBtn.Appearance.ForeColor = highlightTextColor; gridViewButtInfo.FormatConditions.Add(cnBtn); StyleFormatCondition cnOth; cnOth = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridOth.SelectionColumn, null, false); cnOth.ApplyToRow = true; cnOth.Appearance.BackColor = Color.Empty; cnOth.Appearance.ForeColor = textColor; gridViewOthInfo.FormatConditions.Add(cnOth); cnOth = new StyleFormatCondition(FormatConditionEnum.Equal, fgDevGridOth.SelectionColumn, null, true); cnOth.ApplyToRow = true; cnOth.Appearance.BackColor = selectColor; cnOth.Appearance.ForeColor = highlightTextColor; gridViewOthInfo.FormatConditions.Add(cnOth); fgDevGridButtInfo.SetAllColumnEditable(false); fgDevGridFormInfo.SetAllColumnEditable(false); fgDevGridOth.SetAllColumnEditable(false); fgDevGridFormInfo.SelectionColumn.OptionsColumn.AllowEdit = true; fgDevGridButtInfo.SelectionColumn.OptionsColumn.AllowEdit = true; fgDevGridOth.SelectionColumn.OptionsColumn.AllowEdit = true; }