public void UpdateProducts(Products_DTO pr) { conn.Connect(); string a = "UpdateProducts('" + pr.Id + "','" + pr.TenSanPham + "'," + pr.Gia + ",'" + pr.DanhMuc + "')"; conn.KetNoi(a); }
public void RemoveProducts(Products_DTO pr) { conn.Connect(); string a = "RemoveProducts('" + pr.Id + "')"; conn.KetNoi(a); }
private void btnXoa_Click(object sender, EventArgs e) { Products_DTO tg = LayTTSP(); btnSua.Enabled = true; btnThem.Enabled = true; btnHuy.Enabled = false; btnLuu.Enabled = false; if (MessageBox.Show("Bạn có muốn xóa Sản Phẩm: " + txtTenSanPham.Text + " không ?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { RemoveGridView(); dgBUS.RemoveProducts(tg); Product_Load(sender, e); } catch (Exception) { MessageBox.Show("Mời bạn nhập Chọn Sản phẩm cần xóa!!!!!"); } } }