private void FrnHoaDonBan_Load(object sender, EventArgs e) { btnThem.Enabled = true; btnLuu.Enabled = false; btnXoa.Enabled = false; btnIn.Enabled = false; txtMHB.ReadOnly = true; txttnv.ReadOnly = true; txttkh.ReadOnly = true; txtdc.ReadOnly = true; txtdt.ReadOnly = true; txtts.ReadOnly = true; txtdg.ReadOnly = true; txtthanhtien.ReadOnly = true; txttongtien.ReadOnly = true; txtgg.Text = "0"; txttongtien.Text = "0"; DAO.FillDataToCombo("SELECT Makhach, Tenkhach FROM KhachHang", cbomkh, "Makhach", "Makhach"); cbomkh.SelectedIndex = -1; DAO.FillDataToCombo("SELECT MaNV, TenNV FROM NhanVien", cbomnv, "MaNV", "MaNV"); cbomnv.SelectedIndex = -1; DAO.FillDataToCombo("SELECT Masach, Tensach FROM KhoSach", cboms, "Masach", "Masach"); cboms.SelectedIndex = -1; //Hiển thị thông tin của một hóa đơn được gọi từ form tìm kiếm if (txtMHB.Text != "") { Load_ThongtinHD(); btnXoa.Enabled = true; btnIn.Enabled = true; } Load_DataGridViewChitiet(); }
private void FrmNhanVien_Load(object sender, EventArgs e) { LoadDataToGridview(); fillDataToCombo(); DAO.FillDataToCombo("SELECT MaCongViec FROM CongViec", cbomcv, "MaCongViec", "MaCongViec"); cbomcv.SelectedIndex = -1; }
public void LoadDataToGridview() { string sql = "SELECT * FROM TacGia"; TacGia = DAO.GetDataToTable(sql); dataGridView1.DataSource = TacGia; DAO.FillDataToCombo("SELECT GioiTinh FROM TacGia", cboGT, "GioiTinh", "GioiTinh"); cboGT.SelectedIndex = -1; }
private void FrmKhoSach_Load(object sender, EventArgs e) { LoadDataToGridview(); DAO.FillDataToCombo("SELECT MaSach, TenSach FROM KhoSach", cboMS, "MaSach", "MaSach"); cboMS.SelectedIndex = -1; DAO.FillDataToCombo("SELECT MaLoaiSach, TenLoaiSach FROM LoaiSach", cboMLS, "MaLoaiSach", "MaLoaiSach"); cboMLS.SelectedIndex = -1; DAO.FillDataToCombo("SELECT MaTG, TenTG FROM TacGia", cboMTG, "MaTG", "MaTG"); cboMTG.SelectedIndex = -1; DAO.FillDataToCombo("SELECT MaNXB, TenNXB FROM NhaXuatBan", cboMNXB, "MaNXB", "MaNXB"); cboMNXB.SelectedIndex = -1; DAO.FillDataToCombo("SELECT MaLinhVuc, TenLinhVuc FROM LinhVuc", cboMLV, "MaLinhVuc", "MaLinhVuc"); cboMLV.SelectedIndex = -1; DAO.FillDataToCombo("SELECT MaNgonNgu, TenNgonNgu FROM NgonNgu", cboMNN, "MaNgonNgu", "MaNgonNgu"); cboMNN.SelectedIndex = -1; }
private void FrmMatSach_Load(object sender, EventArgs e) { LoadDataToGridview(); DAO.FillDataToCombo("SELECT MaSach, TenSach FROM KhoSach", cmbmasach, "MaSach", "MaSach"); cmbmasach.SelectedIndex = -1; }
private void cbomhd1_DropDown(object sender, EventArgs e) { DAO.FillDataToCombo("SELECT SoHDB FROM HoaDonBan", cbomhd1, "SoHDB", "SoHDB"); cbomhd1.SelectedIndex = -1; }
private void cbomhdb_DropDown(object sender, EventArgs e) { DAO.FillDataToCombo("SELECT SoHDN FROM HoaDonNhap", cbomhdb, "SoHDN", "SoHDN"); cbomhdb.SelectedIndex = -1; }