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 FormMain_Load(object sender, EventArgs e) { bool flag = !GlobalVariable.LaQuanTriHeThong; if (flag) { this.mnQuanLyTaiKhoan.Visible = false; this.mnThietLapThongSoFTP.Visible = false; } GlobalVariable.TinhId = 79; GlobalVariable.MaTinh = "79"; GlobalVariable.TenTinh = "TP. Hồ Chí Minh"; GlobalVariable.HuyenId = 769; GlobalVariable.MaHuyen = "769"; GlobalVariable.TenHuyen = "Quận 2"; this.frmThongTinHoSo = new FormThongTinHoSo(); this.frmThongTinHoSo.Show(this.dockPanel, DockState.Document); this.toolStripXa.DropDownItems.Clear(); EntityCollection entityCollection = ManageBase.SelectXaByHuyenId(GlobalVariable.HuyenId); foreach (XaEntity xaEntity in entityCollection) { ToolStripMenuItem toolStripMenuItem = new ToolStripMenuItem(xaEntity.TenXa); toolStripMenuItem.Tag = xaEntity.XaId; toolStripMenuItem.Click += new EventHandler(this.menuItemCommune_Click); this.toolStripXa.DropDownItems.Add(toolStripMenuItem); } this.toolStripXa.Text = this.toolStripXa.DropDownItems[0].Text; this.menuItemCommune_Click(this.toolStripXa.DropDownItems[0], null); }
private void btnKetNoi_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; int port; int.TryParse(this.txtPort.Text.Trim(), out port); FTPDetail fTPDetail = new FTPDetail { Pass = this.txtPasswordFTP.Text.Trim(), Port = port, Server = this.txtHostFTP.Text.Trim(), User = this.txtUsernameFTP.Text.Trim() }; bool flag = GlobalVariable.CreateFTP(fTPDetail.Server, fTPDetail.Port, fTPDetail.User, fTPDetail.Pass); if (flag) { bool flag2 = ManageBase.SaveCauHinhFTP(fTPDetail); if (flag2) { MessageBox.Show("Kết nối thành công. Đã cập nhật thông số kết nối!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); base.Close(); } else { MessageBox.Show("Kết nối thành công. Không thể cập nhật thông số kết nối!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Hãy kiểm tra lại thông số kết nối!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtHostFTP.Focus(); } this.Cursor = Cursors.Default; }
private bool DeleteInfoDocument(long thongTinHoSoId, out string message) { message = ""; bool result = true; long?num = null; try { while (thongTinHoSoId > 0L) { TreeNode node = null; foreach (TreeNode treeNode in this.trvHoSo.Nodes) { long num2 = Convert.ToInt64(treeNode.Tag.ToString().Substring(2)); bool flag = thongTinHoSoId == num2; if (flag) { node = treeNode; num = this._dictHoSo[num2].KhoaChaId; break; } } bool flag2 = thongTinHoSoId > 0L; if (flag2) { bool flag3 = ManageBase.DeleteThongTinHoSo(thongTinHoSoId); if (flag3) { this._dictHoSo.Remove(thongTinHoSoId); this.trvHoSo.Nodes.Remove(node); bool hasValue = num.HasValue; if (hasValue) { thongTinHoSoId = num.Value; } else { thongTinHoSoId = 0L; } num = null; } else { result = false; message = "Không có dữ liệu"; } } } } catch (Exception ex) { result = false; message = ex.Message; } return(result); }
private void SetDictLoaiGiayToFileScan() { EntityCollection entityCollection = ManageBase.SelectAllLoaiGiayTo(1); this._dictLoaiGiayToFileScan = new Dictionary <int, string>(); foreach (LoaiGiayToEntity loaiGiayToEntity in entityCollection) { this._dictLoaiGiayToFileScan.Add(loaiGiayToEntity.LoaiGiayToId, loaiGiayToEntity.TenLoaiGiayTo); } }
private void menuItemCommune_Click(object sender, EventArgs e) { ToolStripMenuItem toolStripMenuItem = (ToolStripMenuItem)sender; this.toolStripXa.Text = toolStripMenuItem.Text; XaEntity xaEntity = ManageBase.SelectXaByXaId((int)toolStripMenuItem.Tag); GlobalVariable.XaId = xaEntity.XaId; GlobalVariable.MaXa = xaEntity.MaXa; GlobalVariable.TenXa = xaEntity.TenXa; this.frmThongTinHoSo.ClearData(); this.Text = "Phần mềm quản lý hồ sơ đo vẽ; " + GlobalVariable.TenXa + " - " + GlobalVariable.TenHuyen; }
public static ThongTinHoSo MapThongTinHoSo(ThongTinHoSoEntity entity) { ThongTinHoSo thongTinHoSo = new ThongTinHoSo(); thongTinHoSo.SoBienNhan = entity.SoBienNhan; thongTinHoSo.NgayNop = entity.NgayNop; thongTinHoSo.NgayHenTra = entity.NgayHenTra; thongTinHoSo.NgayTraHoSo = entity.NgayTraHoSo; thongTinHoSo.NgayKiemTraNoiNghiep = entity.NgayKiemTraNoiNghiep; thongTinHoSo.SoBanVe = entity.SoBanVe; thongTinHoSo.PhiDoVe = entity.PhiDoVe; thongTinHoSo.GhiChu = entity.GhiChu; thongTinHoSo.GioiTinhNguoiNop = entity.GioiTinhNguoiNop.Value; thongTinHoSo.NguoiNopHoSo = entity.NguoiNopHoSo; thongTinHoSo.SoGiayToNguoiNop = entity.SoGiayToNguoiNop; thongTinHoSo.IsNew = false; thongTinHoSo.IsSuccess = false; thongTinHoSo.LaHoSoMoiNhat = entity.HoSoMoiNhat; thongTinHoSo.KhoaChaId = entity.KhoaChaId; thongTinHoSo.LoaiBienDongId = entity.LoaiBienDongId; thongTinHoSo.ThongTinChiTiet = JsonConvert.DeserializeObject <ChiTietHoSo>(entity.ChiTietHoSo); thongTinHoSo.ThongTinHoSoId = entity.ThongTinHoSoId; thongTinHoSo.PhiThamDinh = entity.PhiThamDinh; thongTinHoSo.ChuyenVienId = entity.ChuyenVienId; thongTinHoSo.ChuyenVienKiemTra = entity.ChuyenVienKiemTra; thongTinHoSo.CongTyDoVeId = entity.CongTyDoVeId; thongTinHoSo.CongTyDoVe = entity.CongTyDoVe; thongTinHoSo.HoSoChuaDat = entity.HoSoChuaDat; thongTinHoSo.HoSoDaKiemTra = entity.HoSoDaKiemTra; thongTinHoSo.HoSoKhongHopLy = entity.HoSoKhongHopLy; thongTinHoSo.RootId = entity.RootId; thongTinHoSo.NgayChinhSua = entity.NgayChinhSua; bool flag3 = !string.IsNullOrEmpty(entity.LichSuCapNhat); if (flag3) { thongTinHoSo.LichSuCapNhat = JsonConvert.DeserializeObject <UserLog>(entity.LichSuCapNhat); } bool hasValue = entity.NguoiDungId.HasValue; if (hasValue) { NguoiDungEntity nguoiDungEntity = ManageBase.SelectNguoiDungById(entity.NguoiDungId.Value); thongTinHoSo.NguoiCapNhat = nguoiDungEntity.HoTenNguoiDung; bool flag4 = string.IsNullOrEmpty(thongTinHoSo.NguoiCapNhat); if (flag4) { thongTinHoSo.NguoiCapNhat = nguoiDungEntity.TenDangNhap; } } return(thongTinHoSo); }
private void FormKetNoiFTP_Load(object sender, EventArgs e) { FTPDetail fTPDetail = ManageBase.GetFTPDetail(); bool flag = fTPDetail != null; if (flag) { this.txtHostFTP.Text = fTPDetail.Server; this.txtPort.Text = fTPDetail.Port.ToString(); this.txtUsernameFTP.Text = fTPDetail.User; this.txtPasswordFTP.Text = fTPDetail.Pass; } }
public FormNhapHoSo() { InitializeComponent(); this.dgvFileScan.AutoGenerateColumns = false; this.dgvThuaDat.AutoGenerateColumns = false; DataTable dataTable = ManageBase.SelectAllLoaiGiayToRDT(0); DataRow dataRow = dataTable.NewRow(); dataRow["LoaiGiayToId"] = 0; dataRow["TenLoaiGiayTo"] = "<<Chọn loại giấy tờ>>"; dataTable.Rows.InsertAt(dataRow, 0); this.clnLoaiGiayTo.ValueMember = "LoaiGiayToId"; this.clnLoaiGiayTo.DisplayMember = "TenLoaiGiayTo"; this.clnLoaiGiayTo.DataSource = dataTable; dataTable = ManageBase.SelectAllLoaiGiayToRDT(1); GlobalVariable.DictLoaiGiayToFile = new Dictionary <int, string>(); foreach (DataRow dataRow2 in dataTable.Rows) { GlobalVariable.DictLoaiGiayToFile.Add((int)dataRow2["LoaiGiayToId"], dataRow2["MaLoaiGiayTo"].ToString()); } dataRow = dataTable.NewRow(); dataRow["LoaiGiayToId"] = 0; dataRow["TenLoaiGiayTo"] = "<<Chọn loại giấy tờ>>"; dataTable.Rows.InsertAt(dataRow, 0); this.clnLoaiGiayToFile.ValueMember = "LoaiGiayToId"; this.clnLoaiGiayToFile.DisplayMember = "TenLoaiGiayTo"; this.clnLoaiGiayToFile.DataSource = dataTable; DataTable dataTable2 = ManageBase.SelectAllLoaiBienDongRDT(); dataRow = dataTable2.NewRow(); dataRow["LoaiBienDongId"] = 0; dataRow["TenLoaiBienDong"] = "<<Chọn loại biến động>>"; dataTable2.Rows.InsertAt(dataRow, 0); this.cboLoaiBienDong.DataSource = dataTable2; dataTable2 = ManageBase.SelectAllChuyenVienRDT(); dataRow = dataTable2.NewRow(); dataRow["ChuyenVienId"] = 0; dataRow["TenChuyenVien"] = "<<Chọn người kiểm tra nội nghiệp>>"; dataTable2.Rows.InsertAt(dataRow, 0); this.cboChuyenVienKiemTra.DataSource = dataTable2; dataTable2 = ManageBase.SelectAllCongTyDoVeRDT(); dataRow = dataTable2.NewRow(); dataRow["CongTyDoVeId"] = 0; dataRow["TenCongTyDoVe"] = "<<Chọn công ty đo vẽ>>"; dataTable2.Rows.InsertAt(dataRow, 0); this.cboCongTyDoVe.DataSource = dataTable2; }
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); }
public static List <CongTyDoVe> GetAllCongTyDoVe() { List <CongTyDoVe> lst = new List <Object.CongTyDoVe>(); EntityCollection ec = ManageBase.SelectAllCongTyDoVe(); foreach (CongTyDoVeEntity item in ec) { lst.Add(new CongTyDoVe { CongTyDoVeId = item.CongTyDoVeId, TenCongTyDoVe = item.TenCongTyDoVe }); } return(lst); }
public static List <ChuyenVien> GetAllChuyenVien() { List <ChuyenVien> lst = new List <Object.ChuyenVien>(); EntityCollection ec = ManageBase.SelectAllChuyenVien(); foreach (ChuyenVienEntity item in ec) { lst.Add(new ChuyenVien { ChuyenVienId = item.ChuyenVienId, TenChuyenVien = item.TenChuyenVien }); } return(lst); }
public static string TaoThuMucTuiHoSo(string maHoSo = "") { bool flag = string.IsNullOrEmpty(maHoSo); string result; if (flag) { result = string.Format("HS-T{0}-{1}", ManageBase.GetSoThuTuHoSo(), DateTime.Now.Year); } else { result = string.Format("HS-T{0}-{1}-{2}", ManageBase.GetSoThuTuHoSo(), maHoSo, DateTime.Now.Year); } return(result); }
public FormTimKiem() { InitializeComponent(); this.dgvKetQua.AutoGenerateColumns = false; this.dgvThuaDat.AutoGenerateColumns = false; DataTable dataTable = ManageBase.SelectAllLoaiGiayToRDT(0); DataRow dataRow = dataTable.NewRow(); dataRow["LoaiGiayToId"] = 0; dataRow["TenLoaiGiayTo"] = "<<Chọn loại giấy tờ>>"; dataTable.Rows.InsertAt(dataRow, 0); this.clnLoaiGiayTo.ValueMember = "LoaiGiayToId"; this.clnLoaiGiayTo.DisplayMember = "TenLoaiGiayTo"; this.clnLoaiGiayTo.DataSource = dataTable; }
public static DateTime GetDateNow() { DateTime result; try { DataTable dataTable = ManageBase.ExcuteSelect("Select getdate()"); string s = dataTable.Rows[0][0].ToString(); result = DateTime.Parse(s); } catch (Exception) { result = DateTime.Now; } return(result); }
private void btnChuyenVien_Click(object sender, EventArgs e) { if (frmChuyenVien == null) { frmChuyenVien = new DocumentManage.FormChuyenVien(); } frmChuyenVien.ShowDialog(); DataTable dataTable2 = ManageBase.SelectAllChuyenVienRDT(); DataRow dataRow = dataTable2.NewRow(); dataRow["ChuyenVienId"] = 0; dataRow["TenChuyenVien"] = "<<Chọn người kiểm tra nội nghiệp>>"; dataTable2.Rows.InsertAt(dataRow, 0); this.cboChuyenVienKiemTra.DataSource = dataTable2; }
private void btnCongTyDoVe_Click(object sender, EventArgs e) { if (frmCongTyDoVe == null) { frmCongTyDoVe = new DocumentManage.FormCongTyDoVe(); } frmCongTyDoVe.ShowDialog(); DataTable dataTable2 = ManageBase.SelectAllCongTyDoVeRDT(); DataRow dataRow = dataTable2.NewRow(); dataRow["CongTyDoVeId"] = 0; dataRow["TenCongTyDoVe"] = "<<Chọn công ty đo vẽ>>"; dataTable2.Rows.InsertAt(dataRow, 0); this.cboCongTyDoVe.DataSource = dataTable2; }
public static void SaveChuyenVien(List <ChuyenVien> lst) { EntityCollection ec = new EntityCollection(); foreach (ChuyenVien item in lst) { ec.Add(new ChuyenVienEntity { ChuyenVienId = item.ChuyenVienId, TenChuyenVien = item.TenChuyenVien, IsNew = (item.ChuyenVienId == 0) }); } if (ec.Count > 0) { ManageBase.SaveEntityCollection(ec); } }
public static void SaveCongTyDoVe(List <CongTyDoVe> lst) { EntityCollection ec = new EntityCollection(); foreach (CongTyDoVe item in lst) { ec.Add(new CongTyDoVeEntity { CongTyDoVeId = item.CongTyDoVeId, TenCongTyDoVe = item.TenCongTyDoVe, IsNew = (item.CongTyDoVeId == 0) }); } if (ec.Count > 0) { ManageBase.SaveEntityCollection(ec); } }
public static List <NguoiDung> GetAllNguoiDung() { List <NguoiDung> list = new List <NguoiDung>(); EntityCollection entityCollection = ManageBase.SelectAllNguoiDung(); using (IEnumerator <EntityBase2> enumerator = entityCollection.GetEnumerator()) { while (enumerator.MoveNext()) { NguoiDungEntity nguoiDungEntity = (NguoiDungEntity)enumerator.Current; NguoiDung nguoiDung = new NguoiDung(); nguoiDung.NguoiDungId = nguoiDungEntity.NguoiDungId; nguoiDung.TenNguoiDung = nguoiDungEntity.HoTenNguoiDung; bool flag = string.IsNullOrEmpty(nguoiDung.TenNguoiDung); if (flag) { nguoiDung.TenNguoiDung = nguoiDungEntity.TenDangNhap; } list.Add(nguoiDung); } } return(list); }