private void butcapnhapHD_Click(object sender, EventArgs e) { var HoaDon_BLL = new HoaDon_BLL(); string MaKH = comboBox1.SelectedValue.ToString(); string MaNV = cbnhanvien.SelectedValue.ToString(); datahoadon.DataSource = HoaDon_BLL.HoaDon_Update(txtsoHD.Text, MaKH, MaNV, DateTime.Parse(dateTimePicker1.Value.ToString()), "Khó Quá", "Tiền Mặt"); datahoadon.DataSource = HoaDon_BLL.HoaDon_SelectPROVIP(); txtsoHD.Enabled = false; foreach (DataRow dr in CTHD.Rows) { var CTHD_BLL = new CTHD_BLL(); dataCTHD.DataSource = CTHD_BLL.CTHD_Update(txtsoHD.Text, dr[0].ToString(), int.Parse(txtsoluong.Text)); dataCTHD.DataSource = CTHD_BLL.CTHD_SelectPROVIP(); } foreach (DataRow dr in CTHD.Rows) { var CTHD_BLL = new CTHD_BLL(); dataCTHD.DataSource = CTHD_BLL.CTHD_Delete(dr[0].ToString()); dataCTHD.DataSource = CTHD_BLL.CTHD_SelectPROVIP(); } CTHD.Clear(); CTHD_HOADON_Load(sender, e); }
private void butxoahd_Click(object sender, EventArgs e) { var HoaDon_BLL = new HoaDon_BLL(); HoaDon_BLL.HoaDon_Delete(txtsoHD.Text); foreach (DataRow dr in CTHD.Rows) { var CTHD_BLL = new CTHD_BLL(); dataCTHD.DataSource = CTHD_BLL.CTHD_Delete(dr[0].ToString()); dataCTHD.DataSource = CTHD_BLL.CTHD_SelectPROVIP(); } CTHD.Clear(); CTHD_HOADON_Load(sender, e); }