Example #1
0
 private void LoadToDGVAndTB(List <DecodeScanSession> DecodeSession)
 {
     Status_TB.Invoke((MethodInvoker) delegate()
     {
         Status_TB.AppendText($"Получены данные" + Environment.NewLine + DecodeSession[DecodeSession.Count - 1].DataMatrix + Environment.NewLine);
     });
     Scan_DGV.Invoke((MethodInvoker) delegate()
     {
         Scan_DGV.Rows.Add();
         Scan_DGV[0, Scan_DGV.Rows.Count - 1].Value = DecodeSession[DecodeSession.Count - 1].DataMatrix;
         if (DecodeSession[DecodeSession.Count - 1].Unique == 1)
         {
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "Найден";
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Lime;
         }
         else if (DecodeSession[DecodeSession.Count - 1].Unique == 0)
         {
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "Уже подтвержден";
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Orange;
         }
         else
         {
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "Не найден";
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Red;
         }
     });
 }
Example #2
0
 private void LoadToDGV(List <OrderScanSession> ScanSessions)
 {
     Scan_DGV.Invoke((MethodInvoker) delegate()
     {
         SessionCount_TB.Text = ScanSessions.Count().ToString();
         string DataMatrix    = $"{ScanSessions[ScanSessions.Count - 1].Order.Number}_{ScanSessions[ScanSessions.Count - 1].Order.List}_{ScanSessions[ScanSessions.Count - 1].Order.Mark}_{ScanSessions[ScanSessions.Count - 1].Order.Executor}_{ScanSessions[ScanSessions.Count - 1].Order.Lenght}_{ScanSessions[ScanSessions.Count - 1].Order.Weight}";
         LoadStatusOperation(DataMatrix);
         Scan_DGV.Rows.Add();
         Scan_DGV[0, Scan_DGV.Rows.Count - 1].Value = DataMatrix;
         if (ScanSessions[ScanSessions.Count - 1].Unique == 2)
         {
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "Обновление статуса";
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Lime;
             Scan_DGV[2, Scan_DGV.Rows.Count - 1].Value           = ScanSessions[ScanSessions.Count - 1].Discription;
             Scan_DGV[2, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Lime;
         }
         else if (ScanSessions[ScanSessions.Count - 1].Unique == 1)
         {
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "Не найден в базе данных";
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Red;
             Scan_DGV[2, Scan_DGV.Rows.Count - 1].Value           = ScanSessions[ScanSessions.Count - 1].Discription;
             Scan_DGV[2, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Red;
         }
         else
         {
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "Не уникален";
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Red;
             Scan_DGV[2, Scan_DGV.Rows.Count - 1].Value           = ScanSessions[ScanSessions.Count - 1].Discription;
             Scan_DGV[2, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Red;
         }
     });
 }
 private void LoadToDGVAndTB(String result, String Path)
 {
     Status_TB.Invoke((MethodInvoker) delegate()
     {
         Status_TB.AppendText($"Получены данные" + Environment.NewLine + result + Environment.NewLine);
     });
     Scan_DGV.Invoke((MethodInvoker) delegate()
     {
         Scan_DGV.Rows.Add();
         Scan_DGV[0, Scan_DGV.Rows.Count - 1].Value = result;
         Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value = SystemArgs.Path.GetFileName(Path);
     });
 }
Example #4
0
 private void LoadToDGV(List <BlankOrderScanSession> ScanSessions)
 {
     Scan_DGV.Invoke((MethodInvoker) delegate()
     {
         SessionCount_TB.Text = ScanSessions.Count().ToString();
         Scan_DGV.Rows.Add();
         if (ScanSessions[ScanSessions.Count - 1].Added)
         {
             Scan_DGV[0, Scan_DGV.Rows.Count - 1].Value           = ScanSessions[ScanSessions.Count - 1].QRBlankOrder;
             Scan_DGV[0, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Lime;
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "QR бланка заказа";
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.AliceBlue;
         }
         else if (ScanSessions[ScanSessions.Count - 1].GetNumberAndLists().Where(p => p.Finded == -1).Count() == 0)
         {
             Scan_DGV[0, Scan_DGV.Rows.Count - 1].Value           = ScanSessions[ScanSessions.Count - 1].QRBlankOrder;
             Scan_DGV[0, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Orange;
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "QR бланка заказа";
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.AliceBlue;
         }
         else
         {
             Scan_DGV[0, Scan_DGV.Rows.Count - 1].Value           = ScanSessions[ScanSessions.Count - 1].QRBlankOrder;
             Scan_DGV[0, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Red;
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "QR бланка заказа";
             Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.AliceBlue;
         }
         foreach (BlankOrderScanSession.NumberAndList Order in ScanSessions[ScanSessions.Count - 1].GetNumberAndLists())
         {
             Scan_DGV.Rows.Add();
             String TextOrder = "Заказ №" + Order.Number + " Лист №" + Order.List.ToString();
             Scan_DGV[0, Scan_DGV.Rows.Count - 1].Value = TextOrder;
             if (Order.Finded == 1)
             {
                 Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "Найден";
                 Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Lime;
             }
             else if (Order.Finded == 0)
             {
                 Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "Уже подтвержден";
                 Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Orange;
             }
             else
             {
                 Scan_DGV[1, Scan_DGV.Rows.Count - 1].Value           = "Не найден";
                 Scan_DGV[1, Scan_DGV.Rows.Count - 1].Style.BackColor = Color.Red;
             }
         }
     });
 }