protected bool GetData() { UserBLL userbll = new UserBLL(); //获取项目信息 model = bll.GetProjectDetailInfo(projectId.Value); if (model == null) { Response.Redirect(GlobalUtils.WebURL + "/Member/my_account.aspx"); return(false); } switch (model.Rating) { case 1: rating = "<span style=\"color:Green;\">低</span>"; break; case 2: rating = "<span style=\"color:Orange;\">中</span>"; break; case 3: rating = "<span style=\"color:Red;\">高</span>"; break; } GetBorrowUserInfo(); WebSettingBLL setbll = new WebSettingBLL(); //新手加息判断 WebSettingInfo GylSetInfo = setbll.GetWebSettingInfo("5AC96A83-B678-4191-BADB-C39C02DFEBB5"); if (GylSetInfo != null) { GylPlusRate = Tool.StrObj.StrToDecimalDef(GylSetInfo.Param3Value, 0); Day15PlusRate = Tool.StrObj.StrToDecimalDef(GylSetInfo.Param4Value, 0); } if (this.model.DeadType.Value == 2 && (this.model.Deadline == 7 && GylPlusRate > 0) || (this.model.Deadline == 15 && Day15PlusRate > 0)) { IsShowPlusRate = true; } DynamicParameters dyParams; string sql = ""; if (WebUserAuth.IsAuthenticated && IsShowPlusRate) { //判断是否投资新手 sql = "select count(1) from Subscribe with(Nolock) where SubscribeUserId=@userid"; dyParams = new DynamicParameters(); dyParams.Add("@userid", WebUserAuth.UserId.Value); bool IsNewHand = PublicConn.QuerySingle <int>(sql, ref dyParams) == 0; NewHandRate = IsNewHand ? (this.model.Deadline == 7 ? GylPlusRate : Day15PlusRate) : 0; } dyParams = new DynamicParameters(); dyParams.Add("@projectid", projectId); sql = @"select ProjectID,ProjectDesc2,CreditStatus,EnterpriseCredit,OperatingConditions,RoyalRiskAbility from dbo.Project_GYL with(nolock) where ProjectID=@projectid"; ProjectGylInfo = PublicConn.QuerySingle <Project_GYLInfo>(sql, ref dyParams); if (ProjectGylInfo != null) { OverallRanking = setbll.GetWebSettingInfo(new Guid("A874BE7E-492F-4A21-9064-B75CA16D2DF3").ToString()); } if (ProjectGylInfo != null) { TotalCreditScore = ProjectGylInfo.CreditStatus + ProjectGylInfo.EnterpriseCredit + ProjectGylInfo.OperatingConditions + ProjectGylInfo.RoyalRiskAbility; } GetBusinessRange(model.Id); finishProcess = CommUtils.GetProjectProcess(model); SubscribeUserCount = CommUtils.GetSubscribeUserCount(this.projectId.Value); //计算预期收益 PreInterestRate = CommUtils.CalcInvestInterest(model, 10000); EbaoMultiple = int.Parse(Math.Ceiling(model.InterestRate.Value / decimal.Parse("2.5")).ToString()); EbaoInterest = CommUtils.GetEbaoMultipleInterest(model, 10000); preSubscribeList = CommUtils.GetPreSubscribeDetail(model, 10000); InterestModel = TuanDai.PortalSystem.Redis.ProjectRedis.GetProjectInterestMode(model.Type.Value, model.RepaymentType.Value); return(true); }
protected bool GetData() { UserBLL userbll = new UserBLL(); //获取项目信息 model = bll.GetProjectDetailInfo(projectId.Value); if (model == null) { Response.Redirect(GlobalUtils.WebURL + "/Member/my_account.aspx"); return(false); } if (model.Type.Value != 19) { Response.Redirect(GlobalUtils.WebURL + "/Member/my_account.aspx"); return(false); } WebSettingInfo gylSet = new WebSettingBLL().GetWebSettingInfo("75F593E2-40FF-4777-A6F8-4ED54D39FF70"); if (gylSet.Param2Value.IsEmpty()) { gylSet.Param2Value = "2017-02-10"; } if (model.AddDate >= DateTime.Parse(gylSet.Param2Value)) { DanBaoCompany = "东莞市志诚非融资性担保有限公司"; } switch (model.Rating) { case 1: rating = "<span style=\"color:Green;\">低</span>"; break; case 2: rating = "<span style=\"color:Orange;\">中</span>"; break; case 3: rating = "<span style=\"color:Red;\">高</span>"; break; } GetBorrowUserInfo(); WebSettingBLL setbll = new WebSettingBLL(); //新手加息判断 WebSettingInfo GylSetInfo = setbll.GetWebSettingInfo("5AC96A83-B678-4191-BADB-C39C02DFEBB5"); if (GylSetInfo != null) { GylPlusRate = Tool.StrObj.StrToDecimalDef(GylSetInfo.Param3Value, 0); Day15PlusRate = Tool.StrObj.StrToDecimalDef(GylSetInfo.Param4Value, 0); } if (this.model.DeadType.Value == 2 && (this.model.Deadline == 7 && GylPlusRate > 0) || (this.model.Deadline == 15 && Day15PlusRate > 0)) { IsShowPlusRate = true; } DynamicParameters dyParams; string sql = ""; if (WebUserAuth.IsAuthenticated && IsShowPlusRate) { //判断是否投资新手 sql = "select count(1) from Subscribe with(Nolock) where SubscribeUserId=@userid"; dyParams = new DynamicParameters(); dyParams.Add("@userid", WebUserAuth.UserId.Value); bool IsNewHand = PublicConn.QuerySingle <int>(sql, ref dyParams) == 0; NewHandRate = IsNewHand ? (this.model.Deadline == 7 ? GylPlusRate : Day15PlusRate) : 0; } dyParams = new DynamicParameters(); dyParams.Add("@projectid", projectId); sql = @"select ProjectID,ProjectDesc2,CreditStatus,EnterpriseCredit,OperatingConditions,RoyalRiskAbility from dbo.Project_GYL with(nolock) where ProjectID=@projectid"; ProjectGylInfo = PublicConn.QuerySingle <Project_GYLInfo>(sql, ref dyParams); finishProcess = CommUtils.GetProjectProcess(model); SubscribeUserCount = CommUtils.GetSubscribeUserCount(this.projectId.Value); //计算预期收益 PreInterestRate = CommUtils.CalcInvestInterest(model, 10000); EbaoMultiple = int.Parse(Math.Ceiling(model.InterestRate.Value / decimal.Parse("2.5")).ToString()); EbaoInterest = CommUtils.GetEbaoMultipleInterest(model, 10000); preSubscribeList = CommUtils.GetPreSubscribeDetail(model, 10000); regulaSet = new WebSettingBLL().GetWebSettingInfo("293A1C07-1D90-4D22-ADD4-39E6735DAC06"); InterestModel = TuanDai.PortalSystem.Redis.ProjectRedis.GetProjectInterestMode(model.Type.Value, model.RepaymentType.Value); //截标时间为NULL时候取审核时间 +5 天 if (model.TenderDate == null) { model.TenderDate = Convert.ToDateTime(model.AuditDate == null ? model.AddDate : model.AuditDate).AddDays(5); } else { model.TenderDate = model.TenderDate; } if (model.AuditDate == null) { model.TenderStartDate = model.AddDate; } else { model.TenderStartDate = model.AuditDate; } return(true); }