コード例 #1
0
        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();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public static long SaveThongTinHoSo(ThongTinHoSoEntity entity)
        {
            long thongTinHoSoId;

            using (DataAccessAdapterBase dataAccessAdapterBase = new DataAccessAdapter(ManageBase.ConnectionString))
            {
                dataAccessAdapterBase.SaveEntity(entity, true);
                thongTinHoSoId = entity.ThongTinHoSoId;
            }
            return(thongTinHoSoId);
        }
コード例 #4
0
ファイル: ProcessData.cs プロジェクト: daodat91/ToolBanVeQ2
        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);
        }
コード例 #5
0
        public static ThongTinHoSoEntity SelectThongTinHoSoById(long thongTinHoSoId)
        {
            ThongTinHoSoEntity result = null;

            using (DataAccessAdapterBase dataAccessAdapterBase = new DataAccessAdapter(ManageBase.ConnectionString))
            {
                ThongTinHoSoEntity thongTinHoSoEntity = new ThongTinHoSoEntity(thongTinHoSoId);
                bool flag = dataAccessAdapterBase.FetchEntity(thongTinHoSoEntity);
                if (flag)
                {
                    result = thongTinHoSoEntity;
                }
            }
            return(result);
        }
コード例 #6
0
ファイル: ProcessData.cs プロジェクト: daodat91/ToolBanVeQ2
        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);
        }
コード例 #7
0
ファイル: ProcessData.cs プロジェクト: daodat91/ToolBanVeQ2
        public static bool SaveThongTinHoSo(ref ThongTinHoSo value)
        {
            bool result = true;

            try
            {
                DateTime           dateNow            = ManageBase.GetDateNow();
                ThongTinHoSoEntity thongTinHoSoEntity = new ThongTinHoSoEntity();
                thongTinHoSoEntity.ThongTinHoSoId       = value.ThongTinHoSoId;
                thongTinHoSoEntity.IsNew                = value.IsNew;
                thongTinHoSoEntity.XaId                 = GlobalVariable.XaId;
                thongTinHoSoEntity.SoBienNhan           = value.SoBienNhan;
                thongTinHoSoEntity.NgayNop              = value.NgayNop;
                thongTinHoSoEntity.NgayHenTra           = value.NgayHenTra;
                thongTinHoSoEntity.NgayTraHoSo          = value.NgayTraHoSo;
                thongTinHoSoEntity.NgayKiemTraNoiNghiep = value.NgayKiemTraNoiNghiep;
                thongTinHoSoEntity.SoBanVe              = value.SoBanVe;
                thongTinHoSoEntity.PhiDoVe              = value.PhiDoVe;
                thongTinHoSoEntity.GioiTinhNguoiNop     = new bool?(value.GioiTinhNguoiNop);
                thongTinHoSoEntity.NguoiNopHoSo         = value.NguoiNopHoSo;
                thongTinHoSoEntity.SoGiayToNguoiNop     = value.SoGiayToNguoiNop;
                thongTinHoSoEntity.PhiThamDinh          = value.PhiThamDinh;
                thongTinHoSoEntity.ChuyenVienId         = value.ChuyenVienId;
                thongTinHoSoEntity.ChuyenVienKiemTra    = value.ChuyenVienKiemTra;
                thongTinHoSoEntity.CongTyDoVeId         = value.CongTyDoVeId;
                thongTinHoSoEntity.CongTyDoVe           = value.CongTyDoVe;
                thongTinHoSoEntity.HoSoChuaDat          = value.HoSoChuaDat;
                thongTinHoSoEntity.HoSoDaKiemTra        = value.HoSoDaKiemTra;
                thongTinHoSoEntity.HoSoKhongHopLy       = value.HoSoKhongHopLy;
                thongTinHoSoEntity.RootId               = value.RootId;
                UserLog userLog = new UserLog();
                userLog.NguoiDungId              = new int?(GlobalVariable.NguoiDungId);
                userLog.NgayChinhSua             = new DateTime?(dateNow);
                userLog.LogHistory               = value.LichSuCapNhat;
                thongTinHoSoEntity.LichSuCapNhat = JsonConvert.SerializeObject(userLog);
                List <string> list = new List <string>();
                bool          flag = value.ThongTinChiTiet.ListGiayChungNhan != null;
                if (flag)
                {
                    foreach (GiayChungNhan current in value.ThongTinChiTiet.ListGiayChungNhan)
                    {
                        bool flag2 = !string.IsNullOrEmpty(current.SoSerial);
                        if (flag2)
                        {
                            list.Add(current.SoSerial);
                        }
                    }
                }
                thongTinHoSoEntity.SoHieuGiayChungNhan = string.Join(" ", list);
                list = new List <string>();
                List <string> list2 = new List <string>();
                bool          flag3 = value.ThongTinChiTiet.ListChu != null;
                if (flag3)
                {
                    foreach (ChuSuDung current2 in value.ThongTinChiTiet.ListChu)
                    {
                        bool flag4 = !string.IsNullOrEmpty(current2.HoTen);
                        if (flag4)
                        {
                            list.Add(current2.HoTen);
                        }
                        bool flag5 = !string.IsNullOrEmpty(current2.SoGiayTo);
                        if (flag5)
                        {
                            list2.Add(current2.SoGiayTo);
                        }
                    }
                }
                thongTinHoSoEntity.HoTen    = string.Join(" ", list);
                thongTinHoSoEntity.SoGiayTo = string.Join(" ", list2);
                list  = new List <string>();
                list2 = new List <string>();
                List <string> list3 = new List <string>();
                bool          flag6 = value.ThongTinChiTiet.ListThua != null;
                if (flag6)
                {
                    foreach (ThuaDat current3 in value.ThongTinChiTiet.ListThua)
                    {
                        bool flag7 = !list.Contains(current3.SoThuTuThua);
                        if (flag7)
                        {
                            list.Add(current3.SoThuTuThua);
                        }
                        bool flag8 = !list2.Contains(current3.SoHieuToBanDo);
                        if (flag8)
                        {
                            list2.Add(current3.SoHieuToBanDo);
                        }
                    }
                }
                thongTinHoSoEntity.SoThuTuThua    = string.Join(" ", list);
                thongTinHoSoEntity.SoHieuToBanDo  = string.Join(" ", list2);
                thongTinHoSoEntity.GhiChu         = value.GhiChu;
                thongTinHoSoEntity.LoaiBienDongId = value.LoaiBienDongId;
                bool isNew = value.IsNew;
                if (isNew)
                {
                    thongTinHoSoEntity.HoSoMoiNhat = true;
                }
                else
                {
                    thongTinHoSoEntity.HoSoMoiNhat = value.LaHoSoMoiNhat;
                }
                thongTinHoSoEntity.NguoiDungId = new int?(GlobalVariable.NguoiDungId);
                thongTinHoSoEntity.ChiTietHoSo = JsonConvert.SerializeObject(value.ThongTinChiTiet);
                thongTinHoSoEntity.KhoaChaId   = value.KhoaChaId;
                value.ThongTinHoSoId           = ManageBase.SaveThongTinHoSo(thongTinHoSoEntity);
                value.IsSuccess    = true;
                value.NguoiCapNhat = GlobalVariable.HoTenNguoiDung;
                bool flag9 = string.IsNullOrEmpty(value.NguoiCapNhat);
                if (flag9)
                {
                    value.NguoiCapNhat = GlobalVariable.TenDangNhap;
                }
                value.NgayChinhSua  = new DateTime?(dateNow);
                value.LichSuCapNhat = userLog;
                value.LaHoSoMoiNhat = thongTinHoSoEntity.HoSoMoiNhat;
                bool flag10 = value.IsNew && value.KhoaChaId.HasValue;
                if (flag10)
                {
                    ManageBase.Update(new ThongTinHoSoEntity
                    {
                        HoSoMoiNhat = false,
                        NguoiDungId = new int?(GlobalVariable.NguoiDungId)
                    }, new RelationPredicateBucket
                    {
                        PredicateExpression =
                        {
                            ThongTinHoSoFields.ThongTinHoSoId == value.KhoaChaId
                        }
                    });
                }
                value.IsNew = false;
            }
            catch (Exception var_27_4C1)
            {
                result = false;
            }
            return(result);
        }