private void QLMon_Loai_Load(object sender, EventArgs e) { //load danh sach loai mon dataGridView1.DataSource = LoaiMon_BUS.LoadDSLoaiMon(); bingdingLoaiMon(); //do du lieu vao combobox comboBoxThuocLoai.DataSource = LoaiMon_BUS.DSMaLoaiMon(); comboBoxThuocLoai.DisplayMember = "Maloaimon"; //load danh sach mon an dataGridView2.DataSource = Mon_BUS.LoadDSMon(); bingdingMon(); }
private void QLTiec_Load(object sender, EventArgs e) { //chao labelChao.Text = DangNhap._manhanvien; //hien thi ds mon dataGridViewDSMon.DataSource = Mon_BUS.LoadDSMon(); //hien thi ds tiec Tiec_BUS t = new Tiec_BUS(); dataGridViewDSTiec.DataSource = t.LoadTiec(); //bingding bingding(); }
private void btnXoaMon_Click(object sender, EventArgs e) { string mamon = txtMaMon.Text; string tenmon = txtTenMon.Text; float dongia = float.Parse(txtDonGia.Text); string loai = comboBoxThuocLoai.Text; Mon_DTO mon = new Mon_DTO(mamon, tenmon, dongia, loai); bool kt = Mon_BUS.XoaMon(mon); if (kt == false) { MessageBox.Show("Thao tác không thành công!"); return; } else { MessageBox.Show("Xóa món thành công!"); dataGridView2.DataSource = Mon_BUS.LoadDSMon(); bingdingMon(); } }
private void btnDanhSachMon_Click(object sender, EventArgs e) { dataGridView2.DataSource = Mon_BUS.LoadDSMon(); bingdingMon(); }