FrmPosResult.cs
3.9 KB
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
using OnlineStore.DeviceLibrary;
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 OnlineStore.XLRStore
{
public partial class FrmPosResult : Form
{
public FrmPosResult()
{
boxEquip = StoreManager.XLRStore.boxEquip;
DrawerResults = PosDebugResultManager.DrawerResults;
InitializeComponent();
LoadDrawerList();
}
List<DrawerResult> DrawerResults;
BoxEquip boxEquip;
protected Dictionary<string, UCStatusPanel> DrawerControlList = new Dictionary<string, UCStatusPanel>();
private void LoadDrawerList()
{
this.tlpDrawerA.RowStyles.Clear();
this.tlpDrawerA.ColumnStyles.Clear();
this.tlpDrawerA.RowCount = boxEquip.Config.Drawer_Rows;
this.tlpDrawerA.ColumnCount = boxEquip.Config.Drawer_Columns;
string cid = boxEquip.Config.CID;
for (int rowindex = 0; rowindex < boxEquip.Config.Drawer_Rows; rowindex++)
{
tlpDrawerA.RowStyles.Add(new RowStyle(SizeType.Absolute, 38));
for (int colindex = 0; colindex < boxEquip.Config.Drawer_Columns; colindex++)
{
tlpDrawerA.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 87));
UCStatusPanel control = new UCStatusPanel();
control.ControlName = $"{cid}AA{(rowindex+1).ToString("00")}{(colindex+1).ToString("00")}";
control.Click += Control_Click;
this.tlpDrawerA.Controls.Add(control, colindex, rowindex);
DrawerControlList.Add(control.ControlName, control);
}
}
this.tlpDrawerB.RowStyles.Clear();
this.tlpDrawerB.ColumnStyles.Clear();
this.tlpDrawerB.RowCount = boxEquip.Config.Drawer_Rows;
this.tlpDrawerB.ColumnCount = boxEquip.Config.Drawer_Columns;
for (int rowindex = 0; rowindex < boxEquip.Config.Drawer_Rows; rowindex++)
{
tlpDrawerB.RowStyles.Add(new RowStyle(SizeType.Absolute, 38));
for (int colindex = 0; colindex < boxEquip.Config.Drawer_Columns; colindex++)
{
tlpDrawerB.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 87));
UCStatusPanel control = new UCStatusPanel();
control.ControlName = $"{cid}BB{(rowindex+1).ToString("00")}{(colindex+1).ToString("00")}";
control.Click += Control_Click;
this.tlpDrawerB.Controls.Add(control, colindex, rowindex);
DrawerControlList.Add(control.ControlName, control);
}
}
this.tlpPos.RowStyles.Clear();
this.tlpPos.ColumnStyles.Clear();
this.tlpPos.AutoScroll = true;
this.tlpPos.RowCount = boxEquip.Config.Cols_In_Drawer;
this.tlpPos.ColumnCount = boxEquip.Config.Rows_In_Drawer;
for (int rowindex = 0; rowindex < boxEquip.Config.Cols_In_Drawer; rowindex++)
{
tlpPos.RowStyles.Add(new RowStyle(SizeType.Absolute, 38));
for (int colindex = 0; colindex < boxEquip.Config.Rows_In_Drawer; colindex++)
{
tlpPos.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 87));
UCStatusPanel control = new UCStatusPanel();
control.ControlName = $"{(colindex+1).ToString("00")}{(rowindex+1).ToString("00")}";
this.tlpPos.Controls.Add(control, colindex, rowindex);
}
}
this.SuspendLayout();
}
private void Control_Click(object sender, EventArgs e)
{
throw new NotImplementedException();
}
}
}