private void txtOuterScan_Leave(object sender, System.EventArgs e) { string scan = txtOuterScan.Text; BarcodeUtil2 gdu = new BarcodeUtil2(); if (scan.Length < 30) { string message = "You did not scan a GS1 2d barcode."; string caption = "Error Detected in Input"; MessageBoxButtons buttons = MessageBoxButtons.OK; DialogResult result; result = MessageBox.Show(message, caption, buttons); txtOuterScan.Text = string.Empty; txtOuterScan.Focus(); return; } //gdu.GS1DataConvert(scan); Dictionary <string, string> BarcodeDecodeDictionary; BarcodeDecodeDictionary = gdu.decodeBarcodeGS1Pharma(scan); string pstring; BarcodeDecodeDictionary.TryGetValue("01", out pstring); txtGTIN.Text = pstring; BarcodeDecodeDictionary.TryGetValue("17", out pstring); txtExpDt.Text = pstring; BarcodeDecodeDictionary.TryGetValue("10", out pstring); txtLot.Text = pstring; BarcodeDecodeDictionary.TryGetValue("21", out pstring); txtSerial.Text = pstring; txtInnerscan.Focus(); }
/// <summary> ///Scanning will cause this to trigger /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtBarcode_Leave(object sender, System.EventArgs e) { string scan = txtBarcode.Text; BarcodeUtil2 gdu = new BarcodeUtil2(); if (scan.ToString() == string.Empty) { return; } if (scan.Length < 30) { string message = "You did not scan a GS1 2d barcode."; string caption = "Error Detected in Input"; MessageBoxButtons buttons = MessageBoxButtons.OK; DialogResult result; result = MessageBox.Show(message, caption, buttons); txtBarcode.Text = string.Empty; txtBarcode.Focus(); txtBarcode.Clear(); return; } Dictionary <string, string> BarcodeDecodeDictionary; BarcodeDecodeDictionary = gdu.decodeBarcodeGS1Pharma(scan); string pstring; BarcodeDecodeDictionary.TryGetValue("01", out pstring); txtItemNumber.Text = pstring; BarcodeDecodeDictionary.TryGetValue("17", out pstring); txtExpDt.Text = pstring; BarcodeDecodeDictionary.TryGetValue("10", out pstring); txtLot.Text = pstring; BarcodeDecodeDictionary.TryGetValue("21", out pstring); txtSerialNumber.Text = pstring; if (FindBarcodeInlist(scan) < 1) { string[] row = new string[] { txtItemNumber.Text, gdu.GtinToNDC(txtItemNumber.Text), txtSerialNumber.Text, txtExpDt.Text, txtLot.Text, scan }; RecordgridList.Rows.Add(row); this.addItemSummary(gdu.GtinToNDC(txtItemNumber.Text), txtLot.Text, txtExpDt.Text, 1); } txtBarcode.Focus(); txtBarcode.Clear(); }
private void txtInnerscan_Leave(object sender, System.EventArgs e) { string scan = txtInnerscan.Text; if (scan == string.Empty) { return; } BarcodeUtil2 gdu = new BarcodeUtil2(); //GS1DataUtil gdu = new GS1DataUtil(); if (scan.Length < 30) { string message = "You did not scan a GS1 2d barcode."; string caption = "Error Detected in Input"; MessageBoxButtons buttons = MessageBoxButtons.OK; DialogResult result; result = MessageBox.Show(message, caption, buttons); txtInnerscan.Text = string.Empty; txtInnerscan.Focus(); } Dictionary <string, string> BarcodeDecodeDictionary; BarcodeDecodeDictionary = gdu.decodeBarcodeGS1Pharma(scan); // //gdu.GS1DataConvert(scan); string pgtin; string pexpdate; string plot; string pserial; BarcodeDecodeDictionary.TryGetValue("01", out pgtin); BarcodeDecodeDictionary.TryGetValue("17", out pexpdate); BarcodeDecodeDictionary.TryGetValue("10", out plot); BarcodeDecodeDictionary.TryGetValue("21", out pserial); if (plot != txtLot.Text) { string message = "Inner Lot does not match Outer Lot."; string caption = "Error Detected in Input"; MessageBoxButtons buttons = MessageBoxButtons.OK; DialogResult result; result = MessageBox.Show(message, caption, buttons); txtInnerscan.Text = string.Empty; txtInnerscan.Focus(); return; } if (INBCList.Exists(x => x.serial == pserial)) { string message = string.Format("Duplicate Serial Number {0} found.", pserial); string caption = "Error Duplicate Scan"; MessageBoxButtons buttons = MessageBoxButtons.OK; DialogResult result; result = MessageBox.Show(message, caption, buttons); txtInnerscan.Text = string.Empty; txtInnerscan.Focus(); return; } INBCList.Add(new InnerBarcode(pgtin, plot, pserial, pexpdate)); txtInnerscan.Text = string.Empty; txtInnerscan.Focus(); lbInnerscanns.Items.Add(pgtin + ", " + plot + ", " + pserial); innercount++; }
private void ObjectToShow_LastScanChangedEvent(object sender, string Scan) { string itemnumber; string lot; string expdate; string serialnumber; string scan = Scan; BarcodeUtil2 gdu = new BarcodeUtil2(); if (scan.ToString() == string.Empty) { return; } if (scan.Length < 30) { string message = "You did not scan a GS1 2d barcode."; string caption = "Error Detected in Input"; MessageBoxButtons buttons = MessageBoxButtons.OK; DialogResult result; result = MessageBox.Show(message, caption, buttons); // txtBarcode.Text = string.Empty; // txtBarcode.Focus(); // txtBarcode.Clear(); return; } Dictionary <string, string> BarcodeDecodeDictionary; BarcodeDecodeDictionary = gdu.decodeBarcodeGS1Pharma(scan); string pstring; BarcodeDecodeDictionary.TryGetValue("01", out pstring); itemnumber = pstring; BarcodeDecodeDictionary.TryGetValue("17", out pstring); expdate = pstring; BarcodeDecodeDictionary.TryGetValue("10", out pstring); lot = pstring; BarcodeDecodeDictionary.TryGetValue("21", out pstring); serialnumber = pstring; int ret = 1; if (serialnumber != null) { ret = AddToSerialNumber(itemnumber, lot, serialnumber, expdate, scan); } if (ret > 0) { ret = AddToItems(sender, itemnumber, lot, expdate, scan); } this.View.Refresh(); this.View.ObjectSpace.ReloadObject(sender); PropertyEditor editor = ((DetailView)createdView).FindItem("LastScan") as PropertyEditor; if (editor != null) { // IIB.LastScan = string.Empty; (editor.Control as Control).Focus(); (editor.Control as Control).Select(); (editor.Control as Control).ResetText(); } // ret = AddToSerialNumber(itemnumber, lot, serialnumber, expdate, scan); // txtBarcode.Focus(); // txtBarcode.Clear(); }