kingno
5 天以前 e41fb4bea3afa879caaf6c9f316f01bacf262545
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
using Bro.Common.Helper;
using Bro.UI.Model.Winform;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace Bro.M141.Process
{
    [MenuNode("篮具码界面", "篮具码界面", 2, EnumHelper.TopMenu.SystemInfo, MenuNodeType.Form)]
    public partial class BasketCodeUI : MenuFormBase
    {
        public BasketCodeUI()
        {
            InitializeComponent();
        }
        M141Config Config141 => Process.IConfig as M141Config;
        M141Process Process141 => Process as M141Process;
 
        public override void OnProcessUpdated()
        {
            base.OnProcessUpdated();
 
            Process141.RerefreshBasketcodeUI += RerefreshUI;
            RerefreshUI();
        }
 
 
        M141Process_Mysql mysqlhelper = new M141Process_Mysql();
 
        public void RerefreshUI()
        {
            mysqlhelper.IniDBIP(Config141.IPforall);
            DataTable dt = mysqlhelper.getBasketCode();
            List<codedata> codes = new List<codedata>();
 
            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    codes.Add(new codedata
                    {
                        code = dt.Rows[i][1].ToString(),
                        time = dt.Rows[i][2].ToString(),
                    });
                }
            }
 
            this.Invoke(()=>
            {
                Codesdataview.DataSource = codes;
                Codesdataview.Refresh();
            });
        }
 
 
        public class codedata
        {
            public string code { get; set; }
            public string time { get; set; }
        }
 
 
    }
}