private void NextToScanPackagesButton_Click(object sender, EventArgs e) { CheckTray.AddEvent(false, CheckTray.CurrentGroupType, -1, -1, -1, string.Empty, string.Empty, "Нажата кнопка Далее; SelectPanel"); if (string.IsNullOrWhiteSpace(PackagesCountTextBox.Text) || Convert.ToInt32(PackagesCountTextBox.Text) == 0) { CheckTray.AddEvent(true, CheckTray.CurrentGroupType, -1, -1, -1, string.Empty, string.Empty, "Не введено кол-во упаковок на поддоне либо кол-во=0; SelectPanel; return"); Infinium.LightMessageBox.Show(ref TopForm, false, "Не введено кол-во упаковок на поддоне либо кол-во равно нулю", "Внимание"); PackagesCountTextBox.Focus(); return; } TotalPackCount = Convert.ToInt32(PackagesCountTextBox.Text); CheckTimer.Enabled = true; ScanPackagesPanel.BringToFront(); BarcodeTextBox.Focus(); CheckTray.CurrentClientID = Convert.ToInt32(ClientsComboBox.SelectedValue); CheckTray.CurrentClientName = ClientsComboBox.Text; if (CheckTray.CurrentGroupType == 2) { CheckTray.AddEvent(false, CheckTray.CurrentGroupType, -1, -1, -1, string.Empty, string.Empty, "Выбран клиент: " + CheckTray.CurrentClientName); } CheckTray.AddEvent(false, CheckTray.CurrentGroupType, -1, -1, -1, string.Empty, string.Empty, "Формирование поддона продолжено; SelectPanel; ScanPackagesPanel.BringToFront()"); }
private void CheckTimer_Tick(object sender, EventArgs e) { if (!BarcodeTextBox.Focused) { BarcodeTextBox.Focus(); } }
public void BarCodeByHands() { BarcodeLabel.Visible = true; BarcodeTextBox.Enabled = true; BarcodeTextBox.Visible = true; Command.Visible = false; BarcodeTextBox.Focus(); }
private void NavigateMenuCloseButton_MouseUp(object sender, MouseEventArgs e) { if (!CanAction) { return; } BarcodeTextBox.Focus(); }
private void PalleteLabelCheckForm_Shown(object sender, EventArgs e) { while (!SplashForm.bCreated) { ; } FormEvent = eShow; AnimateTimer.Enabled = true; BarcodeTextBox.Focus(); }
public void SaveData() { _statusBar.StatusText = "Saving Output to " + XlsFileName; Dialogs.ShowLongOperationDialog(new Action(() => { ExcelPackage pck = new ExcelPackage(new FileInfo(XlsFileName)); ExcelWorksheet workSheet = pck.Workbook.Worksheets[1]; var start = workSheet.Dimension.Start; var end = workSheet.Dimension.End; //Write our count header. workSheet.Cells["BA1"].Value = "Num Times Found"; foreach (SpreadSheetRow row in Rows) { //Found the barcode on the spreadsheet, highlight it green if (row.Found == true) { workSheet.Row(row.RowId + 1).Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid; workSheet.Row(row.RowId + 1).Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.FromArgb(176, 255, 122)); } else { workSheet.Row(row.RowId + 1).Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid; workSheet.Row(row.RowId + 1).Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.FromArgb(255, 122, 122)); } workSheet.Cells["BA" + (row.RowId + 1)].Value = row.FoundCount; } if (pck.Workbook.Worksheets["Scanned But Not Found"] == null) { //Create new worksheet to save everything they scanned, but didn't find on the spreadsheet pck.Workbook.Worksheets.Add("Scanned But Not Found"); } ExcelWorksheet scannedWorksheet = pck.Workbook.Worksheets["Scanned But Not Found"]; int i = 0; foreach (string code in Scans) { string coords = string.Format("A{0}", (i + 1)); scannedWorksheet.Cells[coords].Value = code; i++; } pck.Save(); }), "Saving..."); BarcodeTextBox.Focus(); BarcodeTextBox.Select(0, BarcodeTextBox.Text.Length); _statusBar.StatusText = "Successfully Saved " + XlsFileName; }
private void NextToCheckPackagesButton_Click(object sender, EventArgs e) { CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Нажата кнопка Далее; ScanPackagesPanel"); if (CheckTray.ScanPackgesCount < 1) { CheckTray.AddEvent(true, -1, -1, -1, -1, string.Empty, string.Empty, "Не отсканировано ни одной этикетки; ScanPackagesPanel; return"); Infinium.LightMessageBox.Show(ref TopForm, false, "Не отсканировано ни одной этикетки", "Внимание"); return; } CheckTimer.Enabled = false; if (CheckTray.ScanPackgesCount != TotalPackCount) { CheckTray.AddEvent(true, -1, -1, -1, -1, string.Empty, string.Empty, "Количество отсканированных этикеток не равно первоначально заявленному. Продолжить?; ScanPackagesPanel"); bool OKCancel = Infinium.LightMessageBox.Show(ref TopForm, true, "Количество отсканированных этикеток не равно " + TotalPackCount + ". Всё равно продолжить?", "Внимание"); if (!OKCancel) { CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Количество отсканированных этикеток не равно первоначально заявленному. Задумался; ScanPackagesPanel"); CheckTimer.Enabled = true; BarcodeTextBox.Focus(); return; } CheckTray.AddEvent(true, -1, -1, -1, -1, string.Empty, string.Empty, "Количество отсканированных этикеток не равно первоначально заявленному. Игнорирование!; ScanPackagesPanel"); } Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Загрузка данных с сервера.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } CheckTray.FillPackages(); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } CheckTray.Clear(); ErrorPackLabel.Visible = false; CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Количество отсканированных этикеток не равно первоначально заявленному. Игнорирование!; ScanPackagesPanel; CheckPackagesPanel.BringToFront()"); CheckPackagesPanel.BringToFront(); }
private void CheckTimer_Tick(object sender, EventArgs e) { if (!CanAction) { return; } if (!BarcodeTextBox.Focused) { BarcodeTextBox.Focus(); } //CheckTimer.Enabled = false; }
private void HandleSearchResult(string barcodeText) { if (SearchResult != null) { SpreadSheetGrid.SelectedItem = SearchResult; Dispatcher.CurrentDispatcher.BeginInvoke( DispatcherPriority.Send, new Action(() => SpreadSheetGrid.ScrollIntoView(SearchResult)) ); _totalsBar.TotalFound = _rowList.Where(x => x.Found == true).Count(); _statusBar.StatusText = barcodeText + " Found!"; } else { StatusBar.StatusText = barcodeText + " Not Found!"; //AddScan(barcodeText); } BarcodeTextBox.Focus(); BarcodeTextBox.Select(0, BarcodeTextBox.Text.Length); }
private void BackToScanPackagesButton_Click(object sender, EventArgs e) { CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Нажата кнопка Назад; CheckPackagesPanel; ScanPackagesPanel.BringToFront()"); CheckTimer.Enabled = true; BarcodeTextBox.Focus(); ScanPackagesPanel.BringToFront(); CheckTray.SetTotalLabel(TotalPackCount); TotalLabel.Text = CheckTray.LabelInfo.PackedToTotal; if (CheckTray.ScanPackgesCount == 0) { BackToSelectButton.Visible = true; } CheckPicture.Visible = true; CheckPicture.Image = Properties.Resources.cancel; BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0); BarcodeLabel.Text = ""; ClientLabel.Text = ""; MegaOrderNumberLabel.Text = ""; MainOrderNumberLabel.Text = ""; DispatchDateLabel.Text = ""; OrderDateLabel.Text = ""; ProductTypeLabel.Text = ""; PackNumberLabel.Text = ""; GroupLabel.Text = ""; FrontsPackContentDataGrid.StateCommon.Background.Color1 = Color.White; FrontsPackContentDataGrid.StateCommon.Background.Color2 = Color.Transparent; FrontsPackContentDataGrid.StateCommon.DataCell.Back.Color1 = Color.White; FrontsPackContentDataGrid.StateCommon.DataCell.Content.Color1 = System.Drawing.Color.Black; DecorPackContentDataGrid.StateCommon.Background.Color1 = Color.White; DecorPackContentDataGrid.StateCommon.Background.Color2 = Color.Transparent; DecorPackContentDataGrid.StateCommon.DataCell.Back.Color1 = Color.White; DecorPackContentDataGrid.StateCommon.DataCell.Content.Color1 = System.Drawing.Color.Black; }
private void NavigateMenuCloseButton_MouseUp(object sender, MouseEventArgs e) { BarcodeTextBox.Focus(); }
private void ChangeTrayBracodeTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { ChangeTrayBracodeLabel.Text = ""; pictureBox1.Visible = false; CheckTray.Clear(); if (ChangeTrayBracodeTextBox.Text.Length < 12) { CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Ошибка: неверный штрихкод " + ChangeTrayBracodeTextBox.Text); ChangeTrayBracodeTextBox.Clear(); return; } ChangeTrayBracodeLabel.Text = ChangeTrayBracodeTextBox.Text; ChangeTrayBracodeTextBox.Clear(); int TrayID = Convert.ToInt32(ChangeTrayBracodeLabel.Text.Substring(3, 9)); string Prefix = ChangeTrayBracodeLabel.Text.Substring(0, 3); if (Prefix != "005" && Prefix != "006") { CheckTray.AddEvent(true, -1, -1, TrayID, -1, string.Empty, string.Empty, "Сканирование поддона. Неверный префикс штрихкода! Ожидалась этикетка поддона"); label17.Visible = true; label17.Text = "Штрихкод имеет неверный префикс. Допустимые префиксы 005 и 006"; } CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Добавление на поддон"); CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Сканируется этикетка " + ChangeTrayBracodeLabel.Text); if (Prefix == "005") { CheckTray.CurrentGroupType = 1; } if (Prefix == "006") { CheckTray.CurrentGroupType = 2; } if (CheckTray.CheckTrayBarcode(ChangeTrayBracodeLabel.Text)) { CheckTray.IsNewTray = false; CheckTray.CurrentTrayID = TrayID; if (CheckTray.CurrentGroupType == 2) { CheckTray.GetClientID(TrayID); CheckTray.CurrentClientName = CheckTray.GetMarketClientName(CheckTray.CurrentClientID); CheckTray.AddEvent(false, CheckTray.CurrentGroupType, -1, TrayID, -1, string.Empty, string.Empty, "Поддон под клиентом: " + CheckTray.CurrentClientName); } CheckTray.AddEvent(false, CheckTray.CurrentGroupType, -1, TrayID, -1, string.Empty, string.Empty, "Поддон успешно отсканирован; ScanPackagesPanel.BringToFront()"); ScanPackagesPanel.BringToFront(); ChangeTrayBracodeLabel.Text = ""; CheckTimer.Enabled = true; BarcodeTextBox.Focus(); } else { pictureBox1.Visible = true; pictureBox1.Image = Properties.Resources.cancel; ChangeTrayBracodeLabel.ForeColor = Color.FromArgb(240, 0, 0); label17.Text = "Такой этикетки не существует в базе"; label17.Visible = true; CheckTray.Clear(); return; } } }
private void SaveButton_MouseUp(object sender, MouseEventArgs e) { BarcodeTextBox.Focus(); }