lu
2025-04-06 4a8df7e654aa502694bcff271b216c46e26c788b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using Gs.DevApp.DevFrm.Work;
using System;
 
 
namespace Gs.DevApp.UserControl
{
    public partial class UcDictionary : DevExpress.XtraEditors.XtraUserControl
    {
        public UcDictionary()
        {
            InitializeComponent();
        }
 
        /// <summary>
        /// 按钮文字
        /// </summary>
        public string BtnTxt
        {
            get { return this.simpleButton1.Text.Trim(); }
            set
            {
                this.simpleButton1.Text = value;
            }
        }
 
        /// <summary>
        /// 文本框文字
        /// </summary>
        public string TextTxt
        {
            get { return memoEdit1.Text.Trim(); }
            set
            {
                this.memoEdit1.Text = value;
            }
        }
 
        /// <summary>
        /// 查询条件
        /// </summary>
        public string WhereTxt
        {
            get;
            set;
        }
        public bool IsReadly
        {
            set
            {
                this.memoEdit1.ReadOnly = value;
                this.simpleButton1.Enabled = !value;
            }
        }
 
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            UcDictionarySelect frm = new UcDictionarySelect(this.BtnTxt, this.WhereTxt);
            frm.UpdateParent += (ss, ee) =>
            {
                System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
                var lst = ee.DynamicList;
                foreach (dynamic dym in lst)
                {
                    if (stringBuilder.Length > 0)
                        stringBuilder.Append("|");
                    stringBuilder.Append(dym.dicTxt);
                }
                this.TextTxt = stringBuilder.ToString();
            };
            frm.ShowDialog();
        }
    }
}