Пример #1
0
        private List <LendingPageViewModel> Map(List <BaseAudit> audits)
        {
            var output       = new List <LendingPageViewModel>();
            var baseAuditDal = new BaseAuditDAL();
            var saleGroups   = new SalesGroupBll().GetAll().ToList();

            audits.ForEach(p =>
            {
                var lendModel = new LendingPageViewModel();

                lendModel.ID             = p.ID;
                lendModel.BorrowerName   = p.BorrowerName;
                lendModel.CaseNum        = p.NewCaseNum;
                lendModel.CaseStatus     = baseAuditDal.GetbyCaseNum(p.NewCaseNum).CaseStatus;
                lendModel.CaseStatusText = Helper.CaseStatusHelper.GetBigStatusText(lendModel.CaseStatus);
                lendModel.CreateTime     = p.CreateTime;
                lendModel.LendingDate    = p.LendingDate;
                lendModel.LoanAmount     = p.LoanAmount;
                lendModel.SalesGroupID   = p.SalesGroupID;
                lendModel.SalesGroupText = saleGroups.Single(sale => sale.ID == p.SalesGroupID).Name;

                output.Add(lendModel);
            });

            return(output);
        }
Пример #2
0
        public BaseCaseListViewModel CastModel(BaseCase baseCase)
        {
            BaseCaseListViewModel baseCaseListViewModel = new BaseCaseListViewModel();
            CollateralDAL         collateralDal         = new CollateralDAL();
            SalesManDAL           salesManDal           = new SalesManDAL();

            Framework.DAL.Audit.BaseAuditDAL badit = new Framework.DAL.Audit.BaseAuditDAL();
            var saleGroups = new SalesGroupBll().GetAll().ToList();

            Infrastructure.ExtendTools.ObjectExtend.CopyTo(baseCase, baseCaseListViewModel);
            baseCaseListViewModel.CaseNum = baseCase.NewCaseNum;

            var sale = salesManDal.Get(baseCase.SalesID);

            baseCaseListViewModel.SalesDisplay = sale == null ? "" : sale.Name;

            var firstcoll = collateralDal.FindByCaseID(baseCase.ID).FirstOrDefault(t => t.CollateralType == DictionaryString.CollateralType);

            if (firstcoll != null)
            {
                baseCaseListViewModel.FirstCollateral = string.Format("{0}({1})", firstcoll.Address, firstcoll.BuildingName);
            }

            if (baseCase.NewCaseNum != null && baseCase.Version > 0)
            {
                var audit = badit.GetbyCaseNum(baseCase.NewCaseNum);

                var CaseStatus = audit == null ? "数据不完整" : audit.CaseStatus;
                baseCaseListViewModel.CaseStatus     = CaseStatus == null ? "" : CaseStatus;
                baseCaseListViewModel.CaseStatusText = CaseStatus == null ? "" : Helper.CaseStatusHelper.GetBigStatusText(CaseStatus);
            }
            else if (baseCase.NewCaseNum != null && baseCase.Version == 0)
            {
                baseCaseListViewModel.CaseStatus     = "";
                baseCaseListViewModel.CaseStatusText = "预提交";
            }
            else
            {
                baseCaseListViewModel.CaseStatus = null;
            }

            if (baseCaseListViewModel.SalesGroupID != null)
            {
                baseCaseListViewModel.SalesGroupText = saleGroups.Single(x => x.ID == baseCaseListViewModel.SalesGroupID).Name;
            }

            return(baseCaseListViewModel);
        }
Пример #3
0
        public BaseAuditViewModel CastModel(BaseAudit model)
        {
            BaseAuditViewModel bcvm = new BaseAuditViewModel();

            Framework.DAL.Audit.BaseAuditDAL baseAuditDal = new Framework.DAL.Audit.BaseAuditDAL();
            var saleGroups = new SalesGroupBll().GetAll().ToList();

            Infrastructure.ExtendTools.ObjectExtend.CopyTo(model, bcvm);
            if (bcvm == null || model == null)
            {
                return(null);
            }
            MortgageBll mortgageBll = new MortgageBll();
            var         mortgage    = mortgageBll.QueryById(model.ID);

            bcvm.OtherFileIsupload = "未上传";
            if (mortgage != null)
            {
                bcvm.OtherFileIsupload = mortgage.OtherFile != "" ? "已上传" : "未上传";
            }
            bcvm.CaseNum = model.NewCaseNum;
            if (model.NewCaseNum != null)
            {
                var caseStatus = baseAuditDal.GetbyCaseNum(model.NewCaseNum).CaseStatus;
                bcvm.CaseStatus     = caseStatus ?? "";
                bcvm.CaseStatusText = caseStatus == null ? "" : Helper.CaseStatusHelper.GetStatsText(caseStatus);
            }
            else
            {
                bcvm.CaseStatusText = "";
            }

            if (bcvm.SalesGroupID != null)
            {
                bcvm.SalesGroupText = saleGroups.Single(x => x.ID == bcvm.SalesGroupID).Name;
            }

            return(bcvm);
        }