lu
2025-04-22 a104f064a400c10e66514d26f946189b7a4521aa
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using DevExpress.Data.ExpressionEditor;
using DevExpress.XtraEditors;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace Gs.DevApp.UserControl
{
    public partial class UcDictionaryComBox : DevExpress.XtraEditors.XtraUserControl
    {
        public UcDictionaryComBox()
        {
            InitializeComponent();
        }
 
        /// <summary>
        /// 文本框文字
        /// </summary>
        public string TextTxt
        {
            get { return txt_qt003.Text.Trim(); }
            set
            {
                this.txt_qt003.Text = value;
            }
        }
 
        /// <summary>
        /// 查询条件
        /// </summary>
        /// 
        string _WhereTxt;
        public string WhereTxt
        {
            get { return _WhereTxt; }
            set
            {
                this._WhereTxt = value;
                if (!string.IsNullOrEmpty(value)) {
                    getSuppler(value);
                }
            }
        }
 
        public bool IsReadly
        {
            set
            {
                this.txt_qt003.ReadOnly = value;
                this.txt_qt003.Enabled = !value;
            }
        }
 
        /// <summary>
        /// 读取仓库
        /// </summary>
        /// <param name="orgId"></param>
        /// <param name="_dftVale"></param>
        public void getSuppler(string strWhere)
        {
            txt_qt003.Properties.Items.Clear();
            string _where = " and 1=1 and " + strWhere;
            var pgq = new PageQueryModel(1, 999999, "a.defect_name", "asc", "", _where);
            var json = JsonConvert.SerializeObject(pgq);
            try
            {
                var strReturn =
                    UtilityHelper.HttpPost("", "MesDefectCodeManager/GetListPage", json);
                var dd = UtilityHelper.ReturnToTablePage(strReturn);
                var dt = dd.rtnData.list;
                foreach (DataRow row in dt.Rows) {
                    txt_qt003.Properties.Items.Add(row["defectName"].ToString());
                }
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
    }
}