Example #1
0
        /// <summary>
        /// 投资合同
        /// </summary>
        /// <returns></returns>
        public ActionResult InvestmentContract(int targetId)
        {
            ContractLogic         _logic = new ContractLogic();
            M_Contract_management model  = _logic.GetContractListForApp(targetId).FirstOrDefault();

            StringBuilder sb = new StringBuilder(model.contract_money);

            sb = sb.Replace("#loan_number#", model.loan_number.ToString());
            //手机号*号处理
            if (!string.IsNullOrEmpty(model.borrower_username) && model.borrower_username.Length == 11)
            {
                model.borrower_username = model.borrower_username.Substring(0, 3) + "****" + model.borrower_username.Substring(7);
            }
            sb = sb.Replace("#borrower_username#", model.borrower_username);
            //姓名  名字*号处理
            if (!string.IsNullOrEmpty(model.borrower_name))
            {
                model.borrower_name = model.borrower_name.Substring(0, 1) + "**";
            }
            sb = sb.Replace("#borrower_name#", model.borrower_name);
            sb = sb.Replace("#borrower_id_card#", model.borrower_id_card);
            sb = sb.Replace("#lender_username#", model.lender_username);
            sb = sb.Replace("#lender_name#", model.lender_name);
            sb = sb.Replace("#lender_id_card#", model.lender_id_card);
            sb = sb.Replace("#surety_company_name#", model.surety_company_name);
            sb = sb.Replace("#guarantor_agent_usernqme#", model.guarantor_agent_usernqme);
            sb = sb.Replace("#contract_amount#", RMB.GetDecimal(model.contract_amount, 2, true).ToString());

            BorrowLogic  _borrowLogic = new BorrowLogic();
            BorrowEntity borrowEntity = _borrowLogic.SelectBorrowDetail(targetId);

            sb = sb.Replace("#annual_interest_rate#", decimal.Parse(borrowEntity.annual_interest_rate.ToString()).ToString("0.00"));
            DateTime date1 = DateTime.Parse(borrowEntity.release_date.ToString());
            DateTime date2 = DateTime.Parse(borrowEntity.repayment_date.ToString());

            sb = sb.Replace("#release_date#", date1.ToString("yyyy-MM-dd"));
            sb = sb.Replace("#repayment_date#", date2.ToString("yyyy-MM-dd"));
            sb = sb.Replace("#days#", Utils.DateDiff("Day", date1, date2).ToString());
            model.contract_money = sb.ToString();

            //ViewBag.loan_number = model.loan_number;
            //ViewBag.borrower_username = model.borrower_username;
            //ViewBag.borrower_name = model.borrower_name;
            //ViewBag.guarantee_legal_representative = model.guarantee_legal_representative;
            //ViewBag.surety_company_name = model.surety_company_name;
            //ViewBag.StartTime = model.Start_Time;
            //ViewBag.EndTime = model.End_Time;
            //ViewBag.DurationDays = model.DurationTime;
            return(View(model));
        }