private void TableView_RowUpdated(object sender, DevExpress.Xpf.Grid.RowEventArgs e) { try { HDKGView row = (HDKGView)grid.SelectedItem; if (row == null) { return; } grid.RefreshData(); foreach (HopDongKyGui i in dc.HopDongKyGuis.Where(x => x.kgid == row.kgid)) { if (i != null) { i.BatDongSan = dc.BatDongSans.Single(x => x.bdsid == row.bdsid); i.NhanVien = dc.NhanViens.Single(x => x.nvid == row.nvid); i.KhachHang = dc.KhachHangs.Single(x => x.khid == row.khid); i.ngaybatdau = row.ngaybatdau.Date; if (i.ngayketthuc <= row.ngaybatdau) { MessageBox.Show("Ngày bắt đầu phải nhỏ hơn ngày kết thúc"); return; } i.ngayketthuc = row.ngayketthuc.Date; i.chiphidv = row.chiphidv; dc.SubmitChanges(); MessageBox.Show("Đã cập nhật thành công !"); } } grid.ItemsSource = new HDKGModelView().DSHDKG; } catch { return; } }
private void TableView_RowUpdated(object sender, DevExpress.Xpf.Grid.RowEventArgs e) { }