public void TestDefault() { var barcode = new ITF { EncodeThis = "1234567890" }; var payload = barcode.Build(); Assert.NotNull(payload); Assert.IsNotEmpty(payload); var expected = new byte[] { 0x1D, 0x68, 0x64, // BarcodeDotHeight 0x1D, 0x77, 0x02, // BarcodeWidthMultiplier 0x1D, 0x48, 0x00, // HRI Position 0x1D, 0x66, 0x00, // BarcodeFont 0x1D, 0x6B, 0x05, // ITF Form 1 (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'0', (byte)'\0', }; Assert.AreEqual(expected, payload); }
public void TestNonDigit() { var barcode = new ITF { EncodeThis = "i'mastring" }; var payload = barcode.Build(); Assert.NotNull(payload); Assert.IsEmpty(payload); }
public void TestOddLen() { var barcode = new ITF { EncodeThis = "123" }; var payload = barcode.Build(); Assert.NotNull(payload); Assert.IsEmpty(payload); }
private void hypEdit_Click(object sender, RoutedEventArgs e) { HyperlinkButton hyp = sender as HyperlinkButton; ITF _selectedRow = hyp.DataContext as ITF; i = _selectedRow;// Assign it to i to access in the scriptable member Method _delList.Add(_selectedRow); List<string> _sendData = new List<string>(); _sendData.Add(_selectedRow.TRNO); _sendData.Add(_selectedRow.Account); _sendData.Add(_selectedRow.Quantity); _sendData.Add(_selectedRow.SecuritySymbol); _sendData.Add(_selectedRow.Price); _sendData.Add(_selectedRow.TimeLimit); _sendData.Add(_selectedRow.SpecialCondition); _sendData.Add(_selectedRow.DivRei); _sendData.Add(_selectedRow.BidPrice); _sendData.Add(_selectedRow.PriceTime); _sendData.Add(_selectedRow.EstimatedOrder); _sendData.Add(_selectedRow.MessageCode); _sendData.Add(_selectedRow.SwapToFunds); _sendData.Add(_selectedRow.TransFee); _sendData.Add(_selectedRow.AccountName); _sendData.Add(_selectedRow.NewMoney); HtmlPage.Window.Invoke("ShowOverlay", _sendData); // Call the Javascript function to show the Overlay }
private static void TesteCodigoBarras() { using (var printer = new GenericPrinter(PortaCom)) { //Code128 Code128 code = new Code128() { EncodeThis = "12321321312", BarcodeWidthMultiplier = 2, BarcodeDotHeight = 50, //Autura do codigo HriPosition = Printer.Barcodes.Enums.HRIPositions.Below, Mode = Code128.Modes.A, BarcodeFont = ThermalFontsEnum.A }; printer.PrintASCIIString("Code 128 - Altura 50"); printer.FormFeed(1); printer.PrintBarCode(code); printer.FormFeed(1); printer.Reinitialize(); //Code39 Code39 code39 = new Code39() { EncodeThis = "12321321312", BarcodeWidthMultiplier = 2, BarcodeDotHeight = 30, //Autura do codigo BarcodeFont = ThermalFontsEnum.A }; printer.PrintASCIIString("Code 39 - Altura 30"); printer.FormFeed(1); printer.PrintBarCode(code); printer.FormFeed(1); printer.Reinitialize(); //ITF ITF itf = new ITF() { EncodeThis = "12321321312", BarcodeDotHeight = 100, //Autura do codigo BarcodeWidthMultiplier = 2, BarcodeFont = ThermalFontsEnum.A }; printer.PrintASCIIString("ITF - Altura 100"); printer.FormFeed(1); printer.PrintBarCode(code); printer.FormFeed(3); printer.Reinitialize(); //NFCe printer.PrintASCIIString("Exemplo QRCode NFCe\n"); var qrCodeNFCe = new QrCode(4, "http://www.sefaz.mt.gov.br/nfce/consultanfce?chNFe=51131003460900000290650010000000031000000031&nVersao=100&tpAmb=2&cDest=02801244147&dhEmi=323031332D31302D32345431363A32313A30332D30333A3030&vNF=1,00&vICMS=0,00&digVal=78764D34764E2B48586A735657516F653474415A547855547764383D&cIdToken=000001&cHashQRCode=7AF4285DA2D18133BEF9F9370AD4A185B2527AFB"); printer.PrintBarCode(qrCodeNFCe); printer.FormFeed(1); printer.Reinitialize(); //Sat printer.PrintASCIIString("Exemplo QRCode SAT\n"); var qrCodeSat = new QrCode(4, "http://www.sefaz.mt.gov.br/nfce/consultanfce?chNFe=51131003460900000290650010000000031000000031&nVersao=100&tpAmb=2&cDest=02801244147&dhEmi=323031332D31302D32345431363A32313A30332D30333A3030&vNF=1,00&vICMS=0,00&digVal=78764D34764E2B48586A735657516F653474415A547855547764383D&cIdToken=000001&cHashQRCode=7AF4285DA2D18133BEF9F9370AD4A185B2527AFB"); printer.PrintBarCode(qrCodeNFCe); printer.FormFeed(1); printer.Cut(CutModeEnum.Parcial); printer.Reinitialize(); } }
private void btnImprimirCodigoBarras_Click(object sender, System.EventArgs e) { CodigoBarras codigoBarras; switch (cboCodigoBarras.SelectedIndex) { case 0: codigoBarras = new EAN8(); break; case 1: codigoBarras = new EAN13();break; case 2: codigoBarras = new CODABAR();break; case 3: codigoBarras = new CODE39();break; case 4: codigoBarras = new CODE93();break; case 5: codigoBarras = new CODE128();break; case 6: codigoBarras = new ISBN();break; case 7: codigoBarras = new ITF();break; case 8: codigoBarras = new MSI();break; case 9: codigoBarras = new PDF417();break; case 10: codigoBarras = new PLESSEY();break; case 11: codigoBarras = new UPCA();break; case 12: codigoBarras = new UPCE();break; default: codigoBarras = new EAN13();break; } codigoBarras.Codigo = txtCodigoBarras.Text; // fonte if (rbtFonteNormal.Checked) { codigoBarras.Fonte = CodigoBarras.FonteLegenda.Normal; } else { codigoBarras.Fonte = CodigoBarras.FonteLegenda.Condensada; } // largura das barras if (rbtFina.Checked) { codigoBarras.Largura = CodigoBarras.LarguraBarra.Fina; } else if(rbtMedia.Checked) { codigoBarras.Largura = CodigoBarras.LarguraBarra.Media; } else { codigoBarras.Largura = CodigoBarras.LarguraBarra.Grossa; } // posicao legenda if (rbtCaracteresAbaixoCodigo.Checked) { codigoBarras.Posicao = CodigoBarras.PosicaoLegenda.Abaixo; } else if(rbtCaracteresAcimaCodigo.Checked) { codigoBarras.Posicao = CodigoBarras.PosicaoLegenda.Acima; } else if(rbtCaracteresAcimaAbaixoCodigo.Checked) { codigoBarras.Posicao = CodigoBarras.PosicaoLegenda.AcimaAbaixo; } else { codigoBarras.Posicao = CodigoBarras.PosicaoLegenda.Nenhuma; } try { miniPrinter.Imprimir(codigoBarras); } catch (BematechException erro) { MessageBox.Show(erro.Message, "TestMiniPrinter", MessageBoxButtons.OK, MessageBoxIcon.Error); } }