C#nedir?com Homepage
Forum Home Forum Home > ASP.NET > ASP.NET
  New Posts New Posts RSS Feed - Seri barkod nasıl yazdırılır.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Seri barkod nasıl yazdırılır.

 Post Reply Post Reply
   

Author
Message
potenza View Drop Down
Newbie
Newbie


Joined: 07 Ocak 2006
Location: Türkiye
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote potenza Quote  Post ReplyReply Direct Link To This Post Topic: Seri barkod nasıl yazdırılır.
    Posted: 20 Mayıs 2019 at 17:04
Veritabanındaki kayıtlardan seçtiğim ürünün barkodunu yazıcıdan çıktı alabiliyorum (x ayakkabının mavi 36 numarası) gibi

fakat yapmak istediğim dropdownlist ten X ayakkabı seçilince ona ait tüm renk ve bedenleri seri olarak barkod yazıcıdan çıkartmak istiyorum. yazdığım işlemde tek barkoda üst üse basıyor. yardımcı olursanız sevinirim.





protected void BtnTopluYazdir_Click(object sender, EventArgs e)
    {

        PrintDocument pd = new PrintDocument();
        pd.PrinterSettings.PrinterName = "Argox A-200 PPLB";
        pd.PrintPage += new PrintPageEventHandler(yazdirBarkodToplu);
        pd.Print();


    }




public void yazdirBarkodToplu(object sender, PrintPageEventArgs e)

    {

        secilenId = int.Parse(DropUrunler.SelectedItem.Value);

        var barkodlar = from i in db.Barkodlar.ToList()
                            where i.StokKartId == secilenId
                            select i;

            foreach (var item in barkodlar)
            {

          
            BarkodUrunAdi = DropUrunler.SelectedItem.Text;

            var OzellikBul = from i in db.UrunOzellikleri.ToList()
                                 where i.id == item.UrunOzellikId
                                 select i;


               foreach (var item2 in OzellikBul)
               {

                    BarodOzellikAdi = item2.VaryasyonOzellik1Adi + " " + item2.VaryasyonOzellik2Adi;

                    Int32 barcodeHeight = 40, barcodeWidth = 150;
                    Bitmap bmpBarcode;
                    bmpBarcode = new Bitmap(barcodeWidth, barcodeHeight);
                    bmpBarcode.SetResolution(300, 100);

                    StringFormat stringFormat = new StringFormat();
                    stringFormat.Alignment = StringAlignment.Center;
                    stringFormat.LineAlignment = StringAlignment.Center;

                   
                    clsBarCode barcodeGenerator = new clsBarCode();
                    String barcodeReadyData = barcodeGenerator.Code128(item.Barkod.ToString(), false);

                    PrivateFontCollection myFonts;
                    FontFamily family = LoadFontFamily(Server.MapPath("fonts/IDAUTOMATIONSC128XXL.TTF"), out myFonts);
                    using (Font drawFont = new Font(family, 12), readableFont = new Font("Arial", 10, FontStyle.Regular))
                    {
                        using (SolidBrush drawBrush = new SolidBrush(Color.Black))
                        {

                            e.Graphics.FillRectangle(new SolidBrush(Color.White), new RectangleF(0, 0, bmpBarcode.Width, bmpBarcode.Height));
                            e.Graphics.DrawString(BarkodUrunAdi, readableFont, drawBrush, new RectangleF(0, 0, barcodeWidth, 14), stringFormat);
                            e.Graphics.DrawString(BarodOzellikAdi, readableFont, drawBrush, new RectangleF(0, 15, barcodeWidth, 20), stringFormat);
                            e.Graphics.DrawString(barcodeReadyData, drawFont, drawBrush, new RectangleF(0, 50, barcodeWidth, barcodeHeight), stringFormat);
                            e.Graphics.DrawString(BarkodEtiket, readableFont, drawBrush, new RectangleF(0, 85, barcodeWidth, barcodeHeight), stringFormat);
                            e.Graphics.DrawString("Logo", readableFont, drawBrush, new RectangleF(150, 85, barcodeWidth, 20), stringFormat);

                        }


                    }
               }
            }

       
      


    }

Back to Top
 Post Reply Post Reply
  Share Topic   
   


Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.