private void btnThem_Click(object sender, EventArgs e) { FormThoGiaCong_AddUpd form = new FormThoGiaCong_AddUpd(); DialogResult dr = form.ShowDialog(); dataGridView.DataSource = ThoGiaCong_bus.LayTatCa(); }
private void btnSua_Click(object sender, EventArgs e) { if (txtMaTho.Text.CompareTo("") == 0) { MessageBox.Show("Vui lòng chọn dòng dữ liệu muốn Sửa !"); } else { ThoGiaCong_DTO tho = new ThoGiaCong_DTO(); tho.MaTho = Int16.Parse(txtMaTho.Text); tho.TenTho = txtTenTho.Text; tho.DiaChi = txtDiaChi.Text; tho.SDT = txtSodt.Text; FormThoGiaCong_AddUpd form = new FormThoGiaCong_AddUpd(tho); DialogResult dr = form.ShowDialog(); dataGridView.DataSource = ThoGiaCong_bus.LayTatCa(); } }