public BaseCase CastDB(BaseCaseViewModel model)
        {
            BaseCase bc = new BaseCase();

            Com.HSJF.Infrastructure.ExtendTools.ObjectExtend.CopyTo(model, bc);
            return(bc);
        }
        // public string CaseStatusText { get; set; }

        #endregion 2016-9-8 新增字段

        public BaseCaseViewModel CastModel(BaseCase model)
        {
            BaseCaseViewModel bcvm = new BaseCaseViewModel();

            Infrastructure.ExtendTools.ObjectExtend.CopyTo(model, bcvm);
            bcvm.CaseNum = model.NewCaseNum;

            #region 2016-9-8新增

            var badal   = new BaseAuditDAL();
            var modal   = new MortgageDAL();
            var auditvm = new AuditInformationVM();
            var dicdal  = new DictionaryDAL();
            var store   = new Infrastructure.Identity.Store.UserStore();
            var manager = new UserManager(store);
            if (string.IsNullOrEmpty(model.NewCaseNum))
            {
                bcvm.AuditInformation = auditvm;
                return(bcvm);
            }
            var basudit = badal.GetbyCaseNum(model.NewCaseNum);
            if (basudit == null)
            {
                bcvm.AuditInformation = auditvm;
                bcvm.CaseStatus       = null;
                return(bcvm);
            }
            if (basudit.CaseMode == "-CaseMode-JuJian")
            {
                auditvm.ThirdPartyAuditAmount = basudit.ThirdPartyAuditAmount;
                auditvm.ThirdPartyAuditTerm   = basudit.ThirdPartyAuditTerm;
            }
            else
            {
                auditvm.ThirdPartyAuditAmount = basudit.AuditAmount;
                auditvm.ThirdPartyAuditTerm   = basudit.AuditTerm;
            }
            var CaseStatus = basudit == null ? "数据不完整" : basudit.CaseStatus;
            bcvm.CaseStatus = CaseStatus == null ? "" : CaseStatus;
            //bcvm.CaseStatusText = CaseStatus == null ? "" : Helper.CaseStatusHelper.GetBigStatusText(CaseStatus);
            string RefuseReason = "";
            if (basudit.RejectType != null)
            {
                string        RejectType = "";
                string[]      str        = basudit.RejectType.Split(',');
                DictionaryDAL dadal      = new DictionaryDAL();
                foreach (var item in str)
                {
                    RejectType += dadal.GetText(item) + ",";
                }
                RefuseReason = RejectType.Substring(0, RejectType.Length - 1);
            }

            auditvm.ThirdPartyAuditRate = basudit.AuditRate;
            auditvm.RefuseReason        = RefuseReason;
            auditvm.SignRefuseReason    = basudit.RejectReason;
            var mortgage = modal.Get(basudit.ID);
            if (mortgage == null)
            {
                bcvm.AuditInformation = auditvm;
                return(bcvm);
            }
            var contr = manager.FindById(mortgage.ContractPerson);
            auditvm.ContractPersonText = contr == null ? "" : contr.DisplayName;
            auditvm.ContractAmount     = mortgage.ContractAmount;
            auditvm.ContractDate       = mortgage.ContractDate;
            bcvm.AuditInformation      = auditvm;

            #endregion 2016-9-8新增

            return(bcvm);
        }