示例#1
0
        private void TxtKK_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar==(char)Keys.Return)
            {
                Islem Isl = new Islem();
                QRkod.Karekod qrk = new Karekod();
               qrk.body = Isl.bodyYap(TxtKK.Text.Trim());
               qrk.gtin= Isl.cozumle(qrk.body).gtin;
                qrk.sn = Isl.cozumle(qrk.body).sn;
                qrk.xd = Isl.cozumle(qrk.body).xd;
                qrk.bn = Isl.cozumle(qrk.body).bn;

                TxtBN.Text = qrk.bn;
                TxtGTIN.Text = qrk.gtin;
                TxtSN.Text = qrk.sn;
                TxtXD.Text= String.Format("{0:yyyy-MM-dd}", qrk.xd);
            }
        }
示例#2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Islem Isl = new Islem();
            QRkod.Karekod qrk = new Karekod();
            con.Open();
            for (int i = 0; i < lb1.Items.Count; i++)
            {

                qrk.body = Isl.bodyYap(lb1.Items[i].ToString());
                qrk.gtin = Isl.cozumle(qrk.body).gtin;
                qrk.gtin = qrk.gtin.Substring(1, 13);
                qrk.sn = Isl.cozumle(qrk.body).sn;
                qrk.xd = Isl.cozumle(qrk.body).xd;
                qrk.bn = Isl.cozumle(qrk.body).bn;
                OleDbCommand komut = new OleDbCommand(@"INSERT INTO URUNGIR (GTIN, SN, XD, BN) VALUES ('"+qrk.gtin+"','"+qrk.sn+"','"+ qrk.xd+"','"+qrk.bn+"')", con);

                try
                {

                komut.ExecuteNonQuery();
                }
                catch (Exception)
                {

                    //throw;
                 TxtKK.Text +=  "\n"+ qrk.sn+"\n";
                }
            }
            con.Close();
            Listele();
        }