private void LoadData2TreeView(ThongTinHoSo value) { this.trvHoSo.Nodes.Clear(); this._dictHoSo = new Dictionary <long, ThongTinHoSo>(); this._dictHoSo.Add(value.ThongTinHoSoId, value); _rootId = value.RootId; long?num = value.KhoaChaId; while (num.HasValue) { ThongTinHoSoEntity thongTinHoSoEntity = ManageBase.SelectThongTinHoSoById(num.Value); num = null; bool flag = thongTinHoSoEntity != null; if (flag) { ThongTinHoSo thongTinHoSo = ProcessData.MapThongTinHoSo(thongTinHoSoEntity); num = thongTinHoSo.KhoaChaId; this._dictHoSo.Add(thongTinHoSo.ThongTinHoSoId, thongTinHoSo); } } foreach (KeyValuePair <long, ThongTinHoSo> current in this._dictHoSo) { TreeNode node = this.AddData2TreeNode(current.Value); this.trvHoSo.Nodes.Add(node); } foreach (TreeNode node2 in this.trvHoSo.Nodes) { this.hideTreeNode(node2); } this.trvHoSo.ExpandAll(); }
private void btnCapNhat_Click(object sender, EventArgs e) { List <ChuyenVien> lst = ((BindingList <ChuyenVien>)dgvChuyenVien.DataSource).ToList(); ProcessData.SaveChuyenVien(lst); lst = ProcessData.GetAllChuyenVien(); dgvChuyenVien.DataSource = new BindingList <ChuyenVien>(lst); MessageBox.Show("Cập nhật thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void FormLichSuNguoiDung_Load(object sender, EventArgs e) { this.trvLichSuNguoiDung.Nodes.Clear(); bool flag = this._userLog != null; if (flag) { this._lstNguoiDung = ProcessData.GetAllNguoiDung(); this.AddDataToTreeView(this._userLog); } this.trvLichSuNguoiDung.ExpandAll(); }
private void trvHoSo_DoubleClick(object sender, EventArgs e) { TreeNode selectedNode = this.trvHoSo.SelectedNode; bool flag = selectedNode.Tag != null && selectedNode.Tag.ToString().Contains("File"); if (flag) { this.Cursor = Cursors.WaitCursor; string filePathServer = selectedNode.Tag.ToString().Substring(4); ProcessData.ReadFileFromServer(filePathServer); this.Cursor = Cursors.Default; } }
public FormThongKeNguoiKiemTraNoiNghiep() { InitializeComponent(); dgvData.AutoGenerateColumns = false; _bindingSource = new BindingSource(); dgvData.DataSource = _bindingSource; List <ChuyenVien> lst = ProcessData.GetAllChuyenVien(); foreach (ChuyenVien item in lst) { checkComboboxNguoiKTNN.Properties.Items.Add(item.ChuyenVienId, item.TenChuyenVien); } }
public FormThongKeTheoCongTyDoVe() { InitializeComponent(); dgvData.AutoGenerateColumns = false; _bindingSource = new BindingSource(); dgvData.DataSource = _bindingSource; List <CongTyDoVe> lst = ProcessData.GetAllCongTyDoVe(); foreach (CongTyDoVe item in lst) { checkComboboxCTDV.Properties.Items.Add(item.CongTyDoVeId, item.TenCongTyDoVe); } }
public static List <ThongTinHoSo> SearchThongTinHoSo(SearchInput input) { List <ThongTinHoSo> list = new List <ThongTinHoSo>(); EntityCollection entityCollection = ManageBase.SearchThongTinHoSo(input); using (IEnumerator <EntityBase2> enumerator = entityCollection.GetEnumerator()) { while (enumerator.MoveNext()) { ThongTinHoSoEntity entity = (ThongTinHoSoEntity)enumerator.Current; list.Add(ProcessData.MapThongTinHoSo(entity)); } } return(list); }
private void dgvFileScan_CellClick(object sender, DataGridViewCellEventArgs e) { bool flag = e.ColumnIndex >= 0; if (flag) { bool flag2 = this.dgvFileScan.Columns[e.ColumnIndex].Name == "clnLoaiGiayToFile"; if (flag2) { this.dgvFileScan.BeginEdit(true); ComboBox comboBox = (ComboBox)this.dgvFileScan.EditingControl; comboBox.DroppedDown = true; } else { bool flag3 = this.dgvFileScan.Columns[e.ColumnIndex].Name == "clnView"; if (flag3) { FileScanInput fileScanInput = (FileScanInput)this.dgvFileScan.Rows[e.RowIndex].DataBoundItem; bool flag4 = fileScanInput.IsLocalFile || !string.IsNullOrEmpty(fileScanInput.FullName); if (flag4) { Process.Start(fileScanInput.FullName); } else { ProcessData.ReadFileFromServer(fileScanInput.FilePath); } } else { bool flag5 = this.dgvFileScan.Columns[e.ColumnIndex].Name == "clnXoaFile"; if (flag5) { bool flag6 = MessageBox.Show("Bạn chắc chắn muốn xoá file đã chọn?", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK; if (flag6) { this.dgvFileScan.Rows.RemoveAt(e.RowIndex); } } } } } }
private void btnTimKiem_Click(object sender, EventArgs e) { this.dgvChu.Rows.Clear(); this.dgvGiayChungNhan.Rows.Clear(); this.dgvNha.Rows.Clear(); this.dgvThuaDat.Rows.Clear(); SearchInput searchInput = new SearchInput(); searchInput.SoBienNhan = this.txtSoBienNhan.Text; searchInput.HoTen = this.txtHoTen.Text; searchInput.SoGiayTo = this.txtSoGiayTo.Text; searchInput.SoSerial = this.txtSoSerial.Text; bool flag = this.txtSoThua.Value > 0.0; if (flag) { searchInput.SoThua = this.txtSoThua.Value.ToString(); } bool flag2 = this.txtSoTo.Value > 0.0; if (flag2) { searchInput.SoTo = this.txtSoTo.Value.ToString(); } searchInput.SoBanVe = this.txtSoBanVe.Text; searchInput.LaNguoiNopHoSo = this.chkNguoiNopHoSo.Checked; this.Cursor = Cursors.WaitCursor; this.dgvKetQua.SelectionChanged -= new EventHandler(this.dgvKetQua_SelectionChanged); this.dgvKetQua.DataSource = ProcessData.SearchThongTinHoSo(searchInput); bool flag3 = this.dgvKetQua.Rows.Count > 0; if (flag3) { this.dgvKetQua.Rows[0].Selected = true; } this.dgvKetQua.SelectionChanged += new EventHandler(this.dgvKetQua_SelectionChanged); bool flag4 = this.dgvKetQua.Rows.Count > 0; if (flag4) { this.FillData(0); } this.Cursor = Cursors.Default; }
public static void ReadFileFromServer(string filePathServer) { bool flag = !string.IsNullOrEmpty(filePathServer); if (flag) { string localPathFromServerPath = ProcessData.GetLocalPathFromServerPath(filePathServer); string text = string.Format("{0}\\{1}{2}", Application.StartupPath, "Temp", localPathFromServerPath); bool flag2 = !Directory.Exists(text); if (flag2) { Directory.CreateDirectory(text); } string workingDirectory = filePathServer.Substring(0, filePathServer.LastIndexOf('/')); string text2 = filePathServer.Substring(filePathServer.LastIndexOf('/') + 1); string text3 = string.Format("{0}\\{1}", text, text2); bool flag3 = File.Exists(text3); if (flag3) { Process.Start(text3); } else { try { GlobalVariable.FTPLib.WorkingDirectory = workingDirectory; GlobalVariable.FTPLib.OpenDownload(text2, text3, false); while (GlobalVariable.FTPLib.DoDownload() > 0L) { } Process.Start(text3); } catch (Exception ex) { MessageBox.Show("File hồ sơ này không tồn tại!\n" + ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } else { MessageBox.Show("File hồ sơ này không tồn tại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void FormChuyenVien_Load(object sender, EventArgs e) { List <ChuyenVien> lst = ProcessData.GetAllChuyenVien(); dgvChuyenVien.DataSource = new BindingList <ChuyenVien>(lst); }
private void txtGhiChu_DoubleClick(object sender, EventArgs e) { ProcessData.HienThiDoanVanBan((TextBox)sender, "Nội dung ghi chú"); }
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; } } } }
private void FormCongTyDoVe_Load(object sender, EventArgs e) { List <CongTyDoVe> lst = ProcessData.GetAllCongTyDoVe(); dgvCongTyDoVe.DataSource = new BindingList <CongTyDoVe>(lst); }
public static bool UploadFile2Server(string soBienNhan, ref BindingList <FileScanInput> values) { bool result = true; if (values.Count > 0) { string maXa = GlobalVariable.MaXa; int xaId = GlobalVariable.XaId; string text = ""; string workingDirectory = ""; string workingDirectory2 = ""; GlobalVariable.FTPLib.WorkingDirectory = "/"; try { workingDirectory = GlobalVariable.FTPLib.WorkingDirectory; GlobalVariable.FTPLib.WorkingDirectory = maXa; GlobalVariable.FTPLib.GetFileList(); } catch { GlobalVariable.FTPLib.WorkingDirectory = workingDirectory; GlobalVariable.FTPLib.MakeDir(maXa); GlobalVariable.FTPLib.WorkingDirectory = maXa; } workingDirectory2 = GlobalVariable.FTPLib.WorkingDirectory; try { foreach (FileScanInput current in values) { bool flag = !current.IsLocalFile; if (flag) { text = current.FilePath.Split(new char[] { '/' })[2]; break; } } bool flag2 = text == ""; if (flag2) { text = ProcessData.TaoThuMucTuiHoSo(""); GlobalVariable.FTPLib.WorkingDirectory = workingDirectory2; GlobalVariable.FTPLib.MakeDir(text); GlobalVariable.FTPLib.WorkingDirectory = text; } string text2 = "/" + maXa + "/" + text; foreach (FileScanInput current2 in values) { bool isLocalFile = current2.IsLocalFile; if (isLocalFile) { string strFileServer = ProcessData.TaoTenFile(text2, current2.LoaiGiayToId, soBienNhan, current2.FileName); current2.FilePath = text2 + "/" + ProcessData.UploadToServer(current2.FullName, text2, strFileServer); current2.IsLocalFile = false; } } } catch (Exception var_15_1D0) { result = false; } } return(result); }