Example #1
0
        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());
                }
            }
        }
Example #2
0
        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();
                }
            }
        }