schangxiang@126.com
2025-09-01 4b51c3551c3957ddd5236a18dd480637835cf7d6
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using WMS.Model;
using WMS.Untils;
using System.Linq;
using WMS.yunneiWCS;
 
namespace WMS.UI.SynthesizeQuery
{
    public partial class FrmStore : Form
    {
        private yunneiWCS.IyunneiWcfClient clent = new yunneiWCS.IyunneiWcfClient();
 
        private string one_emptyStr = " ";
 
        /// <summary>
        /// 每排的列数
        /// </summary>
        private readonly int _column = 38;
        /// <summary>
        /// 每排的层数
        /// </summary>
        private readonly int _layer = 6;
 
        private FrmStore fatherFrmStore = null;
        private bool isFullSrceen = false;//是否全屏
        private bool isHasOpenFullSrceen = false;//是否已经打开了全屏
        private Thread t = null;
        private Thread t_tips = null;
        AutoSizeFormClass asc = new AutoSizeFormClass();
        public static Dictionary<string, Color> ColorDic = new Dictionary<string, Color>() {
             {"LOCK",Color.Red},
             {"FULL",Color.DeepSkyBlue},
             {"EMPTY",Color.Lime},
             {"NODIE",Color.Orange},
             {"STATYMONTHS",Color.Magenta}
        };
 
        /// <summary>
        /// 目前所有库存1信息
        /// </summary>
        List<MyVproductStock> currentAll_Stored_cache = null;
 
        /// <summary>
        /// 系统配置的呆滞库位时长
        /// </summary>
        static string BasicDataSetForStayMonths = "";
 
        /// <summary>
        /// 所有库存信息
        /// </summary>
        List<MyVproductStock> Stored_cache = null;
        /// <summary>
        /// 空托盘库位
        /// </summary>
        List<MyVproductStock> StoredplaceInfo = null;
        /// <summary>
        /// 呆滞库位
        /// </summary>
        List<MyVproductStock> Store_StatyMonths = null;
        /// <summary>
        /// 空库位信息
        /// </summary>
        private List<string> emptyplaceInfo;
        /// <summary>
        /// 锁定库位信息
        /// </summary>
        private List<string> lockedplace;
 
        private delegate void BindRack1Delegate(); // 创建委托和委托对象
 
        public FrmStore(bool _isFullSrceen, FrmStore _this)
        {
            InitializeComponent();
 
            WMSFrmMain.isCurrentShowFrmStore = true;
 
            fatherFrmStore = _this;
            isFullSrceen = _isFullSrceen;
 
            CheckForIllegalCrossThreadCalls = false;
 
 
            this.KeyPreview = true;//让界面相应按钮事件
 
        }
 
        public FrmStore()
        {
            InitializeComponent();
 
 
            CheckForIllegalCrossThreadCalls = false;
 
 
            this.KeyPreview = true;//让界面相应按钮事件
 
        }
 
        private void FrmStore_Load(object sender, EventArgs e)
        {
            //如果是全屏状态,并且判断是有两个屏幕,就默认显示到第二个屏幕上
            if (isFullSrceen)
            {
                WMSCommon.ShowScreen2(this);
                this.WindowState = FormWindowState.Maximized;
            }
 
            btnReload_Click(null, null);
 
 
            t = new Thread(SetValue);
            t.Start();
 
            if (isFullSrceen)
            {
 
            }
 
 
            asc.controllInitializeSize(this);
 
            this.Dock = DockStyle.Fill;
 
 
 
        }
 
 
        /// <summary>
        /// 控件赋值
        /// </summary>
        /// <param name="stockList"></param>
        private void SetValue()
        {
            while (true)
            {
                if (WMSFrmMain.isCurrentShowFrmStore)
                {
                    RefreshAll();
                }
 
                Thread.Sleep(2000);//2秒刷新一次
            }
        }
 
        /// <summary>
        /// 库位各种状态下的库位数量显示
        /// </summary>
        private void RefreshAll()
        {
            GetAllStore();
 
            //List<MyVproductStock> storeList = clent.findAllProductStock().ToList();
            List<MyVproductStock> storeList = currentAll_Stored_cache;
            //整体去掉10001库位
            //storeList = storeList.Where(x => x.positionName != 10001).ToList();
 
            //获取空库位
            emptyplaceInfo = storeList.Where(x => x.isfree != true).Select(x => x.positionName).ToList();
            //获取有货库位
            StoredplaceInfo = storeList.Where(x => !string.IsNullOrEmpty(x.materialCode)).ToList();
 
            //获取有货物的货位
            var existDiePlaces = StoredplaceInfo.Where(x =>
                !string.IsNullOrEmpty(x.materialCode)
                 && x.materialCode != "GT-KTP"
                 && x.materialCode != "GG-KTP"
              ).ToList();
            //给有货一栏统计当前有货的个数
            lb_hasItem.Text = existDiePlaces.Select(x => x.positionName).Distinct().Count().ToString();
 
            //获取呆滞库位 [EditBy shaocx,2022-04-17]
            int statyMonths = 0;
            Store_StatyMonths = new List<MyVproductStock>();
            if (existDiePlaces != null && existDiePlaces.Count > 0)
            {
                var queryTime = DateTime.Now.AddMonths(-Convert.ToInt32(BasicDataSetForStayMonths));
                Store_StatyMonths = existDiePlaces.Where(x => x.createTime <= queryTime).ToList();
            }
            statyMonths = Store_StatyMonths.Select(x => x.positionName).Distinct().Count();
            this.lbl_StatyMonth.Text = statyMonths.ToString();
 
 
            ////获取空托盘所在库位
            var PlaceOfEmptyContainer = StoredplaceInfo.Where(x =>
                !string.IsNullOrEmpty(x.materialCode) && x.materialCode == "GT-KTP"
                 && x.materialCode == "GG-KTP"
                ).ToList();
            ////给空托盘统计个数
            lb_EmptyContainer.Text = PlaceOfEmptyContainer.Count.ToString();
 
            //获取被锁定库位
            lockedplace = storeList.Where(x => x.isLock == true).Select(x => x.positionName).ToList();
            //给被锁定的的一栏统计个数
            lb_isLock.Text = lockedplace.Count.ToString();
            //空库位个数
            lb_emptyPlace.Text = emptyplaceInfo.Count.ToString();
 
            BindingPlace();//将数据和对应的lable对应并分别显示不同的颜色
        }
 
        /// <summary>
        /// 给各种图标附上颜色
        /// </summary>
        private void BindingPlace()
        {
            foreach (Control c in pnl_Rack1.Controls)//查找在pn_01中的所有控件
            {
                if (c is System.Windows.Forms.Label)//如果是Label
                {
                    System.Windows.Forms.Label lb = c as System.Windows.Forms.Label;
                    //首先初始化这个颜色 【EditBy shaocx,2021-12-21】
                    lb.BackColor = ColorDic["EMPTY"];
 
                    var realPlaceNo = lb.Text;//截取前五位
                    if (lb.Text.IndexOf(one_emptyStr) > -1)
                    {
                        realPlaceNo = lb.Text.Substring(0, lb.Text.IndexOf(one_emptyStr));
                    }
                    // lb.MouseDoubleClick += new MouseEventHandler(lb_Click);
                    string listFind = "";
                    //用List.Find方法加兰姆达表达式在几个List中分别查找库位的情况
                    //锁定
                    listFind = lockedplace.Find(x => x == realPlaceNo);
                    if (!string.IsNullOrEmpty(listFind) && listFind != "0")
                    {
                        lb.BackColor = ColorDic["LOCK"];
                    }
                    listFind = "";
                    listFind = emptyplaceInfo.Find(x => x == realPlaceNo); //将代表空库位的Lable设置为灰色
 
                    if (!string.IsNullOrEmpty(listFind))
                    {
                        if (lb.BackColor != ColorDic["LOCK"])
                        {
                            lb.BackColor = ColorDic["EMPTY"];
                        }
                    }
                    listFind = "";
                    var tmp1 = (StoredplaceInfo.Find(x => x.positionName == realPlaceNo));  //将代表有货库位的Lable设置为蓝色
                    if (tmp1 != null)
                    {
                        listFind = tmp1.materialName.ToString();
 
                    }
                    if (!string.IsNullOrEmpty(listFind))
                    {
                        if (lb.BackColor != ColorDic["LOCK"])
                        {
                            lb.BackColor = GetColor(tmp1);
                        }
                        lb.ContextMenuStrip = contextMenuStrip1;//添加右键点击菜单
                        lb.MouseHover += new EventHandler(lb_Mousehover);
                    }
 
 
                    //最后重新给Lable赋值,显示全部的信息 【EditBy shaocx,2021-03-06】
                    SetDisplayValue(lb, realPlaceNo);
                }
            }
            foreach (Control c in pnl_Rack2.Controls)//查找在pn_01中的所有控件
            {
                if (c is Label)//如果是Label
                {
 
                    Label lb = c as Label;
                    //首先初始化这个颜色 【EditBy shaocx,2021-12-21】
                    lb.BackColor = ColorDic["EMPTY"];
 
                    var realPlaceNo = lb.Text;//截取前五位
                    if (lb.Text.IndexOf(one_emptyStr) > -1)
                    {
                        realPlaceNo = lb.Text.Substring(0, lb.Text.IndexOf(one_emptyStr));
                    }
                    // lb.MouseDoubleClick += new MouseEventHandler(lb_Click);
                    string listFind = "";
                    //用List.Find方法加兰姆达表达式在几个List中分别查找库位的情况
                    //锁定
                    listFind = lockedplace.Find(x => x == realPlaceNo);
                    if (!string.IsNullOrEmpty(listFind) && listFind != "0")
                    {
                        lb.BackColor = ColorDic["LOCK"];
                    }
                    listFind = "";
                    listFind = emptyplaceInfo.Find(x => x == realPlaceNo); //将代表空库位的Lable设置为灰色
 
                    if (!string.IsNullOrEmpty(listFind))
                    {
                        if (lb.BackColor != ColorDic["LOCK"])
                        {
                            lb.BackColor = ColorDic["EMPTY"];
                        }
                    }
 
                    listFind = "";
                    var tmp1 = (StoredplaceInfo.Find(x => x.positionName == realPlaceNo));  //将代表有货库位的Lable设置为蓝色
                    if (tmp1 != null)
                    {
                        listFind = tmp1.materialName.ToString();
                    }
                    if (!string.IsNullOrEmpty(listFind))
                    {
                        if (lb.BackColor != ColorDic["LOCK"])
                        {
                            lb.BackColor = GetColor(tmp1);
                        }
                        lb.ContextMenuStrip = contextMenuStrip1;//添加右键点击菜单
                        lb.MouseHover += new EventHandler(lb_Mousehover);
 
                    }
 
                    //最后重新给Lable赋值,显示全部的信息 【EditBy shaocx,2021-03-06】
                    SetDisplayValue(lb, realPlaceNo);
 
                }
            }
 
        }
 
        /// <summary>
        /// 根据类型获取颜色
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private Color GetColor(MyVproductStock store)
        {
            //if (Convert.ToInt16(store.mouldId) >= SysGloble.MinNoDieNumber)
            //先判断是否是呆滞库位
            if (WMSCommon.isStatyMonths(BasicDataSetForStayMonths, store))
            {//呆滞库位
                return ColorDic["STATYMONTHS"];
            }
 
            if (WMSCommon.isEmptySalver(store))
            {//空托盘?
                return ColorDic["NODIE"];
            }
            if (WMSCommon.isCatogroy(store))
            {//货物?
                return ColorDic["FULL"];
            }
            return ColorDic["EMPTY"];
        }
 
        /// <summary>
        /// 鼠标悬停是更新右键菜单的值
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lb_Mousehover(object sender, EventArgs e)
        {
            string plcName;
            if (sender is Label) //如果悬停的控件是label
            {
                contextMenuStrip1.Items["Sku"].Text = "物料号: "; //初始化右键菜单
                contextMenuStrip1.Items["SkuDesc"].Text = "物料名称: ";
                contextMenuStrip1.Items["QTY"].Text = "数量: ";
                try
                {
                    Label lb = sender as Label;
                    plcName = lb.Text.Trim();
                    StringBuilder sb = new StringBuilder();//获取物料号.物料名称,状态,数量
                    if (Stored_cache != null)
                    {
                        var storeds = Stored_cache.FindAll(x => x.positionName == plcName);
                        if (storeds != null && storeds.Count > 0)
                        {
                            foreach (var it in storeds)
                            {
                                //此处存疑??
                                contextMenuStrip1.Items["ITEMNO"].Text += it.materialCode + "; ";
                                contextMenuStrip1.Items["TYPE"].Text += it.materialName + "; ";
                                //if (!string.IsNullOrEmpty(it.ITEMNO) && !string.IsNullOrEmpty(it.TYPE))
                                //{
                                //    contextMenuStrip1.Items["QTY"].Text += it.ITEMQTY + "; ";
                                //}
 
                            }
                        }
                    }
                }
                catch
                {
                    this.Show();
                }
 
            }
        }
 
        private void initialForRack1()
        {
            initialForRack(pnl_Rack1, 2, _column, _layer);
        }
        private void initialForRack2()
        {
            initialForRack(pnl_Rack2, 1, _column, _layer);
        }
        private void btnReload_Click(object sender, EventArgs e)
        {
            //初始化层数列表
            initialNumberOfLayer(pnl_LayerFor1, _layer);
            initialNumberOfLayer(pnl_LayerFor2, _layer);
            //初始化列数列表
            initialNumberOfColumn(pnl_ColFor1, _column);
            initialNumberOfColumn(pnl_ColFor2, _column);
 
            GetAllStore();
 
            if (this.WindowState == FormWindowState.Normal || this.WindowState == FormWindowState.Maximized)
            {
                //var t1 = new Thread(RefreshRack2);//刷新第二排货架
                //t1.Start();
                //var t2 = new Thread(RefreshRack1);//刷新第一排货架
                //t2.Start();
                //RefreshRack2();
                //RefreshRack1();
                initialForRack1();
                initialForRack2();
            }
            Thread.Sleep(50);
 
            //将所有库位的状态(颜色)显示出来
            RefreshAll();
        }
 
        /// <summary>
        /// 显示库存的详细信息
        /// </summary>
        /// <param name="lb"></param>
        /// <param name="placeNo"></param>
        private string SetDisplayValue(Label lb, string placeNo)
        {
            var newLine = "\r\n";
            var textConntent = placeNo;
            MyVproductStock curStroe = null;
            curStroe = currentAll_Stored_cache.Where(p => p.positionName != null && p.positionName == placeNo && p.isfree == true).FirstOrDefault();
            if (curStroe == null)
            {
                textConntent = placeNo + one_emptyStr;
            }
            else
            {
                textConntent = placeNo + one_emptyStr + newLine;
                if (!string.IsNullOrEmpty(curStroe.materialName))
                {
                    textConntent += curStroe.materialName;
                }
                if (!string.IsNullOrEmpty(curStroe.containerCode))
                {
                    textConntent += curStroe.containerCode + newLine;
                }
            }
            lb.Text = textConntent;
            return textConntent;
        }
 
        /// <summary>
        /// 根据列和层数初始化货架模型
        /// </summary>
        /// <param name="sender">控件</param>
        /// <param name="column">列</param>
        /// <param name="layer">层</param>
        private void initialForRack(object sender, int row, int column, int layer)
        {
            (sender as Panel).Controls.Clear();
            int pnlWidth = (sender as Panel).Width;
            int pnlHeight = (sender as Panel).Height;
 
            int lblWidth = pnlWidth / column;
            int lblHeight = pnlHeight / layer;
 
            string r = row.ToString();
            string c = "";
            string l = "";
            (sender as Panel).Margin = new Padding(1, 1, 1, 5);
            for (int i = 1; i <= column; i++)
            //for (int i = column; i >= 1; i--)
            {
                if (row == 2)
                {//第二排
                    for (int j = layer; j >= 1; j--)
                    {
                        Label lb = new Label();
                        c = (column - i + 1).ToString();
                        if (j < 10)
                        {
                            l = j.ToString();
                        }
                        else
                        {
                            l = j.ToString();
                        }
                        lb.Width = lblWidth;
                        lb.Height = lblHeight;
                        lb.Margin = new Padding(1, 1, 1, 1);
                        int y = pnlHeight - j * lb.Height;
 
                        int x = (i - 1) * lb.Width;
 
                        Point startlocation = new Point(x, y);
                        lb.Location = startlocation;
                        //lb.Text = r + c + l;
                        var placeNo = r + "-" + c + "-" + l;//库位号命名
                        SetDisplayValue(lb, placeNo);
 
                        lb.ForeColor = Color.Blue;
                        lb.BorderStyle = BorderStyle.FixedSingle;
                        lb.TextAlign = ContentAlignment.MiddleCenter;
 
                        (sender as Panel).Controls.Add(lb);
 
                    }
                }
                else if (row == 1)//一排从下至上排列
                {//第一排
                    for (int j = 1; j <= layer; j++)
                    {
                        Label lb = new Label();
 
                        c = (column - i + 1).ToString();
                        if (j < 10)
                        {
                            l = j.ToString();
                        }
                        else
                        {
                            l = j.ToString();
                        }
                        lb.Width = lblWidth;
                        lb.Height = lblHeight;
                        lb.Margin = new Padding(1, 1, 1, 1);
                        int y = (j - 1) * lb.Height;
 
 
                        int x = (i - 1) * lb.Width;
 
                        Point startlocation = new Point(x, y);
                        lb.Location = startlocation;
                        //lb.Text = r + c + l;
                        var placeNo = r + "-" + c + "-" + l;
                        SetDisplayValue(lb, placeNo);
 
 
                        lb.ForeColor = Color.Blue;
                        lb.BorderStyle = BorderStyle.FixedSingle;
                        lb.TextAlign = ContentAlignment.MiddleCenter;
 
 
                        (sender as Panel).Controls.Add(lb);
 
                    }
                }
            }
        }
 
        /// <summary>
        /// 初始化列数列表
        /// </summary>
        /// <param name="column"></param>
        private void initialNumberOfColumn(object sender, int column)
        {
            (sender as Panel).Controls.Clear();
            int pnlWidth = (sender as Panel).Width;
            int pnlHeight = (sender as Panel).Height;
            for (int i = 1; i <= column; i++)
            {
                Label lb = new Label();
                lb.Font = new Font("微软雅黑", 9f);
 
                lb.Text = (column - i + 1).ToString();
 
                lb.Width = pnlWidth / column;
                lb.Height = pnlHeight;
                lb.Margin = new Padding(2, 1, 0, 1);
                int y = 0;
                int x = (i - 1) * lb.Width + lb.Width / 4;
                Point startlocation = new Point(x, y);
                lb.Location = startlocation;
                (sender as Panel).Controls.Add(lb);
            }
        }
 
        /// <summary>
        /// 初始化层数列表
        /// </summary>
        /// <param name="column"></param>
        private void initialNumberOfLayer(object sender, int layer)
        {
            if ((sender as Panel).Name == "pnl_LayerFor1")
            {
                (sender as Panel).Controls.Clear();
                int pnlWidth = (sender as Panel).Width;
                int pnlHeight = (sender as Panel).Height;
                for (int i = layer; i > 0; i--)
                {
                    Label lb = new Label();
                    lb.Font = new Font("微软雅黑", 9f);
 
                    if (i < 10)
                    {
                        lb.Text = i.ToString();
                    }
                    else
                    {
                        lb.Text = i.ToString();
                    }
                    lb.Width = pnlWidth;
                    lb.Height = pnlHeight / layer;
                    lb.Margin = new Padding(1, 2, 1, 0);
                    int y = pnlHeight - ((i - 1) * lb.Height + lb.Height / 4) - (int)(lb.Height * 0.6);
                    int x = 0;
                    Point startlocation = new Point(x, y);
                    lb.Location = startlocation;
                    (sender as Panel).Controls.Add(lb);
                    (sender as Panel).Refresh();
                }
            }
            else
            {
                (sender as Panel).Controls.Clear();
                int pnlWidth = (sender as Panel).Width;
                int pnlHeight = (sender as Panel).Height;
                for (int i = 1; i <= layer; i++)
                {
                    Label lb = new Label();
 
                    lb.Font = new Font("微软雅黑", 9f);
                    if (i < 10)
                    {
                        lb.Text = i.ToString();
                    }
                    else
                    {
                        lb.Text = i.ToString();
                    }
                    lb.Width = pnlWidth;
                    lb.Height = pnlHeight / layer;
                    lb.Margin = new Padding(1, 2, 1, 0);
                    int y = (i - 1) * lb.Height + lb.Height / 4;
                    int x = 0;
                    Point startlocation = new Point(x, y);
                    lb.Location = startlocation;
                    (sender as Panel).Controls.Add(lb);
                    (sender as Panel).Refresh();
                }
            }
        }
 
 
 
        private void btnClose_Click(object sender, EventArgs e)
        {
            try
            {
                this.Dispose();
            }
            catch (Exception)
            {
            }
 
            this.Close();
        }
 
        /// <summary>
        /// 获取所有的库存数据
        /// </summary>
        private void GetAllStore()
        {
            currentAll_Stored_cache = clent.findAllProductStock().ToList();
            BasicDataSetForStayMonths = clent.GetBasicDataSetForStayMonths();
        }
 
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (isHasOpenFullSrceen)
            {
                MessageBox.Show("已经打开了全屏!");
                return;
            }
            FrmStore frm = new FrmStore(true, this);
            //  '如果不把Border设为None,则无法隐藏Windows的开始任务栏
            frm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            // frm.WindowState = FormWindowState.Maximized;
            //frm.WindowState = FormWindowState.Normal;//注意WindowState不能是Maximized
            //'如果不允许运行其他程序,则可设为True,屏蔽其他窗体的显示
            // '但必须确保自身所有的窗体的TopMost除了子窗体外都要设置为true,否则也同样会被屏蔽
            //frm.TopMost = true;
            frm.menuStrip2.Visible = false;
            this.isHasOpenFullSrceen = true;//父窗体
            frm.Show();
        }
        private void FrmStore_KeyUp(object sender, KeyEventArgs e)
        {
            //先设置窗体属性KeyPreview=True。
            if (e.KeyData == Keys.Escape)
            {
                if (this.isFullSrceen)
                {
                    if (fatherFrmStore != null) fatherFrmStore.isHasOpenFullSrceen = false;//父窗体
                    //退出全屏
                    this.Close();//子窗体
                }
            }
        }
 
        private void FrmStore_SizeChanged(object sender, EventArgs e)
        {
            asc.controlAutoSize(this);
        }
 
        private void FrmStore_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (t != null)
            {
                t.Abort();
            }
            if (this.isFullSrceen)
            {
                if (t_tips != null)
                {
                    t_tips.Abort();
                }
            }
        }
 
        private void tableLayoutPanel4_Paint(object sender, PaintEventArgs e)
        {
 
        }
 
    }
}