private void SuaBan_Load(object sender, EventArgs e) { BanHang.Model.Load load = new Model.Load(); DataTable dt = load.LoadKhuVucTheoMaKhuVuc(MaKhuVuc); lblKhuVuc.Text = dt.Rows[0][1].ToString(); DataTable dt1 = load.LoadBanAnTheoMaBan(MaBan); textBoxX1.Text = dt1.Rows[0][1].ToString(); }
private void buttonX1_Click(object sender, EventArgs e) { int MaBanTiep = Convert.ToInt32(comboTree1.SelectedValue.ToString()); HoaDon.model.Load load1 = new HoaDon.model.Load(); DataTable dt1 = load1.LoadHoaDonChuaThanhToanCanChon(MaBanTiep); if (dt1.Rows.Count == 0) { BanHang.Model.Load load = new Model.Load(); DataTable dt = load.LoadBanAnTheoMaBan(MaBanTiep); string Ten = dt.Rows[0][1].ToString(); BanHang.Model.Update update = new Model.Update(); update.UpdateChuyenBanAn(MaBanAn, MaBanTiep, Ten); this.Close(); } else { MessageBox.Show("Bàn đã có người ngồi"); } }