void LoadData() { try { dtThe = new DataTable(); dtThe.Clear(); DataSet dsThe = dbThe.LayThe(); dtThe = dsThe.Tables[0]; gcThe.DataSource = dtThe; dtDocGia = new DataTable(); dtDocGia.Clear(); DataSet dsDocGia = dbDocGia.LayDocGia(); dtDocGia = dsDocGia.Tables[0]; glueMaDG.DataSource = dtDocGia; glueMaDG.DisplayMember = "MaDG"; glueMaDG.ValueMember = "MaDG"; them = false; MaThe = ""; MaDG = ""; NgayLapThe = ""; NgayHetHan = ""; this.btnThem.Enabled = true; this.btnXoa.Enabled = true; this.btnInfor.Enabled = true; this.btnTable.Enabled = true; this.btnTroVe.Enabled = true; this.btnTable.Enabled = false; } catch (SqlException) { XtraMessageBox.Show("Không lấy được nội dung trong table The. Lỗi rồi!!!"); } }
void LoadData() { try { dtDocGia = new DataTable(); dtDocGia.Clear(); DataSet ds = dbDG.LayDocGia(); dtDocGia = ds.Tables[0]; gcDocGia.DataSource = dtDocGia; them = false; MaDG = ""; TenDG = ""; GioiTinh = true; NgaySinh = ""; CMND = ""; DiaChi = ""; SDT = ""; this.pic1.Image = null; this.pic1.BackgroundImage = null; this.btnThem.Enabled = true; this.btnXoa.Enabled = true; this.btnInfor.Enabled = true; this.btnTable.Enabled = true; this.btnTroVe.Enabled = true; this.btnTable.Enabled = false; } catch (SqlException) { XtraMessageBox.Show("Không lấy được nội dung trong table DocGia. Lỗi rồi!!!"); } }