lu
3 天以前 63384af5165b189bfb8c682559e7c7a08d483f0b
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
using DevExpress.XtraEditors;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
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.DevFrm.Rpt
{
    public partial class KQCX : DevExpress.XtraEditors.XtraForm
    {
        string _webServiceName = "MesAttanCon/";
        public KQCX()
        {
            InitializeComponent();
            GetWORKSHOPLINE();
        }
 
        public KQCX(string lineNo,string date)
        {
            InitializeComponent();
            GetWORKSHOPLINE();
            textEdit1.EditValue = lineNo;
            dateEdit1.EditValue = date;
        }
 
        /// <summary>
        ///     选择后的回调事件
        /// </summary>
        public event EventHandler<UpdateParentEventArgs> UpdateParent;
 
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            var list = new List<string>();
            
            list.Add(textEdit1.EditValue?.ToString() ?? "");
            list.Add(dateEdit1.EditValue?.ToString() ?? "");
            
            UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringList = list }); Close();
        }
 
        /// <summary>
        /// 获取下拉框数据
        /// </summary>
        private void GetWORKSHOPLINE()
        {
            try
            {
                string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetWORKSHOPLINE", "");
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    dynamic dy = _rtn.rtnData;
                    JObject _job = JObject.Parse(strJson);
                    JArray array = new JArray();
                    foreach (var a in _job["rtnData"]["list"])
                    {
                        array.Add(a);
                    }
                    DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString());
 
                    this.textEdit1.Properties.ValueMember = "产线";
                    this.textEdit1.Properties.DisplayMember = "产线";
                    this.textEdit1.Properties.DataSource = dt;
                }
                else
                {
                    ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                }
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
    }
}