lu
2025-04-03 47aa4ae2904b057c6ebadfe7f7bf801b9bb64fef
选择字典
已重命名3个文件
已修改2个文件
80 ■■■■ 文件已修改
DevApp/Gs.DevApp/Gs.DevApp.csproj 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DevApp/Gs.DevApp/UserControl/UcDictionary.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DevApp/Gs.DevApp/UserControl/UcDictionarySelect.Designer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs 66 ●●●●● 补丁 | 查看 | 原始文档 | 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>();
                foreach (string key in lstCheckedKeyID)
                {
                list.Add(new
                {
                    dicCode = "001",
                    dicTxt = "test1"
                      //  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