private void SaveThongTinHoSo(long thongTinHoSoId, long khoaChaId, ChiTietHoSo value) { ThongTinHoSoEntity thongTinHoSoEntity = new ThongTinHoSoEntity(); thongTinHoSoEntity.ThongTinHoSoId = thongTinHoSoId; thongTinHoSoEntity.KhoaChaId = new long?(khoaChaId); thongTinHoSoEntity.ChiTietHoSo = JsonConvert.SerializeObject(value); }
private void FillData(int rowIndex) { DataGridViewRow dataGridViewRow = this.dgvKetQua.Rows[rowIndex]; ThongTinHoSo thongTinHoSo = (ThongTinHoSo)this.dgvKetQua.Rows[rowIndex].DataBoundItem; ChiTietHoSo thongTinChiTiet = thongTinHoSo.ThongTinChiTiet; bool flag = thongTinChiTiet.ListGiayChungNhan != null; BindingList <GiayChungNhan> dataSource; if (flag) { dataSource = new BindingList <GiayChungNhan>(thongTinChiTiet.ListGiayChungNhan); } else { dataSource = new BindingList <GiayChungNhan>(); } this.dgvGiayChungNhan.DataSource = dataSource; bool flag2 = thongTinChiTiet.ListChu != null; BindingList <ChuSuDung> dataSource2; if (flag2) { dataSource2 = new BindingList <ChuSuDung>(thongTinChiTiet.ListChu); } else { dataSource2 = new BindingList <ChuSuDung>(); } this.dgvChu.DataSource = dataSource2; bool flag3 = thongTinChiTiet.ListThua != null; BindingList <ThuaDat> dataSource3; if (flag3) { dataSource3 = new BindingList <ThuaDat>(thongTinChiTiet.ListThua); } else { dataSource3 = new BindingList <ThuaDat>(); } this.dgvThuaDat.DataSource = dataSource3; bool flag4 = thongTinChiTiet.ListNha != null; BindingList <Nha> dataSource4; if (flag4) { dataSource4 = new BindingList <Nha>(thongTinChiTiet.ListNha); } else { dataSource4 = new BindingList <Nha>(); } this.dgvNha.DataSource = dataSource4; }
private void btnCapNhat_Click(object sender, EventArgs e) { bool flag = this.dgvChu.Rows.Count == 0; if (flag) { MessageBox.Show("Hãy nhập thông tin chủ!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { bool flag2 = this.dgvThuaDat.Rows.Count == 0 && this.dgvNha.Rows.Count == 0; if (flag2) { MessageBox.Show("Hãy nhập thông tin thửa đất hoặc nhà!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { bool flag3 = this.dgvChu.Rows.Count == 0; if (flag3) { MessageBox.Show("Bạn có chắc chắn không chọn file đính kèm!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { this.Cursor = Cursors.WaitCursor; BindingList <GiayChungNhan> bindingList = (BindingList <GiayChungNhan>) this.dgvGiayChungNhan.DataSource; BindingList <ChuSuDung> bindingList2 = (BindingList <ChuSuDung>) this.dgvChu.DataSource; BindingList <ThuaDat> bindingList3 = (BindingList <ThuaDat>) this.dgvThuaDat.DataSource; BindingList <Nha> bindingList4 = (BindingList <Nha>) this.dgvNha.DataSource; BindingList <FileScanInput> bindingList5 = (BindingList <FileScanInput>) this.dgvFileScan.DataSource; bool flag4 = ProcessData.UploadFile2Server(this.txtSoBienNhan.Text.Trim().Replace('/', '_').Replace('\\', '_'), ref bindingList5); if (flag4) { ChiTietHoSo chiTietHoSo = new ChiTietHoSo(); bool flag5 = bindingList2.Count > 0; if (flag5) { chiTietHoSo.ListChu = bindingList2.ToList <ChuSuDung>(); } bool flag6 = bindingList5.Count > 0; if (flag6) { chiTietHoSo.ListFile = new List <FileScan>(); foreach (FileScanInput current in bindingList5) { chiTietHoSo.ListFile.Add(new FileScan { FileName = current.FileName, FilePath = current.FilePath, LoaiGiayToId = current.LoaiGiayToId, MoTa = current.MoTa }); } } bool flag7 = bindingList.Count > 0; if (flag7) { chiTietHoSo.ListGiayChungNhan = bindingList.ToList <GiayChungNhan>(); } bool flag8 = bindingList4.Count > 0; if (flag8) { chiTietHoSo.ListNha = bindingList4.ToList <Nha>(); } bool flag9 = bindingList3.Count > 0; if (flag9) { chiTietHoSo.ListThua = bindingList3.ToList <ThuaDat>(); } this._thongTinHoSo.ThongTinChiTiet = chiTietHoSo; bool flag10 = this.cboLoaiBienDong.SelectedIndex > 0; if (flag10) { this._thongTinHoSo.LoaiBienDongId = new int?((int)this.cboLoaiBienDong.SelectedValue); } this._thongTinHoSo.SoBienNhan = this.txtSoBienNhan.Text.Trim(); this._thongTinHoSo.NgayNop = this.txtNgayNop.Value; this._thongTinHoSo.NgayHenTra = this.txtNgayHenTra.Value; this._thongTinHoSo.NgayTraHoSo = this.txtNgayTraHoSo.Value; this._thongTinHoSo.NgayKiemTraNoiNghiep = this.txtNgayKiemTraNoiNghiep.Value; bool flag11 = this.txtPhiDoVe.Value > 0.0; if (flag11) { this._thongTinHoSo.PhiDoVe = new double?(this.txtPhiDoVe.Value); } else { this._thongTinHoSo.PhiDoVe = null; } this._thongTinHoSo.SoBanVe = this.txtSoBanVe.Text.Trim(); this._thongTinHoSo.GhiChu = this.txtGhiChu.Text; this._thongTinHoSo.GioiTinhNguoiNop = this.chkGioiTinhNguoiNop.Checked; this._thongTinHoSo.NguoiNopHoSo = this.txtHoTenNguoiNop.Text.Trim(); this._thongTinHoSo.SoGiayToNguoiNop = this.txtSoGiayToNguoiNop.Text.Trim(); _thongTinHoSo.HoSoChuaDat = chkHoSoChuaDat.Checked; _thongTinHoSo.HoSoDaKiemTra = chkHoSoDaKiemTra.Checked; _thongTinHoSo.HoSoKhongHopLy = chkHoSoHopLy.Checked; bool flag12 = this.txtPhiThamDinh.Value > 0.0; if (flag12) { this._thongTinHoSo.PhiThamDinh = new double?(this.txtPhiThamDinh.Value); } else { this._thongTinHoSo.PhiThamDinh = null; } if (cboChuyenVienKiemTra.SelectedIndex > 0) { _thongTinHoSo.ChuyenVienId = (int)cboChuyenVienKiemTra.SelectedValue; _thongTinHoSo.ChuyenVienKiemTra = cboChuyenVienKiemTra.Text; } else { _thongTinHoSo.ChuyenVienId = null; _thongTinHoSo.ChuyenVienKiemTra = ""; } if (cboCongTyDoVe.SelectedIndex > 0) { _thongTinHoSo.CongTyDoVeId = (int)cboCongTyDoVe.SelectedValue; _thongTinHoSo.CongTyDoVe = cboCongTyDoVe.Text; } else { _thongTinHoSo.CongTyDoVeId = null; _thongTinHoSo.CongTyDoVe = ""; } bool flag13 = ProcessData.SaveThongTinHoSo(ref this._thongTinHoSo); if (flag13) { string text = ""; bool flag14 = !string.IsNullOrEmpty(this._thongTinHoSo.NguoiCapNhat); if (flag14) { text += this._thongTinHoSo.NguoiCapNhat; } DateTime?ngayChinhSua = this._thongTinHoSo.NgayChinhSua; bool hasValue = ngayChinhSua.HasValue; if (hasValue) { string arg_4CC_0 = text; string arg_4CC_1 = " cập nhật lần cuối cùng vào lúc "; ngayChinhSua = this._thongTinHoSo.NgayChinhSua; text = arg_4CC_0 + arg_4CC_1 + (ngayChinhSua.HasValue ? ngayChinhSua.GetValueOrDefault().ToString("dd/MM/yyyy HH:mm:ss") : null); } this.txtNguoiCapNhatCuoi.Text = text; MessageBox.Show("Cập nhật hồ sơ thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { MessageBox.Show("Cập nhật hồ sơ không thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Cập nhật hồ sơ không thành công!" + Environment.NewLine + "Lỗi upload file scan.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.dgvFileScan.Refresh(); this.Cursor = Cursors.Default; } } } }