public BaseAudit CastDB(BaseAuditViewModel model)
        {
            BaseAudit bc = new BaseAudit();

            Com.HSJF.Infrastructure.ExtendTools.ObjectExtend.CopyTo(model, bc);

            // bc.NewCaseNum = model.CaseNum;

            return(bc);
        }
        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);
        }