Beispiel #1
0
        private void btnChinhSua_Click(object sender, EventArgs e)
        {
            bool flag = this.frmNhapHoSo == null;

            if (flag)
            {
                this.frmNhapHoSo = new FormNhapHoSo();
            }
            TreeNode treeNode = null;
            long     key      = 0L;

            foreach (TreeNode treeNode2 in this.trvHoSo.Nodes)
            {
                bool @checked = treeNode2.Checked;
                if (@checked)
                {
                    treeNode = treeNode2;
                    key      = Convert.ToInt64(treeNode2.Tag.ToString().Substring(2));
                    this.frmNhapHoSo._thongTinHoSo           = JsonConvert.DeserializeObject <ThongTinHoSo>(JsonConvert.SerializeObject(this._dictHoSo[key]));
                    this.frmNhapHoSo._thongTinHoSo.IsNew     = false;
                    this.frmNhapHoSo._thongTinHoSo.IsSuccess = false;
                    break;
                }
            }
            bool flag2 = treeNode != null;

            if (flag2)
            {
                this.frmNhapHoSo.ShowDialog();
                bool isSuccess = this.frmNhapHoSo._thongTinHoSo.IsSuccess;
                if (isSuccess)
                {
                    this._dictHoSo[key] = JsonConvert.DeserializeObject <ThongTinHoSo>(JsonConvert.SerializeObject(this.frmNhapHoSo._thongTinHoSo));
                    this.UpdateData2TreeNode(treeNode, this._dictHoSo[key]);
                }
            }
        }
Beispiel #2
0
        private void btnThemMoi_Click(object sender, EventArgs e)
        {
            bool flag = this.frmNhapHoSo == null;

            if (flag)
            {
                this.frmNhapHoSo = new FormNhapHoSo();
            }
            long         num   = 0L;
            bool         flag2 = this.chkLayThongTinCu.Checked && this.trvHoSo.Nodes.Count > 0;
            ThongTinHoSo thongTinHoSo;

            if (flag2)
            {
                TreeNode treeNode = this.trvHoSo.Nodes[0];
                num                               = Convert.ToInt64(treeNode.Tag.ToString().Substring(2));
                thongTinHoSo                      = JsonConvert.DeserializeObject <ThongTinHoSo>(JsonConvert.SerializeObject(this._dictHoSo[num]));
                thongTinHoSo.SoBienNhan           = "";
                thongTinHoSo.NgayHenTra           = null;
                thongTinHoSo.NgayTraHoSo          = null;
                thongTinHoSo.NgayKiemTraNoiNghiep = null;
                thongTinHoSo.NgayNop              = null;
                thongTinHoSo.GhiChu               = "";
                thongTinHoSo.LoaiBienDongId       = null;
                thongTinHoSo.SoBanVe              = "";
                thongTinHoSo.PhiDoVe              = null;
                thongTinHoSo.PhiThamDinh          = null;
                thongTinHoSo.ChuyenVienId         = null;
                thongTinHoSo.ChuyenVienKiemTra    = "";
                thongTinHoSo.HoSoKhongHopLy       = false;
                thongTinHoSo.HoSoDaKiemTra        = false;
                thongTinHoSo.HoSoChuaDat          = false;
                thongTinHoSo.CongTyDoVeId         = null;
                thongTinHoSo.CongTyDoVe           = "";
                thongTinHoSo.NgayChinhSua         = null;
                thongTinHoSo.NguoiCapNhat         = "";
                thongTinHoSo.LichSuCapNhat        = null;
                bool flag3 = thongTinHoSo.ThongTinChiTiet != null;
                if (flag3)
                {
                    thongTinHoSo.ThongTinChiTiet.ListFile = null;
                }
            }
            else
            {
                thongTinHoSo = new ThongTinHoSo();
            }
            if (trvHoSo.Nodes.Count == 0)
            {
                _rootId = ManageBase.GetRootId();
                if (_rootId == 0)
                {
                    MessageBox.Show("Không thể khởi tạo dữ liệu Root!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
            }

            thongTinHoSo.RootId         = _rootId;
            thongTinHoSo.ThongTinHoSoId = 0L;
            thongTinHoSo.IsNew          = true;
            thongTinHoSo.IsSuccess      = false;
            thongTinHoSo.LaHoSoMoiNhat  = true;
            bool flag4 = num > 0L;

            if (flag4)
            {
                thongTinHoSo.KhoaChaId = new long?(num);
            }
            this.frmNhapHoSo._thongTinHoSo = thongTinHoSo;
            this.frmNhapHoSo.ShowDialog();
            bool isSuccess = this.frmNhapHoSo._thongTinHoSo.IsSuccess;

            if (isSuccess)
            {
                thongTinHoSo = JsonConvert.DeserializeObject <ThongTinHoSo>(JsonConvert.SerializeObject(this.frmNhapHoSo._thongTinHoSo));
                bool flag5 = num > 0L;
                if (flag5)
                {
                    this._dictHoSo[num].LaHoSoMoiNhat = false;
                    this.AddData2FirstTreeView(thongTinHoSo);
                }
                else
                {
                    this.LoadData2TreeView(thongTinHoSo);
                }
            }
        }