From bd06bb837fa0c7edeeae56cb0fe4fb844f53fb2f Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期三, 23 十月 2024 16:42:34 +0800 Subject: [PATCH] 修改了报表设计器 --- DevApp/Gs.DevApp/DevFrm/Sys/Organization.cs | 58 +++++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 41 insertions(+), 17 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Sys/Organization.cs b/DevApp/Gs.DevApp/DevFrm/Sys/Organization.cs index f610075..55ceaab 100644 --- a/DevApp/Gs.DevApp/DevFrm/Sys/Organization.cs +++ b/DevApp/Gs.DevApp/DevFrm/Sys/Organization.cs @@ -2,6 +2,7 @@ using Gs.DevApp.ToolBox; using Newtonsoft.Json; using System; +using System.Collections.Generic; using System.Data; using System.Windows.Forms; @@ -18,10 +19,11 @@ this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; + this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; + this.toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; tlMenu.DoubleClick += TlMenu_DoubleClick; getTree(); } - private void TlMenu_DoubleClick(object sender, EventArgs e) { TreeNode clickedNode = tlMenu.SelectedNode; @@ -30,6 +32,31 @@ string rowGuid = clickedNode.Name.ToString(); getModel(rowGuid, false, 999); } + } + /// <summary> + /// 鍙嶅鏍� + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + /// <exception cref="NotImplementedException"></exception> + private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) + { + this.toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_name, tlMenu); + this.toolBarMenu1.guidKey = rowGuid; + } + /// <summary> + /// 瀹℃牳浜嬩欢 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) + { + this.toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_name, tlMenu); + this.toolBarMenu1.guidKey = rowGuid; } /// <summary> /// 鍙栨秷浜嬩欢 @@ -59,15 +86,18 @@ { return; } - var _obj = new - { - guid = rowGuid,//涓诲缓 - }; + List<string> lst = new List<string>(); + lst.Add(rowGuid); + var _obj = lst; try { string strJson = UtilityHelper.HttpPost("", "Organization/DeleteModel", JsonConvert.SerializeObject(_obj)); ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); - if (_rtn.rtnCode > 0) { getTree(); } + if (_rtn.rtnCode > 0) + { + UtilityHelper.JumpToTab(xtraTabControl1, 0); + getTree(); + } ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } catch (Exception ex) @@ -124,7 +154,7 @@ toolBarMenu1.isSetBtn = false; if (string.IsNullOrEmpty(txt_factory.Text.Trim())) { - Gs.DevApp.ToolBox.MsgHelper.Warning("鍚嶇О涓嶈兘涓虹┖锛�"); + Gs.DevApp.ToolBox.MsgHelper.Warning("缂栧彿涓嶈兘涓虹┖锛�"); txt_factory.Focus(); return; } @@ -146,12 +176,7 @@ txt_conTel.Focus(); return; } - if (txt_isStatus.SelectedIndex <= 0) - { - Gs.DevApp.ToolBox.MsgHelper.Warning("鐘舵�佷笉鑳戒负绌猴紒"); - txt_isStatus.Focus(); - return; - } + string _upGuid = txt_upGuid.Text.Trim().Length > 0 ? txt_upGuid.SelectedValue.ToString() : ""; var _obj = new { @@ -160,7 +185,7 @@ name = txt_name.Text.Trim(),//鍚嶇О conPeople = txt_conPeople.Text,//鑱旂郴浜� conTel = txt_conPeople.Text,//鑱旂郴鐢佃瘽 - isStatus = txt_isStatus.SelectedIndex,//鐘舵�� + isStatus = txt_isStatus.Checked,//鐘舵�� factory = txt_factory.Text,//缁勭粐缂栧彿 }; try @@ -203,14 +228,14 @@ { dtComList.Rows.Add(_dy["guid"].ToString(), _dy["name"].ToString()); TreeNode node = new TreeNode();//瀹氫箟缁撶偣 - node.Text = _dy["name"].ToString();//涓虹粨鐐硅祴鍊� + node.Text = "(" + _dy["factory"].ToString() + ")" + _dy["name"].ToString();//涓虹粨鐐硅祴鍊� node.Name = _dy["guid"].ToString(); node.ImageIndex = 0; DataRow[] drItem = dt.Select("upGuid='" + _dy["guid"].ToString() + "'"); foreach (DataRow _dy2 in drItem) { TreeNode node22 = new TreeNode();//瀹氫箟缁撶偣 - node22.Text = _dy2["name"].ToString();//涓虹粨鐐硅祴鍊� + node22.Text = "(" + _dy2["factory"].ToString() + ")" + _dy2["name"].ToString();//涓虹粨鐐硅祴鍊� node22.Name = _dy2["guid"].ToString(); node22.ImageIndex = 1; node.Nodes.Add(node22); @@ -227,7 +252,6 @@ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } - private void getModel(string strGuid, bool isEdit, int tabIdx) { if (string.IsNullOrEmpty(strGuid)) -- Gitblit v1.9.3