private void BttnGetItemNumber_Click(object sender, EventArgs e) { if (txtbxItemNumber.Text.Length < 1) { FrmLabelPrinter.ActiveForm.Size = new Size(655, 110); MessageBox.Show("Enter item number please.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (txtbxSerialNumber.Text.Length >= 1 && txtbxItemNumber.Text.Length >= 1) { FrmLabelPrinter.ActiveForm.Size = new Size(685, 560); lblQRCode.Visible = true; pctrbxSerialNumber.Visible = true; pctrbxQRCode.Visible = true; bttnPrint.Visible = true; Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pctrbxSerialNumber.Image = barcode.Draw(txtbxSerialNumber.Text, 53); Zen.Barcode.CodeQrBarcodeDraw qrcode = Zen.Barcode.BarcodeDrawFactory.CodeQr; barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pctrbxItemNumber.Image = barcode.Draw(txtbxItemNumber.Text, 53); pctrbxQRCode.Image = qrcode.Draw(txtbxItemNumber.Text + "\n" + txtbxSerialNumber.Text, 5); } else { FrmLabelPrinter.ActiveForm.Size = new Size(670, 230); txtbxSerialNumber.Visible = true; lblSerialNumber.Visible = true; pctrbxItemNumber.Visible = true; bttnGetSerialNumber.Visible = true; Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pctrbxItemNumber.Image = barcode.Draw(txtbxItemNumber.Text, 53); } }
private void button1_Click(object sender, EventArgs e) { Zen.Barcode.Code128BarcodeDraw brCode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox1.Image = brCode.Draw(textBox1.Text, 120); pictureBox1.Image.Save("D:\\zaheer.barcode.jpg"); }
private void printDocument1_PrintPage(object sender, PrintPageEventArgs e) { Zen.Barcode.Code128BarcodeDraw bc = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; // MessageBox.Show(txtBarcode.Text); var picImage = bc.Draw(txtBarcode.Text, 25); // e.Graphics.DrawImage(pictureBox1.Image, new PointF(100,100)); pictureBox1.Image = picImage; // Print in the upper left corner at its full size. e.Graphics.DrawImage(picImage, //e.PageBounds.Left + (e.MarginBounds.Width / 2) - (picImage.Width / 2), 10, ((e.PageBounds.Width / 2)) - (picImage.Width / 2), 65, picImage.Width, picImage.Height); float height = 0; height = picImage.Height + 25; using (var sf = new StringFormat()) { if (lbhoten.Text == "") { lbhoten.Text = "DEMO"; } sf.LineAlignment = StringAlignment.Center; sf.Alignment = StringAlignment.Center; e.Graphics.DrawString(txtBarcode.Text + " " + lbhoten.Text + "\n" + lbG.Text + "\n" + lbX.Text, new Font(this.Font.Name, 9), new SolidBrush(txtBarcode.ForeColor), e.PageBounds.Left + (e.PageBounds.Width / 2), 30, sf); } }
public PDF(string info) { Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; Image imgBarcode = barcode.Draw(info, 50); imgBarcode.Save(Paths.CODES_FOLDER + "bar.png"); }
public void PrintGrid(string gridPath, Zen.Barcode.Code128BarcodeDraw barcode, string invoiceNo, DataTable dtheadNew, DataRow drhead, DataTable gridTableRight, DataTable gridTableLeft) { LocalReport localReport = new LocalReport(); localReport.ReportPath = Server.MapPath(gridPath); var image = barcode.Draw(invoiceNo, 50, 2); byte[] arr; using (var memStream = new MemoryStream()) { image.Save(memStream, ImageFormat.Jpeg); arr = memStream.ToArray(); } drhead["Barcode"] = arr; dtheadNew.ImportRow(drhead); localReport.DataSources.Add(new ReportDataSource("GridHead", dtheadNew)); if (gridTableLeft != null && gridTableRight != null) { localReport.DataSources.Add(new ReportDataSource("Grid200BodyRight", gridTableRight)); } localReport.DataSources.Add(new ReportDataSource("Grid200BodyLeft", gridTableLeft)); string printerName = "Microsoft Print to PDF"; localReport.PrintToPrinter(printerName); dtheadNew.Rows.Clear(); }
private void Generate_Click(object sender, EventArgs e) { string barcodeTest = txtBarcode.Text; Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; var barcodeImage = barcode.Draw(barcodeTest, 60); var resultImage = new Bitmap(barcodeImage.Width, barcodeImage.Height + 20); // 20 is bottom padding, adjust to your text using (var graphics = Graphics.FromImage(resultImage)) using (var font = new Font("Consolas", 12)) using (var brush = new SolidBrush(Color.Black)) using (var format = new StringFormat() { Alignment = StringAlignment.Center, // Also, horizontally centered text, as in your example of the expected output LineAlignment = StringAlignment.Far }) { graphics.Clear(Color.White); graphics.DrawImage(barcodeImage, 0, 0); graphics.DrawString(txtBarcode.Text, font, brush, resultImage.Width / 2, resultImage.Height, format); } pictureBox1.Image = resultImage; txtBarcode.Clear(); txtBarcode.Focus(); }
private void btnBarkod_Click(object sender, EventArgs e) { //Framewokümüzü kullanarak borcode oluşturmasını istiyoruz Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; //textbox’a girdiğimiz textimizin barcode’unu picturebox’ta gösteriyoruz. pbBarkod.Image = barcode.Draw(txtAra.Text, 50); }
private void btn_barcode_Click(object sender, EventArgs e) { pictureBox1.Visible = true; pictureBox1.BackColor = FrmAddBarcode.DefaultBackColor; Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; var barcodeImage = barcode.Draw(txt_barcode.Text, 70); var resultImage = new Bitmap(barcodeImage.Width, barcodeImage.Height + 25); using (var graphics = Graphics.FromImage(resultImage)) using (var font = new Font("Monaco", 12)) using (var brush = new SolidBrush(Color.Black)) using (var format = new StringFormat() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Far }) { graphics.Clear(Color.White); graphics.DrawImage(barcodeImage, 0, 0); graphics.DrawString(txt_barcode.Text, font, brush, resultImage.Width / 2, resultImage.Height, format); } pictureBox1.Image = resultImage; label2.Visible = true; label3.Visible = true; label4.Visible = true; maskedTextBox1.Visible = true; btn_printBarcod.Visible = true; }
public void GenerateBarcode() { // To uniqe the bar code int?maxBarcodeDeviceID = db.devices_tb.Max(u => u.ID); //Select(u => u.ID).Max(); // For first barcode maxBarcodeDeviceID = maxBarcodeDeviceID == null ? 0 : maxBarcodeDeviceID; maxBarcodeDeviceID += 1; string myBarCode = string.Empty; // Get the first two characters from debended items and get its ASCII code using "Convert.ToInt32" myBarCode = myBarCode //+ maxBarcodeDeviceID + Convert.ToInt32(cmbLab.Text[0]) + Convert.ToInt32(cmbLab.Text[1]) + Convert.ToInt32(cmbExperiment.Text[0]) + Convert.ToInt32(cmbExperiment.Text[1]) + Convert.ToInt32(txtDeviceName.Text[0]) + Convert.ToInt32(txtDeviceName.Text[1]) + maxBarcodeDeviceID; myBarCode = myBarCode.Substring(myBarCode.Length - 13); //if (myBarCode[0] == '0') // myBarCode = '1' + myBarCode.Substring(1); txtBarcode.Text = myBarCode; Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; picBarcode.Image = barcode.Draw(myBarCode, 50); }
private void YeniBarkodMu() { if (txtBarkod != null) { var urun = new UrunRepo().GetAll(x => x.KoliBarkod == txtBarkod.Text); if (urun.Count < 1) { DialogResult dialogResult = MessageBox.Show($"{txtBarkod.Text} barkodlu ürün kayıtlı değil. Eklemek ister misiniz ?", "Uyarı!", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { if (satisDialogForm == null || satisDialogForm.IsDisposed) { satisDialogForm = new SatisDialog { malkabulForm = this }; } satisDialogForm.Show(); } } Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pbBarkod.Image = barcode.Draw(seciliBarkod, 100, 2); } }
private void txtBarcodeProduto_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { Objeto objeto = new Objeto { Barcode = txtBarcodeProduto.Text }.ObterObjeto(); if (objeto != null) { uiTxtNomeProduto.Text = objeto.Nome; txtBarcodeProduto.Focus(); Zen.Barcode.Code128BarcodeDraw barcodeDraw = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox1.Image = barcodeDraw.Draw(objeto.Barcode, pictureBox1.Height); objetoAtual = new Objeto { Nome = objeto.Nome, Barcode = objeto.Barcode }; txtBarcodeProduto.Text = ""; } else { uiTxtNomeProduto.Text = string.Empty; txtBarcodeProduto.Text = string.Empty; pictureBox1.Image = null; txtBarcodeProduto.Focus(); } } }
private void frmDevice_Load(object sender, EventArgs e) { cmbEmployee.DataSource = db.respons.Select(u => u.name).ToList(); //cmbExperiment.DataSource = db.exps.Select(u => u.exp_name).ToList(); //cmbExperimentNum.DataSource = db.exps.Select(u => u.exp_num); cmbLab.DataSource = db.labs.Select(u => u.lab_name).ToList(); cmbStatus.DataSource = db.device_status.Select(u => u.Status).ToList(); if (currentDevice == null) { ClearControls(); ControlStatus(false); ToolStripButtonStatus(Status.Reset); } else { ClearControls(); ControlStatus(true); btnDisplayBarcode.Enabled = false; ToolStripButtonStatus(Status.Edit); pnlOpenSearch.Enabled = true; Search(); txtDeviceName.Text = currentDevice.device_name; txtBarcode.Text = currentDevice.device_barcode.ToString(); cmbLab.SelectedItem = currentDevice.lab_name; cmbExperiment.SelectedItem = currentDevice.exp_name; cmbExperimentNum.SelectedItem = currentDevice.exp_num; cmbStatus.SelectedItem = currentDevice.device_status; cmbEmployee.SelectedItem = currentDevice.respon; txtDescription.Text = currentDevice.description; Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; picBarcode.Image = barcode.Draw(currentDevice.device_barcode.ToString(), 50); } }
private void btn_taoma_Click(object sender, EventArgs e) { string barcode = txt_ma.Text; Zen.Barcode.Code128BarcodeDraw brCode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; var barcodeImage = brCode.Draw(barcode, 80, 2); var resultImage = new Bitmap(barcodeImage.Width, barcodeImage.Height + 20); // 20 is bottom padding, adjust to your text using (var graphics = Graphics.FromImage(resultImage)) using (var font = new System.Drawing.Font("Consolas", 20)) using (var brush = new SolidBrush(Color.Black)) using (var format = new StringFormat() { Alignment = StringAlignment.Center, // Also, horizontally centered text, as in your example of the expected output LineAlignment = StringAlignment.Far }) { graphics.Clear(Color.White); graphics.DrawImage(barcodeImage, 0, 0); graphics.DrawString(barcode, font, brush, resultImage.Width / 2, resultImage.Height + 10, format); } img_barcode.Image = resultImage; }
private void button1_Click(object sender, EventArgs e) { int Index = comboBox1.SelectedIndex; switch (Index) { case 0: QRCoder.QRCodeGenerator QG = new QRCoder.QRCodeGenerator(); var Text = QG.CreateQrCode(textBox1.Text, QRCoder.QRCodeGenerator.ECCLevel.H); var Code = new QRCoder.QRCode(Text); pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; pictureBox1.Image = Code.GetGraphic(50); break; case 1: try { Zen.Barcode.Code128BarcodeDraw brCode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox1.Image = brCode.Draw(textBox1.Text, 40); } catch (Exception) { MessageBox.Show("Error ?"); } break; } }
private void Resi_Load(object sender, EventArgs e) { hitung hasil = new hitung(); int panjang, lebar, tinggi, berat; panjang = int.Parse(Form1.report_panjangbarang); lebar = int.Parse(Form1.report_lebarbarang); tinggi = int.Parse(Form1.report_tinggibarang); berat = int.Parse(Form1.report_beratbarang); data_pengirim.Text = Form1.report_namapengirim + ", " + Form1.report_nopengirim; data_penerima.Text = Form1.report_namapenerima + ", " + Form1.report_nopenerima; alamat_penerima.Text = Form1.report_kodepospenerima + ", " + Form1.report_kecamatanpenerima + ", " + Form1.report_kotapenerima + ", " + Form1.report_provinsipenerima + ", " + Form1.report_alamatpenerima; jenis_pengiriman.Text = hasil.kode(Form1.report_jenispengiriman); berat_barang.Text = Form1.report_beratbarang + " KG"; txt_deskripsi.Text = Form1.report_desbarang + " " + Form1.report_is_pecahbelah; ongkir.Text = (hasil.ongkir(panjang, lebar, tinggi, berat, Form1.report_kotapenerima)).ToString("C") + ",00"; b_asuransi.Text = (hasil.asuransi(Form1.report_jenispengiriman)).ToString("C") + ",00"; total.Text = ((hasil.ongkir(panjang, lebar, tinggi, berat, Form1.report_kotapenerima)) + (hasil.asuransi(Form1.report_jenispengiriman))).ToString("C") + ",00"; Zen.Barcode.Code128BarcodeDraw Barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; barcode_img.Image = Barcode.Draw(resi_id.Text, 4000); Zen.Barcode.CodeQrBarcodeDraw Qrcode = Zen.Barcode.BarcodeDrawFactory.CodeQr; qrcode_img.Image = Qrcode.Draw(resi_id.Text, 1); }
private void btnGenerate_Click(object sender, EventArgs e) { string barCode = txtBarCode.Text; // QR Code if (ckQR.Checked) { QRCoder.QRCodeGenerator gr = new QRCoder.QRCodeGenerator(); var myData = gr.CreateQrCode(barCode, QRCoder.QRCodeGenerator.ECCLevel.H); var code = new QRCoder.QRCode(myData); pictureBox1.Image = code.GetGraphic(50); } else { // Bar Code try { Zen.Barcode.Code128BarcodeDraw barCodeObj = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox1.Image = barCodeObj.Draw(barCode, 60); } catch (Exception ex) { Console.WriteLine(ex.Message); } } }
private void Btn_barcode_Click(object sender, EventArgs e) { Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox1.Image = barcode.Draw(txt_barcode.Text, 50); //Codigo de barras solamente usando zXING //BarcodeWriter codigo = new BarcodeWriter() { Format = BarcodeFormat.CODE_128 }; //pictureBox1.Image = codigo.Write(txt_encode.Text); }
private void generateCodes(string codeText) { Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; picBarCode.Image = barcode.Draw(codeText, 50); Zen.Barcode.CodeQrBarcodeDraw qrcode = Zen.Barcode.BarcodeDrawFactory.CodeQr; picQRCode.Image = qrcode.Draw(codeText, 50); }
private void btnQr_Click(object sender, EventArgs e) { textqr = cbxCat.SelectedValue + "-" + cbxType.SelectedValue + "-" + cbxValue.SelectedValue + "-" + cbxDiff.SelectedValue; Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox3.Image = barcode.Draw(textqr, 50); Zen.Barcode.CodeQrBarcodeDraw qrcode = Zen.Barcode.BarcodeDrawFactory.CodeQr; pictureBox2.Image = qrcode.Draw(textqr, 50); }
private void button1_Click(object sender, EventArgs e) { Zen.Barcode.Code128BarcodeDraw brc = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox1.Image = brc.Draw(guna2TextBox2.Text, 3000); barkod = guna2TextBox2.Text; ((Form1)Application.OpenForms["Form1"]).olustural = barkod; ((Form1)Application.OpenForms["Form1"]).olusturalekle(); }
private void EmployeeIDPrint_Load(object sender, EventArgs e) { try { DBConnect db = new DBConnect(); String q = "SELECT * FROM employee WHERE employeeNo ='" + lblEmployeeID.Text + "'"; MySqlCommand cmd = new MySqlCommand(q, db.con); MySqlDataReader r = cmd.ExecuteReader(); if (r.HasRows) { while (r.Read()) { //lblEmployeeName.Text = r[1].ToString(); //txtEmployeeNIC.Text = r[2].ToString(); //String date = r[3].ToString(); //txtDatetime.Value = Convert.ToDateTime(date); //txtEmployeeAddress.Text = r[4].ToString(); //txtContactNoHome.Text = r[5].ToString(); //txtContactNoMobile.Text = r[6].ToString(); //comboJobRole.SelectedItem = r[7].ToString(); lblEmployeeName.Text = r[1].ToString(); byte[] img = (byte[])(r[8]); if (img == null) { picEmployeepic.Image = null; } else { MemoryStream mstream = new MemoryStream(img); picEmployeepic.Image = System.Drawing.Image.FromStream(mstream); } } Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; picBarcode.Image = barcode.Draw(lblEmployeeID.Text, 25); } else { MessageBox.Show("No records found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } }
private void btBuscar_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(tbCodProduto.Text)) { MessageBox.Show("Preencha o Cód do Produto", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information); tbCodProduto.Focus(); } else if (string.IsNullOrEmpty(tbNumEtiquetas.Text)) { MessageBox.Show("Preencha o número de Etiquetas", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information); tbNumEtiquetas.Focus(); } else { DataTable dtRes = new DataTable(); dtRes = classbd.BuscaInfoEtiqueta(tbCodProduto.Text); if (dtRes.Rows.Count == 0) { MessageBox.Show("Não foi encontrado nenhuma Produto com o número: " + tbCodProduto.Text, "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); tbCodProduto.Clear(); tbCodProduto.Focus(); LimpaCampos(); } else { if (VerificaGtin(dtRes.Rows[0]["pro_barra"].ToString())) { lbCodigo.Text = dtRes.Rows[0]["pro_codigo"].ToString(); lbDescricao.Text = dtRes.Rows[0]["pro_resumo"].ToString().ToString(); lbGtin.Text = dtRes.Rows[0]["pro_barra"].ToString(); Image codbarrasCod = Code128Rendering.MakeBarcodeImage(dtRes.Rows[0]["pro_codigo"].ToString(), 2, false); pbCodProd.Image = codbarrasCod; pbCodProd.Image.Save(@"C:\Windows\Temp\CodProd.jpg"); string barCode = lbGtin.Text; Zen.Barcode.Code128BarcodeDraw brCode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pbGtin.Image = brCode.Draw(barCode, 60); pbGtin.Image.Save(@"C:\Windows\Temp\CodGtin.jpg"); } else { MessageBox.Show("Este Produto não tem o código GTIN-13 válido", "Atenção!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Atenção: ERRO", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void cusbarcode_TextChanged(object sender, EventArgs e) { try { conn = null; string asd = "Data Source=localhost;User ID=system;Password=oracle"; conn = new OracleConnection(asd); conn.Open(); string sql = "select * from CITYSMART.STOCKENTRY where item_barcode= '" + cusbarcode.Text + "' "; cmd = new OracleCommand(sql, conn); OracleDataReader myreader; // DataColumn reade; // DbDataReader reader; myreader = cmd.ExecuteReader(); if (myreader.Read()) { itemid.Text = (myreader["item_id"].ToString()); itemname.Text = (myreader["item_name"].ToString()); itemprice.Text = (myreader["sale_price"].ToString()); itemsize.Text = (myreader["item_size"].ToString()); itemmodel.Text = (myreader["item_model"].ToString()); itemcolor.Text = (myreader["item_color"].ToString()); quantity.Text = (myreader["quantity"].ToString()); purchace_price.Text = (myreader["purchace_price"].ToString()); try { string text1 = cusbarcode.Text; Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox1.Image = barcode.Draw(text1, 50); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } } cus_quantity.Text = "1"; conn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void PrintPreviewbutton_Click(object sender, EventArgs e) { finaltextBox.Text = (Convert.ToString(PatienttextBox.Text + " Rpt No.") + Convert.ToString(LabtextBox.Text).ToString()); // richTextBox1.Text = (Convert.ToInt32(textBox.Text) + Convert.ToInt32(textBox1.Text).ToString()); Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox.Image = barcode.Draw(finaltextBox.Text, 30); SharmaprintPreviewDialog.Document = SharmaprintDocument; SharmaprintPreviewDialog.ShowDialog(); }
private void uiTxtBarcode_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { Zen.Barcode.Code128BarcodeDraw barcodeDraw = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; picBarcode.Image = barcodeDraw.Draw(uiTxtBarcode.Text, picBarcode.Height); uiTxtNome.Focus(); } }
private void button6_Click(object sender, EventArgs e) { if (textBarcode.Text == "") { } else { Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox3.Image = barcode.Draw(textBarcode.Text, 50); } }
/*display product selected*/ public void display_product(Product product) { display_category.Text = (product.Categoryname); displaysupplier.Text = product.Suppliername; product_code.Text = product.Product_id; product_name.Text = product.Product_name; product_price.Text = product.Price.ToString(); product_count.Text = product.Product_count.ToString(); Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum;//get image barcodepictrue.Image = barcode.Draw(product_code.Text, 20); }
private void btnGen_Click(object sender, EventArgs e) { string myConnection = ConfigurationManager.ConnectionStrings["AMSDatabase"].ConnectionString; string Query = "select assettype, category, prefix from assetmanagement.categories where assettype ='" + cbAssetType.Text + "' ;"; MySqlConnection myConn = new MySqlConnection(myConnection); MySqlCommand cmdDatabase = new MySqlCommand(Query, myConn); MySqlDataReader myReader; try { myConn.Open(); myReader = cmdDatabase.ExecuteReader(); while (myReader.Read()) { try { String sName = myReader.GetString("prefix"); var chars = "0123456789"; var stringChars = new char[16]; var random = new Random(); for (int i = 0; i < stringChars.Length; i++) { stringChars[i] = chars[random.Next(chars.Length)]; } var finalString = new String(stringChars); string barcode2 = sName + "-" + finalString; //BARCODE GEN Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox1.Image = barcode.Draw(barcode2, 50); txtBarcode.Text = barcode2; btnPrintBC.Show(); txtBarcode.Show(); lblBarcode.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button2_Click(object sender, EventArgs e) { if (txtBarcode.Text == String.Empty) { MessageBox.Show("gib einen Text bitte ein"); } else { Zen.Barcode.Code128BarcodeDraw barecode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox1.Image = barecode.Draw(txtBarcode.Text, 180, 4); } }
private void opbilling_Load(object sender, EventArgs e) { try { auto_increment(); DateTime datetime = DateTime.Today; this.label11.Text = datetime.ToString("yyyy-MM-dd"); double a = Convert.ToInt32(label22.Text); double v = 0.05 * a; double t = a + v; label24.Text = v.ToString(); label32.Text = t.ToString(); Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox1.Image = barcode.Draw(label3.Text, 50); String spatientid = label3.Text; String constring = "datasource=localhost;port=3306;username=root;password=vijay"; MySqlConnection conDataBase = new MySqlConnection(constring); MySqlCommand cmdDataBase = new MySqlCommand("select o.Name,o.Age,o.Gender,p.AppWith from hospital.opinfo o inner join hospital.patientinfo p where o.PatientID=p.PatientID and o.PatientID ='" + spatientid + "';", conDataBase); MySqlDataReader myReader; try { conDataBase.Open(); myReader = cmdDataBase.ExecuteReader(); if (myReader.Read()) { String nameVal = myReader.GetString("Name"); label5.Text = nameVal; String ageVal = myReader.GetString("Age"); label7.Text = ageVal; String genderVal = myReader.GetString("Gender"); label12.Text = genderVal; String dateVal = myReader.GetString("AppWith"); label16.Text = dateVal; } else { MessageBox.Show("No record found in the database"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }