DevApp/Gs.DevApp/Gs.DevApp.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/UserControl/UcDictionary.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/UserControl/UcDictionarySelect.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/UserControl/UcDictionarySelect.resx | 补丁 | 查看 | 原始文档 | blame | 历史 |
DevApp/Gs.DevApp/Gs.DevApp.csproj
@@ -743,11 +743,11 @@ <Compile Include="DevFrm\Work\Frm_WorkTechnique.Designer.cs"> <DependentUpon>Frm_WorkTechnique.cs</DependentUpon> </Compile> <Compile Include="DevFrm\Work\SelectDictionary.cs"> <Compile Include="UserControl\UcDictionarySelect.cs"> <SubType>Form</SubType> </Compile> <Compile Include="DevFrm\Work\SelectDictionary.Designer.cs"> <DependentUpon>SelectDictionary.cs</DependentUpon> <Compile Include="UserControl\UcDictionarySelect.Designer.cs"> <DependentUpon>UcDictionarySelect.cs</DependentUpon> </Compile> <Compile Include="DevFrm\Work\SelectProcess.cs"> <SubType>Form</SubType> @@ -1408,8 +1408,8 @@ <EmbeddedResource Include="DevFrm\Work\Frm_WorkTechnique.resx"> <DependentUpon>Frm_WorkTechnique.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="DevFrm\Work\SelectDictionary.resx"> <DependentUpon>SelectDictionary.cs</DependentUpon> <EmbeddedResource Include="UserControl\UcDictionarySelect.resx"> <DependentUpon>UcDictionarySelect.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="DevFrm\Work\SelectProcess.resx"> <DependentUpon>SelectProcess.cs</DependentUpon> DevApp/Gs.DevApp/UserControl/UcDictionary.cs
@@ -48,7 +48,7 @@ private void simpleButton1_Click(object sender, EventArgs e) { SelectDictionary frm = new SelectDictionary(this.BtnTxt, ""); UcDictionarySelect frm = new UcDictionarySelect(this.BtnTxt, ""); frm.UpdateParent += (ss, ee) => { System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); DevApp/Gs.DevApp/UserControl/UcDictionarySelect.Designer.cs
ÎļþÃû´Ó DevApp/Gs.DevApp/DevFrm/Work/SelectDictionary.Designer.cs ÐÞ¸Ä @@ -1,6 +1,6 @@ namespace Gs.DevApp.DevFrm.Work { partial class SelectDictionary partial class UcDictionarySelect { /// <summary> /// Required designer variable. DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs
ÎļþÃû´Ó DevApp/Gs.DevApp/DevFrm/Work/SelectDictionary.cs ÐÞ¸Ä @@ -1,19 +1,23 @@ using DevExpress.XtraEditors; using DevExpress.XtraTreeList; using DevExpress.XtraTreeList; using DevExpress.XtraTreeList.Nodes; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Data; using System.Text; using System.Windows.Forms; namespace Gs.DevApp.DevFrm.Work { public partial class SelectDictionary : DevExpress.XtraEditors.XtraForm public partial class UcDictionarySelect : DevExpress.XtraEditors.XtraForm { private List<string> lstCheckedKeyID = new List<string>();//éæ©å±IDéå string strTitle = ""; string strWhere = ""; public SelectDictionary(string _strTitle, string _strWhere) public UcDictionarySelect(string _strTitle, string _strWhere) { InitializeComponent(); tlMenu.CustomDrawNodeCheckBox += TreeList1_CustomDrawNodeCheckBox; @@ -27,12 +31,16 @@ this.Text = _strTitle; btnIn.Click += (s, e) => { findOrigin(tlMenu); var list = new List<dynamic>(); list.Add(new foreach (string key in lstCheckedKeyID) { dicCode = "001", dicTxt = "test1" }); list.Add(new { // dicCode = "001", dicTxt = key }); }; UpdateParent?.Invoke(this, new UpdateParentEventArgs { DynamicList = list }); Close(); @@ -100,5 +108,51 @@ MsgHelper.Warning("æç¤ºï¼" + ex.Message); } } #region MyRegion /// <summary> /// è·åéæ©ç¶æçæ°æ®ä¸»é®IDéå /// </summary> /// <param name="parentNode">ç¶çº§èç¹</param> private void GetCheckedKeyID(TreeListNode parentNode) { if (parentNode.Nodes.Count == 0) { return;//éå½ç»æ¢ } foreach (TreeListNode node in parentNode.Nodes) { if (node.CheckState == CheckState.Checked) { DataRowView drv = tlMenu.GetDataRecordByNode(node) as DataRowView;//å ³é®ä»£ç ï¼å°±æ¯ä¸ç¥éæ¯è¿æ ·è·åæ°æ®èçº ç»äºå¾ä¹ (鬼ç¥éå¯ä»¥è½¬æ¢ä¸ºDataRowViewå) if (drv != null) { string KeyFieldName = (string)drv["defectName"]; lstCheckedKeyID.Add(KeyFieldName); } } GetCheckedKeyID(node); } } /// <summary> /// è·åéä¸çèç¹ /// </summary> /// <param name="tree"></param> private void findOrigin(DevExpress.XtraTreeList.TreeList tree) { this.lstCheckedKeyID.Clear(); if (tree.Nodes.Count > 0) { foreach (TreeListNode root in tree.Nodes) { GetCheckedKeyID(root); } } } #endregion } } DevApp/Gs.DevApp/UserControl/UcDictionarySelect.resx