protected void Page_Load(object sender, EventArgs e) { SubscribeId = WEBRequest.GetGuid("SubscribeId", ""); ProjectId = WEBRequest.GetGuid("ProjectId", ""); tab = WEBRequest.GetQueryString("tab"); if (!IsPostBack) { projectInfo = projectBll.GetProjectDetailInfo(ProjectId); if (projectInfo.Type == 18) { //私募宝 ProjectSMBLL projectSmbll = new ProjectSMBLL(); projectSmb = projectSmbll.GetProjectSMModel(projectInfo.Id); simubaoCurve = projectBll.GetSimubaoCurve(UserId, SubscribeId); } subscribeInfo = projectBll.WXGetSubscribeInfo(SubscribeId); TenderMode = WXConverter.GetTenderModeString(subscribeInfo.TenderMode); if (projectInfo.Type == 23) { ProjectXMBBLL xmbbll = new ProjectXMBBLL(); if (subscribeInfo.Status.Value.ToString().IsIn("3", "4")) { xmbReturn = xmbbll.GetXMBReturnDetail(subscribeInfo.SubscribeId); xmbDSInterest = xmbReturn.ReturnAmount - xmbReturn.Amount; xmbHoldDay = xmbReturn.HoldDay; xmbDeadRate = xmbReturn.InterestRate; } else { Tuple <int, decimal, decimal, string> tupleObj = BusinessDll.Invest.GetXMBProjectFloatRate(ProjectId, subscribeInfo.AddDate.Value, subscribeInfo.Amount ?? 0); xmbHoldDay = tupleObj.Item1; xmbDeadRate = tupleObj.Item2; xmbDSInterest = tupleObj.Item3; } rateRangeList = xmbbll.GetXMBRateContrastInfo(ProjectId); } Status = WXConverter.GetSubscribeStatusString(projectInfo.Type, subscribeInfo.Status, subscribeInfo.IsBorrow); BindList(); //当为分期宝时 if (projectInfo != null && (projectInfo.Type ?? 0) == 15) { FQUserApplyInfo = projectBll.WXGetFQUserApplyInfo(ProjectId.ToString()); } } }
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); } ProjectXMBBLL xbmbll = new ProjectXMBBLL(); if (this.model.Type == 23) { rateRangeList = xbmbll.GetXMBRateContrastInfo(projectId.Value); } this.SubscribeUserCount = TuanDai.WXApiWeb.Common.WXInvest.WXGetSubscribeUserCount(this.projectId.Value); borrowerUserInfo = userbll.GetUserBasicInfoModelById(model.UserId.Value); #region 获取担保公司 UserEnterpriseInfo userEnterprise = GetBorrowerGuaranteeEnterprise(this.model.UserId.Value, model.AddDate.Value); if (userEnterprise != null) { string sql = "select NickName from UserBasicInfo with(nolock) where id=@enterpriseuserid"; DynamicParameters args = new DynamicParameters(); args.Add("@enterpriseuserid", userEnterprise.UserId); this.EnterpriseName = PublicConn.QuerySingle <string>(sql, ref args); } else { if (model.Guarantors != null && model.Guarantors != "") { this.EnterpriseName = BusinessDll.business.GetAssureNameById(int.Parse(model.Guarantors.ToString())); } } #endregion ProjectBLL projbll = new ProjectBLL(); xmbModel = projbll.GetProjectXMBInfo(projectId.Value); if (xmbModel == null) { xmbModel = new Project_XMB_Info(); } allMonthBadrate = calcrate(model.TotalSumShares ?? 0, model.badShares ?? 0); IsSMBGuQuan = xmbModel.Type == 1; //modify by shellben 2015-12-29 处理元旦活动加息,以下是规则 //2015-12-29 00:00至2016-1-25 24:00期间加息标的仅含“小微企业”“微团贷”“项目宝B” //加息幅度根据期限适配: //1-5个月:+1% //6-11个月:+1.5% //12个月及以上:+2% if (DateTime.Now >= DateTime.Parse("2015/12/29 00:00:00") && DateTime.Now < DateTime.Parse("2016/1/26 00:00:00")) { if (new int[] { 1, 3, 9, 10, 11, 22 }.Contains(model.Type ?? 0) && (model.TuandaiRate ?? 0) <= 0) { if (model.Deadline <= 5) { model.TuandaiRate = 1; } else if (model.Deadline >= 12) { model.TuandaiRate = 2; } else { model.TuandaiRate = 1.5; } } } return(true); }
protected void Page_Load(object sender, EventArgs e) { if (!GlobalUtils.IsShowZxToInvestor(UserId) && new GlobalUtils().GetNewVipUserInfo(UserId).Level < 3) { Response.Redirect("/Member/my_account.aspx"); return; } SubscribeId = WEBRequest.GetGuid("SubscribeId", ""); ProjectId = WEBRequest.GetGuid("ProjectId", ""); tab = WEBRequest.GetQueryString("tab"); if (!IsPostBack) { string postUrl = GlobalUtils.SubApiUrl; if (GlobalUtils.IsOpenSubscribeApi) { //从聚合拿数据 string err = ""; string response = TuanDai.HttpClient.HttpUtil.HttpGet(TdConfig.ApplicationName, postUrl + "/app/APPGetProjecInfo?id=" + ProjectId, "", out err, null, 3); if (!string.IsNullOrEmpty(response) && string.IsNullOrEmpty(err)) { ResponsePublicModel <List <ProjectDetailInfo> > pmodel = JsonConvert.DeserializeObject <ResponsePublicModel <List <ProjectDetailInfo> > >(response); if (pmodel != null && pmodel.data != null) { projectInfo = pmodel.data.FirstOrDefault(); } } else { TuanDai.LogSystem.LogClient.LogClients.ErrorLog(TdConfig.ApplicationName, "/app/APPGetProjecInfo", "ProjectId:" + ProjectId, err); } if (projectInfo == null) { //如果项目表信息为空,去智享库查一遍 projectInfo = JsonConvert.DeserializeObject <ProjectDetailInfo>(JsonConvert.SerializeObject(new ZXProjectBLL().GetProjectDetailInfo(ProjectId))); } } else { projectInfo = projectBll.GetProjectDetailInfo(ProjectId); } if (projectInfo == null) { projectInfo = new ProjectDetailInfo(); } if (projectInfo.Type == 18) { //私募宝 ProjectSMBLL projectSmbll = new ProjectSMBLL(); projectSmb = projectSmbll.GetProjectSMModel(projectInfo.Id); simubaoCurve = projectBll.GetSimubaoCurve(UserId, SubscribeId); } //从聚合拿数据 if (GlobalUtils.IsOpenSubscribeApi) { string err = ""; string response = TuanDai.HttpClient.HttpUtil.HttpGet(TdConfig.ApplicationName, postUrl + "/wap/WXGetSubscribeInfo?id=" + SubscribeId + "&projectId=" + ProjectId, "", out err, null, 3); if (!string.IsNullOrEmpty(response) && string.IsNullOrEmpty(err)) { ResponsePublicModel <WXSubscribeInfo> pmodel = JsonConvert.DeserializeObject <ResponsePublicModel <WXSubscribeInfo> >(response); if (pmodel != null) { subscribeInfo = pmodel.data; } } else { TuanDai.LogSystem.LogClient.LogClients.ErrorLog(TdConfig.ApplicationName, "/wap/WXGetSubscribeInfo", "ProjectId:" + ProjectId, err); } } else { subscribeInfo = projectBll.WXGetSubscribeInfo(SubscribeId); } if (subscribeInfo == null) { Response.Redirect(GlobalUtils.MTuanDaiURL + "/Member/Repayment/my_return_list.aspx"); return; } TenderMode = WXConverter.GetTenderModeString(subscribeInfo.TenderMode); if (projectInfo.Type == 23) { ProjectXMBBLL xmbbll = new ProjectXMBBLL(); if (subscribeInfo.Status.Value.ToString().IsIn("3", "4")) { xmbReturn = xmbbll.GetXMBReturnDetail(subscribeInfo.SubscribeId); xmbDSInterest = xmbReturn.ReturnAmount - xmbReturn.Amount; xmbHoldDay = xmbReturn.HoldDay; xmbDeadRate = xmbReturn.InterestRate; } else { Tuple <int, decimal, decimal, string> tupleObj = BusinessDll.Invest.GetXMBProjectFloatRate(ProjectId, subscribeInfo.AddDate.Value, subscribeInfo.Amount ?? 0); xmbHoldDay = tupleObj.Item1; xmbDeadRate = tupleObj.Item2; xmbDSInterest = tupleObj.Item3; } rateRangeList = xmbbll.GetXMBRateContrastInfo(ProjectId); } Status = WXConverter.GetSubscribeStatusString(projectInfo.Type, subscribeInfo.Status, subscribeInfo.IsBorrow); BindList(); //当为分期宝时 if (projectInfo != null && (projectInfo.Type ?? 0) == 15) { FQUserApplyInfo = projectBll.WXGetFQUserApplyInfo(ProjectId.ToString()); } if (this.listtable != null && this.listtable.Any()) { lastCycleDate = this.listtable.LastOrDefault().CycDate; hasBackList = this.listtable.Where(p => p.Desc == "已回款").ToList(); dueBackList = this.listtable.Where(p => p.Desc == "待回款" || p.Desc == "已逾期").ToList(); } } }