private void frmKhoa_Load(object sender, EventArgs e) { if (!isAdd_) { KhoaDAO dao = new KhoaDAO(); var khoa = dao.GetSingleByID(maKhoa_); txtMaKhoa.Enabled = false; txtMaKhoa.Text = maKhoa_; txtTenKhoa.Text = khoa.TenKhoa; txtDiaChi.Text = khoa.DiaChi; txtSDT.Text = khoa.SoDienThoai; } }
private void frmKhoa_Load(object sender, EventArgs e) { if (!isAdd_) { KhoaDAO dao = new KhoaDAO(); var info = dao.GetSingleByID(maKhoa_); if (info != null) { txtMaKhoa.Text = info.MaKhoa.Trim(); txtTenKhoa.Text = info.TenKhoa.Trim(); txtDiaChi.Text = info.DiaChi.Trim(); txtSoDienThoai.Text = info.SoDienThoai.Trim(); } else { this.Close(); } } }