private void btnChon_Click(object sender, EventArgs e) { eDuAn.TenDuAn = txtTenDuAn.Text; eDuAn.NgayBatDau = dtmNgayBatDau.Value; eDuAn.NgayKetThuc = dtmNgayKetThuc.Value; eDuAn.TrangThai = cboTrangThai.Text; eDuAn.TienDo = (int)nudTienDoHoanThanh.Value; eDuAn.DiaChi.soNha = txtSoNha.Text; eDuAn.DiaChi.thanhPho = cboThanhPho.Text; eDuAn.DiaChi.quanHuyen = cboQuanHuyen.Text; eDuAn.DiaChi.phuongXa = cboPhuongXa.Text; busDuAn.UpdateItem(eDuAn); this.Close(); }
private void btnChon_Click(object sender, EventArgs e) { int soLoi = 0; if (!CheckNgayKetThuc()) { soLoi++; } if (!CheckSoNha()) { soLoi++; } if (!CheckTenDuAn()) { soLoi++; } if (!CheckTienDoHoanThanh()) { soLoi++; } if (soLoi > 0) { txtSoNha1.Focus(); MessageBox.Show("Thong Tin Khong Hop Le"); return; } eDuAn.TenDuAn = txtSoNha1.Text; eDuAn.NgayBatDau = dtmNgayBatDau.Value; eDuAn.NgayKetThuc = dtmNgayKetThuc.Value; eDuAn.TrangThai = cboTrangThai.Text; eDuAn.TienDo = (int)nudTienDoHoanThanh.Value; eDuAn.DiaChi.soNha = txtTenDuAn.Text; eDuAn.DiaChi.thanhPho = cboThanhPho.Text; eDuAn.DiaChi.quanHuyen = cboQuanHuyen.Text; eDuAn.DiaChi.phuongXa = cboPhuongXa.Text; busDuAn.UpdateItem(eDuAn); this.Close(); }