private void btnDM_Click(object sender, EventArgs e) { Button btnDM = sender as Button; TextBox txt = sender as TextBox; string MaNuoc = ((sender as Button).Tag as NUOC).MANUOC; if (hd.KTraNuocTonTai(ma, MaNuoc) == true) { hd.ThemNuocVaoHD(ma, MaNuoc, 1, nuoc.GetDonGiaNuoc(MaNuoc)); dgvCTHD.DataSource = hd.GetCTHD(ma); txtTongTien.Text = hd.TinhTong(ma).ToString(); } else { int sl = hd.GetSL(ma, MaNuoc) + 1; hd.CapNhatSL(ma, MaNuoc, sl); dgvCTHD.DataSource = hd.GetCTHD(ma); txtTongTien.Text = hd.TinhTong(ma).ToString(); } }