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(); }
/// <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; } }
/// <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); } }
//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 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 InitUserPassword() { //this.//EFMsgInfo = ""; if (fgDevGridUserInfo.EFChoiceCount < 1) { //this.//EFMsgInfo = EP.EPES.EPESC0000114/* "未选中行!*/; return; } EI.EIInfo inblku = new EI.EIInfo(); EI.EIInfo outblku = new EI.EIInfo(); inblku.AddColName(1, "ename"); inblku.AddNewBlock(); inblku.AddColName(2, "loginname"); inblku.AddColName(2, "appname"); inblku.SetColVal(2, 1, "loginname", "EventArgs.formUserId"); inblku.SetColVal(2, 1, "appname", "EventArgs.epEname"); for (int i = 0, j = 1; i < this.gridViewUserInfo.RowCount; i++) { //取出选中行 if (fgDevGridUserInfo.GetSelectedColumnChecked(i)) { inblku.SetColVal(1, j, "ename", this.gridViewUserInfo.GetRowCellValue(i, "ENAME").ToString()); j++; } } outblku = EI.EITuxedo.CallService("epesuserpw_ini", inblku); ShowReturnMsg(outblku); if (outblku.sys_info.flag == 0) { MessageBox.Show(EP.EPES.EPESC0000115/*初始化密码成功*/, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); //UnCheckAll(gridViewUserInfo, colselected1); QueryUser(); } //else if (outblku.sys_info.flag < 0) //{ // MessageBox.Show(outblku.sys_info.msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); //} }
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 RemoveResFromGroup(TreeListNode pNode) { string resID = ""; string resName = ""; string resGroupID = pNode.GetValue(treeListColumnRGID).ToString(); string resGroupName = pNode.GetValue(treeListColumnRGName).ToString(); EI.EIInfo inblk = new EI.EIInfo(); inblk.AddColName(1, "resid"); inblk.AddColName(1, "groupid"); inblk.AddColName(1, "appname"); inblk.AddColName(1, "groupname"); inblk.AddColName(1, "resname"); for (int i = 0, rowIndex = 0; i < pNode.Nodes.Count; i++) { if (!pNode.Nodes[i].Selected) continue; resID = pNode.Nodes[i].GetValue(treeListColumnRGID).ToString(); resName = pNode.Nodes[i].GetValue(treeListColumnRGName).ToString(); inblk.SetColVal(1, rowIndex + 1, "resid", resID); inblk.SetColVal(1, rowIndex + 1, "groupid", resGroupID); inblk.SetColVal(1, rowIndex + 1, "appname", comboApp.EditValue.ToString().Split(':')[0]); inblk.SetColVal(1, rowIndex + 1, "groupname", resGroupName); inblk.SetColVal(1, rowIndex + 1, "resname", resName); rowIndex++; } EI.EIInfo outblk = EI.EITuxedo.CallService("epesres_del", inblk); if (outblk.sys_info.flag == 0) { //MessageBox.Show("操作成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); //this.EFMsgInfo = EP.EPES.EPESC0000156/*操作成功!*/; //treeListResGroup.FocusedNode = treeListResGroup.FocusedNode.ParentNode; treeListResGroup.DeleteSelectedNodes(); //QueryResInGroup(treeListResGroup.FocusedNode); } else { MessageBox.Show(outblk.sys_info.msg, EP.EPES.EPESC0000024/*提示*/, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void QueryResInGroup(TreeListNode parentNode) { parentNode.Nodes.Clear(); if (parentNode.GetValue(treeListColumnRGID) == null) return; EI.EIInfo inblk = new EI.EIInfo(); inblk.AddColName(1, "groupid"); inblk.AddColName(1, "appname"); inblk.SetColVal(1, 1, "groupid", parentNode.GetValue(treeListColumnRGID).ToString()); inblk.SetColVal(1, 1, "appname", comboApp.EditValue.ToString().Split(':')[0]); EI.EIInfo outblk = EI.EITuxedo.CallService("epesres_inq", inblk); if (outblk.sys_info.flag < 0) { MessageBox.Show(outblk.sys_info.msg, EP.EPES.EPESC0000024/*提示*/, 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], parentNode); node.SetValue(treeListColumnRGName, name + "[" + description + "]"); node.SetValue(treeListColumnRGID, 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; } } } }
private void QueryResGroup() { //this.EFMsgInfo = ""; this.treeListResGroup.Nodes.Clear(); 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", comboApp.EditValue.ToString().Split(':')[0]); inblk.SetColVal(1, 1, "groupname", fgtResGroup.Text); inblk.SetColVal(1, 1, "companycode", this.comboComp.EditValue.ToString().Split(':')[0]); inblk.SetColVal(1, 1, "inodes", 0); inblk.SetColVal(1, 1, "mode", 0); EI.Logger.Error("begin call service epesgrgr_inq"); EI.EIInfo outblk = EI.EITuxedo.CallService("epesgrgr_inq", inblk); EI.Logger.Error("end call service, begin binding"); if (outblk.sys_info.flag == 0) { //treeListResGroup.DataSource = outblk.Tables[0]; //outblk.Tables[0].TableName = "TESRESGROUP"; treeListResGroup.DataSource = outblk.Tables[0]; //dataSetESOBJ.TESRESGROUP.Clear(); //outblk.ConvertToStrongType(dataSetESOBJ); //dataSetESOBJ.TESRESGROUP.AcceptChanges(); } EI.Logger.Error("binding end"); //treeListResGroup.FocusedNode = null; }
/// <summary> /// 双击资源高亮所属的资源组 /// </summary> /// <param name="resID"></param> private void QryResInWhichGroup(string resNAME, string resID) { EI.EIInfo inblk = new EI.EIInfo(); inblk.AddColName(1, "resid"); inblk.AddColName(1, "appname"); inblk.AddColName(1, "companycode"); string companyCode = this.comboComp.EditValue.ToString().Split(':')[0]; string company = "["+this.comboComp.EditValue.ToString()+"]"; inblk.SetColVal(1, 1, "resid", resID); inblk.SetColVal(1, 1, "appname", comboApp.EditValue.ToString().Split(':')[0]); inblk.SetColVal(1, 1, "companycode", companyCode); EI.EIInfo outblk = EI.EITuxedo.CallService("epesresin_inq", inblk); if (outblk.sys_info.flag == 0) { if (outblk.Tables[0].Rows.Count == 0) { string msgNoGroup = string.Format(EP.EPES.EPESC0000185/*在账套{0}下,资源{1}未分配到任何资源组*/, company, resNAME); MessageBox.Show(msgNoGroup, EP.EPES.EPESC0000024/*提示*/, MessageBoxButtons.OK, MessageBoxIcon.Information); //this.EFMsgInfo = msgNoGroup; return; } string id = outblk.Tables[0].Rows[0]["id"].ToString(); string name = outblk.Tables[0].Rows[0]["name"].ToString(); string desc = outblk.Tables[0].Rows[0]["description"].ToString(); string resGroup = string.Format("{0}[{1}]", desc, name); string msgGroup = string.Format(EP.EPES.EPESC0000186/*在账套{0}下,资源{1}已经分配到资源组: {2}*/, company, resNAME, resGroup); MessageBox.Show(msgGroup, EP.EPES.EPESC0000024/*提示*/, MessageBoxButtons.OK, MessageBoxIcon.Information); //this.EFMsgInfo = msgGroup; //foreach (TreeListNode node in treeListResGroup.Nodes) //{ // if (node.Level == 0) // { // if (node.GetValue(treeListColumnRGID).ToString() == id) // { // treeListResGroup.FocusedNode = node; // break; // } // } //} } else { MessageBox.Show(outblk.sys_info.msg, EP.EPES.EPESC0000024/*提示*/, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// 细部资源导出 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FormEPESOBJ_EF_DO_FB(object sender, EF_Args e) { DataSet ds = new DataSet(); ds.Tables.Clear(); ds.Tables.Add(dataSetESOBJ.TESOTHERRESINFO.Clone()); ds.Tables.Add(dataSetESOBJ.TESOTHERRESINFO_RES.Clone()); DataRelation dr = new DataRelation("TESOTHERRESINFO_TESOTHERRESINFO_RES", new DataColumn[] { ds.Tables[0].Columns["ACLID"] }, new DataColumn[] { ds.Tables[1].Columns["ACLID"] }); ds.Relations.Add(dr); EI.EIInfo inBlk = new EI.EIInfo(); inBlk.AddColName("NAME"); int j = 1; for (int i = 0; i < this.gridViewOthInfo.RowCount; i++) { if (this.fgDevGridOth.GetSelectedColumnChecked(i)) { string name = gridViewOthInfo.GetRowCellValue(i, "NAME").ToString(); if (name != null) { inBlk.SetColVal(1, j++, "NAME", name); } } } Utility.ExportData(inBlk, "epesother_exp", ds); }