private void textBox1_TextChanged(object sender, EventArgs e) { string[] barcode = new string[3]; barcode[0] = bar_txt.Text; barcode = ClsBuyingForm.BuyProIMG(barcode); if (IMG == null) { prod_pic.Image = null; } else { prod_name_txt.Text = barcode[1]; price_txt.Text = barcode[2]; prod_name_txt.ReadOnly = true; price_txt.ReadOnly = true; MemoryStream mms = new MemoryStream(IMG); prod_pic.Image = Image.FromStream(mms); } }
private void button5_Click(object sender, EventArgs e) { bar_txt.ReadOnly = false; prod_name_txt.ReadOnly = false; price_txt.ReadOnly = false; totla_txt.ReadOnly = false; if (bar_txt.Text != "" && prod_name_txt.Text != "" && price_txt.Text != "" && qty_txt.Text != "" && totla_txt.Text != "") { weight *= float.Parse(qty_txt.Text); ClsBuyingForm.Addcartimg(int.Parse(qty_txt.Text), prod_name_txt.Text, float.Parse(price_txt.Text), float.Parse(totla_txt.Text), weight, bar_txt.Text, IMG); ActiveControl = bar_txt; bar_txt.Text = ""; prod_name_txt.Text = ""; price_txt.Text = ""; qty_txt.Text = ""; totla_txt.Text = ""; prod_pic.Image = null; } }