private void btnThem_Click(object sender, EventArgs e) { FormCTPhieuGiaCong_AddUpd form = new FormCTPhieuGiaCong_AddUpd(sophieugc); DialogResult dr = form.ShowDialog(); dataGridView.DataSource = ctphieugc_bus.LayTatCa(sophieugc); }
private void btnSua_Click(object sender, EventArgs e) { if (txtSoPhieugc.Text.CompareTo("") == 0) { MessageBox.Show("Vui lòng chọn dòng dữ liệu muốn Sửa !"); } else { CTGiaCong_DTO phieugc = new CTGiaCong_DTO(); phieugc.SoPhieuGiaCong = Int16.Parse(txtSoPhieugc.Text); phieugc.SoPhieuDV = Int16.Parse(txtSoPhieudv.Text); phieugc.STT = Int16.Parse(txtSTT.Text); phieugc.DonGia = Decimal.Parse(txtDonGia.Text); phieugc.SoLuong = Int16.Parse(txtSoLuong.Text); phieugc.ThanhTien = Decimal.Parse(txtThanhTien.Text); phieugc.MaTho = Int32.Parse(txtMaTho.Text); FormCTPhieuGiaCong_AddUpd form = new FormCTPhieuGiaCong_AddUpd(phieugc); DialogResult dr = form.ShowDialog(); dataGridView.DataSource = ctphieugc_bus.LayTatCa(sophieugc); } }