private void MakeManualLoginVisible()
 {
     BarcodeLabel.Visible   = true;
     BarcodeTextBox.Visible = true;
     MyOkButton.Visible     = true;
     AcceptButton           = MyOkButton;
     Height += _shrinkDistance;
     BarcodeTextBox.Select();
 }
Esempio n. 2
0
        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 Init()
        {
            BarcodeTextBox.Select();
            //BarcodeCatcherTextBox.Width = 0;
            var barCodeController = new BarCodeController(this);

            barCodeController.BarCodeReceived += BarCodeReceived;
            var locA = ManualCheckBox.Location;
            var locB = BarcodeTextBox.Location;

            _shrinkDistance = (locB.Y + BarcodeTextBox.Height) - (locA.Y + ManualCheckBox.Height);
            MakeManualLoginInvisible();
        }
Esempio n. 4
0
        private void Init()
        {
            Point             locA, locB;
            BarCodeController barCodeController;

            BarcodeTextBox.Select();
            //BarcodeCatcherTextBox.Width = 0;
            barCodeController = new BarCodeController(this);
            barCodeController.BarCodeReceived += new BarCodeEventHandler(BarCodeReceived);
            locA             = ManualCheckBox.Location;
            locB             = BarcodeTextBox.Location;
            MyShrinkDistance = (locB.Y + BarcodeTextBox.Height) - (locA.Y + ManualCheckBox.Height);
            MakeManualLoginInvisible();
        }
Esempio n. 5
0
        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);
        }