Ejemplo n.º 1
0
        protected string GetWePlanYearRate(WeProductDetailInfo item)
        {
            string formatStr = "<p class=\"c-ff881f {1}\">{0}<span class='c-ff881f f18px'>%</span></p>";
            string fontSize  = "f60px";

            if (item.ProductName.ToUpper().Contains("计划D") || item.ProductName.ToUpper().Contains("计划E") || item.ProductName.ToUpper().Contains("计划F"))
            {
                fontSize = "f30px";
            }

            string yearRate = "";

            if (item.MinYearRate > 0 && !item.IsWeFQB)
            {
                yearRate = ToolStatus.DeleteZero(item.MinYearRate) + "-";
            }
            yearRate += ToolStatus.DeleteZero(item.YearRate);
            if (item.ProductName.ToUpper().IndexOf("计划D") > -1 || item.ProductName.ToUpper().IndexOf("计划E") > -1)
            {
                yearRate += "+X";
            }
            if (yearRate.IndexOf("+") != -1 || yearRate.IndexOf("-") != -1)
            {
                return(string.Format(formatStr, yearRate, fontSize));
            }
            else
            {
                return(string.Format(formatStr, ToolStatus.DeleteZero(decimal.Parse(yearRate.Trim())), HasFloatDigt(decimal.Parse(yearRate)) ? "f50px" : "f60px"));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取利率范围
        /// </summary>
        /// <param name="beginRate"></param>
        /// <param name="endRate"></param>
        /// <returns></returns>
        public string getRateRank(object beginRate, object endRate)
        {
            string strBegin = "";
            string strEnd   = "";

            if (beginRate == null || string.IsNullOrWhiteSpace(beginRate.ToString()))
            {
                strBegin = "";
            }
            else
            {
                strBegin = ToolStatus.DeleteZero(beginRate);
            }
            if (endRate == null || string.IsNullOrWhiteSpace(endRate.ToString()))
            {
                strEnd = "";
            }
            else
            {
                strEnd = ToolStatus.DeleteZero(endRate);
            }
            if (strEnd == "" && strBegin == "")
            {
                return("不限");
            }
            else if (strBegin == "" || strEnd == "")
            {
                return(strBegin == "" ? strEnd + "%" : strBegin + "%");
            }
            else
            {
                return(strBegin + "% - " + strEnd + "%");
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// We返现标签
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        protected string ShowWePubCach(WeProductDetailInfo model)
        {
            string pic = "";

            //发标时就设置返现
            if ((model.TuandaiCashRate ?? 0) > 0)
            {
                WebSettingBLL  webSettingBll = new WebSettingBLL();
                WebSettingInfo AllWeCachSet  = webSettingBll.GetWebSettingInfo("421DBE8C-6435-4A9A-852A-EC51F0B0DDA8");

                string cashFormat = AllWeCachSet.Param2Value;
                if ((model.CashLimitAmount ?? 0) > 0)
                {
                    cashFormat = AllWeCachSet.Param1Value;
                }
                if (cashFormat.ToText() == "")
                {
                    cashFormat = ((model.CashLimitAmount ?? 0) > 0 ? "起投{Amount}元," : "") + "返现{Rate}%";
                }
                decimal limitAmount    = model.CashLimitAmount ?? 0;
                string  strLimitAmount = limitAmount >= 10000 ? ToolStatus.DeleteZero(limitAmount / 10000) + "万" : ToolStatus.DeleteZero(limitAmount / 1000) + "千";
                pic += "<div class=\"rect_r f11px c-ffffff text-center\" style=\"width: auto;padding: 0px 10px;\">" + cashFormat.Replace("{Rate}", ToolStatus.DeleteZero(model.TuandaiCashRate)).Replace("{Amount}", strLimitAmount) + "</div>";
            }
            return(pic);
        }
Ejemplo n.º 4
0
        protected string GetMonthExitRate(int month)
        {
            WeProductFTBRateInfo rateInfo = FTBRateList.Where(p => p.MonthType == month).FirstOrDefault();

            if (rateInfo != null)
            {
                return(ToolStatus.DeleteZero(rateInfo.YearRate) + "%");
            }
            return("0%");
        }
Ejemplo n.º 5
0
        //加息利率显示
        protected string GetProjectPlusRate()
        {
            decimal plusRate = subscribeInfo.AddInterestRate ?? 0;   //(projectInfo.TuandaiRate ?? 0) + (projectInfo.PublisherRate ?? 0);

            if (plusRate > 0)
            {
                return(string.Format("<span class=\"rect_o pos-a\">加息{0}%</span>", ToolStatus.DeleteZero(plusRate)));
            }
            return("");
        }
Ejemplo n.º 6
0
 protected string GetYearRate(WXProjectListInfo temp)
 {
     if (temp.TypeId == 18 || temp.TypeId == 23)
     {
         return(string.Format("{0}", temp.ProfitTypeId == 1 ? ToolStatus.DeleteZero(temp.PreProfitRate_S) + "~" + ToolStatus.DeleteZero(temp.PreProfitRate_E) : ToolStatus.DeleteZero(temp.PreProfitRate_S)));
     }
     else
     {
         return(ToolStatus.DeleteZero(temp.YearRate ?? 0));
     }
 }
Ejemplo n.º 7
0
        public string GetWePlanYearRate(WeProductDetailInfo item)
        {
            string formatStr  = "{0}<span style='font-size:14px;'>{1}%</span>";
            string yearRate   = ToolStatus.DeleteZero(item.YearRate);
            string addRateStr = "";

            //1218当天标识
            if (DateTime.Parse(preSellSet.Param1Value) <= item.StartDate && item.StartDate < DateTime.Parse(curSellSet.Param2Value) && item.IsPreSell)
            {
                addRateStr = "+至少1.5";
            }
            return(string.Format(formatStr, CommUtils.GetFloatDivideStr(decimal.Parse(yearRate), 1), CommUtils.GetFloatDivideStr(decimal.Parse(yearRate), 2) + addRateStr));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 加息标签
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        protected string ShowWeRank(WeProductDetailInfo model)
        {
            string pic = "";

            if ((model.TuandaiRedRate ?? 0) > 0)
            {
                if (string.IsNullOrEmpty(model.TuanDaiRedTitle))
                {
                    model.TuanDaiRedTitle = "加息";
                }
                pic = "<div class=\"item_r1\">" + model.TuanDaiRedTitle + ToolStatus.DeleteZero(model.TuandaiRedRate) + "%</div>";
            }

            return(pic);
        }
Ejemplo n.º 9
0
        public string GetYearRate(decimal rate)
        {
            string formatStr = "<span class='f22px c-f77b00'>{0}</span>{1}%";
            string yearRate  = "";

            yearRate += ToolStatus.DeleteZero(rate);
            if (yearRate.IndexOf(".") > -1)
            {
                return(string.Format(formatStr, CommUtils.GetFloatDivideStr(decimal.Parse(yearRate), 1), CommUtils.GetFloatDivideStr(decimal.Parse(yearRate), 2)));
            }
            else
            {
                return(string.Format(formatStr, yearRate, ""));
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 获取新手标限制金额
        /// </summary>
        private void GetLimitInvestMoney()
        {
            string sql  = "SELECT Param1Value FROM WebSetting with(nolock) where id='FC5BAE60-716E-4344-9C10-F1E808064FC7'";
            var    para = new Dapper.DynamicParameters();

            limitInvest = PublicConn.QuerySingle <decimal>(sql, ref para);
            if (limitInvest >= 10000)
            {
                limitInvestStr = ToolStatus.DeleteZero(Math.Floor(limitInvest / 10000)) + "万";
            }
            else if (limitInvest >= 1000 && limitInvest < 10000)
            {
                limitInvestStr = ToolStatus.DeleteZero(Math.Floor(limitInvest / 1000)) + "千";
            }
            else
            {
                limitInvestStr = Math.Floor(limitInvest).ToString();
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 获取新手标限制金额
        /// </summary>
        private void GetLimitInvestMoney()
        {
            WebSettingInfo setInfo = new WebSettingBLL().GetWebSettingInfo("28ED2C47-C151-47AA-9D58-63277C0483C1");

            limitInvest      = decimal.Parse(setInfo.Param1Value);
            limitInvestNum   = setInfo.Param4Value.ToInt(3);
            IsNewHandNewRule = setInfo.Param5Value == "1";
            if (limitInvest >= 10000)
            {
                limitInvestStr = ToolStatus.DeleteZero(Math.Floor(limitInvest / 10000)) + "万";
            }
            else if (limitInvest >= 1000 && limitInvest < 10000)
            {
                limitInvestStr = ToolStatus.DeleteZero(Math.Floor(limitInvest / 1000)) + "千";
            }
            else
            {
                limitInvestStr = Math.Floor(limitInvest).ToString();
            }
        }
Ejemplo n.º 12
0
        //获取利率
        public static string GetProjectYearRate(WXProjectListInfo temp)
        {
            string strFormat = "{0}<span>{1}%</span>";

            if (temp.TypeId == 18 || temp.TypeId == 23)
            {
                if (temp.ProfitTypeId == 1)
                {
                    return(string.Format(strFormat, ToolStatus.DeleteZero(temp.PreProfitRate_S) + "~" + ToolStatus.DeleteZero(temp.PreProfitRate_E), "", "f21px"));
                }
                else
                {
                    return(string.Format(strFormat, ToolStatus.DeleteZero(temp.PreProfitRate_S), "", "f27px"));
                }
            }
            else
            {
                return(string.Format(strFormat, CommUtils.GetFloatDivideStr(temp.YearRate ?? 0, 1), CommUtils.GetFloatDivideStr(temp.YearRate ?? 0, 2), "f27px"));
            }
        }
Ejemplo n.º 13
0
        protected string GetProjectYearRate(WXProjectListInfo temp)
        {
            string strFormat = "<p class=\"c-ff881f {1}\">{0}<span class=\"c-ff881f f18px\">%</span></p>";

            if (temp.TypeId == 18 || temp.TypeId == 23)
            {
                if (temp.ProfitTypeId == 1)
                {
                    return(string.Format(strFormat, ToolStatus.DeleteZero(temp.PreProfitRate_S) + "~" + ToolStatus.DeleteZero(temp.PreProfitRate_E), "f30px"));
                }
                else
                {
                    return(string.Format(strFormat, ToolStatus.DeleteZero(temp.PreProfitRate_S), HasFloatDigt(temp.PreProfitRate_S) ? "f50px" : "f60px"));
                }
            }
            else
            {
                return(string.Format(strFormat, ToolStatus.DeleteZero(temp.YearRate), HasFloatDigt(temp.YearRate ?? 0) ? "f50px" : "f60px"));
            }
        }
Ejemplo n.º 14
0
        protected void GetWeAutoString(string projectTypes)
        {
            WeDeadlines = string.Empty;
            string sql = @"SELECT YearRate,Deadline FROM dbo.We_ProductType with(nolock) WHERE Id IN(" + projectTypes + ") order by YearRate";

            var para   = new Dapper.DynamicParameters();
            var weAuto = PublicConn.QueryBySql <SimpleWeAuto>(sql, ref para);

            if (weAuto != null)
            {
                WeMinRate = ToolStatus.DeleteZero(weAuto[0].YearRate);
                foreach (var item in weAuto)
                {
                    if (string.IsNullOrEmpty(WeDeadlines))
                    {
                        WeDeadlines = item.Deadline.ToString();
                    }
                    else
                    {
                        WeDeadlines += "," + item.Deadline.ToString();
                    }
                }
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 获取我的借款记录列表
        /// </summary>
        public void GetMyLoanShowList()
        {
            int    pagesize  = GlobalUtils.PageSize;
            int    pageindex = Tool.SafeConvert.ToInt32(Context.Request.Form["pageIndex"], 1);
            int    status    = Tool.SafeConvert.ToInt32(Context.Request.Form["statusStr"], 0);
            string userId    = Tool.SafeConvert.ToString(Context.Request.Form["userId"]);
            Guid   uId       = WebUserAuth.UserId.Value;

            if (uId == Guid.Empty)
            {
                if (string.IsNullOrEmpty(userId))
                {
                    uId = Guid.NewGuid();
                }
                else
                {
                    uId = Guid.Parse(userId);
                }
            }
            if (pageindex < 1)
            {
                pageindex = 1;
            }

            StringBuilder     sb          = new StringBuilder();
            int               totalcount  = 0;
            ProjectBLL        bll         = new ProjectBLL();
            WXMyLoanList_Info myLoanModel = bll.WXGetMyLoanList(uId, status, pageindex, pagesize, out totalcount);

            if (myLoanModel != null && myLoanModel.List.Count() > 0)
            {
                int index     = 1;
                int pageCount = GetPageCount(totalcount, pagesize);//总页数

                sb.Append("{\"result\":\"1\",\"totalcount\":\"" + totalcount + "\",\"pagecount\":\"" + pageCount + "\",\"list\":[");
                foreach (WXSubMyLoanList_Info temp in myLoanModel.List)
                {
                    sb.Append("{\"Id\":\"" + temp.ProjectId + "\",\"Title\":\"" + temp.Title + "\",\"ProjectType\":\"" + ToolStatus.ConvertProjectType(temp.Type)
                              + "\",\"Amount\":\"" + Tool.MoneyHelper.ConvertDetailWanMoney(temp.Amount) + "\",\"HaveBorrowedAmount\":\"" + Tool.MoneyHelper.ConvertDetailWanMoney(temp.HaveBorrowedAmount)
                              + "\",\"ProcessStr\":\"" + borrowLog.GetProcessStr(temp) + "\",\"MonthsStr\":\"" + borrowLog.GetMonthsStr(temp)
                              + "\",\"PrincipalInterest\":\"" + Tool.MoneyHelper.ConvertDetailWanMoney(myLoanModel.PrincipalInterest)
                              + "\",\"LinkUrl\":\"" + borrowLog.GetLinkUrl(temp)
                              + "\",\"CircleCss\":\"" + borrowLog.GetCircleCss(temp)
                              + "\",\"AddDate\":\"" + Convert.ToDateTime(temp.AddDate).ToString("yyyy-MM-dd")
                              + "\",\"DeadlineStr\":\"" + borrowLog.GetDeadlineStr(temp)
                              + "\",\"InterestRate\":\"" + ToolStatus.DeleteZero(temp.InterestRate));

                    if (index == myLoanModel.List.Count())
                    {
                        sb.Append("\"}]}");
                    }
                    else
                    {
                        sb.Append("\"},");
                    }
                    index++;
                }
            }
            else
            {
                sb.Append("{\"result\":\"0\",\"totalcount\":\"" + totalcount + "\",\"pagecount\":\"0\"}");
            }
            this.Context.Response.Write(sb.ToString());
            this.Context.Response.End();
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 显示加息标签
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        protected string ShowWeRank(WeProductDetailInfo model)
        {
            string pic = "";


            //发标时就设置奖励
            if ((model.TuandaiRedRate ?? 0) > 0)
            {
                if (string.IsNullOrEmpty(model.TuanDaiRedTitle))
                {
                    model.TuanDaiRedTitle = "加息";
                }

                pic = "<div class=\"rect_r f11px c-ffffff text-center\" style=\"width: auto;padding: 0px 10px;\">" + model.TuanDaiRedTitle + ToolStatus.DeleteZero(model.TuandaiRedRate) + "%</div>";
            }
            return(pic);
        }
Ejemplo n.º 17
0
        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);
            }
            borrowerUserInfo    = userbll.GetUserBasicInfoModelById(model.UserId.Value);
            borrowerUserInfoExt = userbll.GetUserBasicInfoExtInfo(model.UserId.Value);

            this.GetBorrowerData();

            InterestRateNum1 = ToolStatus.DeleteZero(model.InterestRate.Value).Split('.')[0];
            InterestRateNum2 = ToolStatus.DeleteZero(model.InterestRate.Value).Contains(".") ? ToolStatus.DeleteZero(model.InterestRate.Value).Split('.')[1] : string.Empty;
            if (model.Status != 3 && model.Status != 6)
            {
                RemainMoney = (int.Parse(ToolStatus.diff(model.TotalShares ?? 0, model.CastedShares ?? 0)) * decimal.Parse(ToolStatus.DeleteZero(model.LowerUnit.Value))).ToString("N2");
            }
            else
            {
                RemainMoney = "0";
            }
            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);

            List <SubscribeTotalInfo> repaylist = new SubscribeBLL().GetRepaymentInfo(this.projectId.Value);

            if (repaylist != null && repaylist.Count > 0)
            {
                foreach (SubscribeTotalInfo item in repaylist)
                {
                    switch (item.status)
                    {
                    case 1:
                        repayedAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                        break;

                    case 2:
                        overdueAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                        break;

                    case 3:
                        duerepayAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                        break;
                    }
                }
            }

            string jzsql     = "select isnull(AvgNetAssets,0) from VipMonthlyNetAssets with(nolock) where UserId=@UserId and ReportDate=@ReportDate";
            var    dyParamJZ = new Dapper.DynamicParameters();

            dyParamJZ.Add("@UserId", model.UserId.Value);
            dyParamJZ.Add("@ReportDate", DateTime.Now.AddMonths(-1).ToString("yyyy-MM-01"));
            this.monthJZ = TuanDai.DB.TuanDaiDB.QueryFirstOrDefault <decimal>(TdConfig.ApplicationName, TdConfig.DBReportWrite, jzsql, ref dyParamJZ);

            regulaSet     = new WebSettingBLL().GetWebSettingInfo("293A1C07-1D90-4D22-ADD4-39E6735DAC06");
            InterestModel = TuanDai.PortalSystem.Redis.ProjectRedis.GetProjectInterestMode(model.Type.Value, model.RepaymentType.Value);


            //  截标时间为NULL时候取审核时间  +4 天
            if (model.TenderDate == null)
            {
                WebSettingInfo set = new WebSettingBLL().GetWebSettingInfo("3F902315-6986-44FF-9F00-9D420C07FCDA");
                if (model.AddDate >= Convert.ToDateTime(set.Param4Value))
                {
                    model.TenderDate = Convert.ToDateTime(model.AuditDate == null ? model.AddDate : model.AuditDate).AddDays(2);
                }
                else
                {
                    model.TenderDate = Convert.ToDateTime(model.AuditDate == null ? model.AddDate : model.AuditDate).AddDays(4);
                }
            }


            if (model.AuditDate == null)
            {
                model.TenderStartDate = model.AddDate;
            }
            else
            {
                model.TenderStartDate = model.AuditDate;
            }

            return(true);
        }
Ejemplo n.º 18
0
        //获取债权转让列表
        public void GetZQZRCanTransferList()
        {
            int    pageSize  = GlobalUtils.PageSize;
            int    pageIndex = Tool.SafeConvert.ToInt32(Context.Request.Form["pageIndex"], 1);
            string pStatus   = WEBRequest.GetFormString("status");

            if (pageIndex < 1)
            {
                pageIndex = 1;
            }
            Guid userid = WebUserAuth.UserId.HasValue ? WebUserAuth.UserId.Value : Guid.Empty;

            if (userid == Guid.Empty)
            {
                PrintJson("0", "您还未登录!");
                return;
            }

            int outputStatus = 0;

            if (pStatus == "CanTran")
            {
                #region 可转让标
                int count = 0;
                List <NegotiableInfo>    list     = new TuanDai.PortalSystem.BLL.SubScriberansferBLL().GetNegotiableList(userid, 3, pageIndex, pageSize, out outputStatus, out count);
                List <NegotiableInfoExt> dataList = new List <NegotiableInfoExt>();

                if (outputStatus == -1)
                {
                    PrintJson("0", "有发净股标或者逾期垫付未还");
                }
                else
                {
                    foreach (NegotiableInfo item in list)
                    {
                        NegotiableInfoExt extItem = new NegotiableInfoExt();
                        extItem.ProjectId         = item.ProjectId;
                        extItem.Id                = item.Id;
                        extItem.Title             = item.Title;
                        extItem.TotalRefundMonths = item.TotalRefundMonths;
                        extItem.RefundedMonths    = item.RefundedMonths;
                        extItem.TypeName          = ToolStatus.ConvertProjectType(item.Type);
                        extItem.DueInAmount       = ToolStatus.ConvertLowerMoney(item.Amount + item.InterestAmout);
                        extItem.PreCycDateStr     = item.PreCycDate.ToString("yyyy-MM-dd");
                        extItem.TenderModeName    = GetTenderMode(item.TenderMode);
                        extItem.InterestRate      = ToolStatus.DeleteZero(item.InterestRate);
                        extItem.RepaymentType     = ToolStatus.ConvertRepaymentType(item.RepaymentType);
                        dataList.Add(extItem);
                    }
                }
                if (count == 0)
                {
                    PrintJson("0", "没有找到数据");
                    return;
                }
                int pageCount = GetPageCount(count, pageSize);
                var objData   = new { result = "1", msg = "", pageCount = pageCount, list = dataList };
                PrintJson(objData);
                #endregion
            }
            else if (pStatus == "Traning")
            {
                #region 转让中
                int transferCount = 0;
                List <SubScribeTransferInfo> tempList = new TuanDai.PortalSystem.BLL.SubScriberansferBLL().GetSubScribeTransferList(userid, 1, pageSize, pageIndex, out transferCount);
                if (transferCount == 0)
                {
                    PrintJson("0", "没有找到数据");
                    return;
                }
                int pageCount = GetPageCount(transferCount, pageSize);
                List <SubScribeTransferInfoExt> dataList = new List <SubScribeTransferInfoExt>();
                foreach (SubScribeTransferInfo item in tempList)
                {
                    SubScribeTransferInfoExt extItem = new SubScribeTransferInfoExt();
                    extItem.ProjectId         = item.ProjectId;
                    extItem.Id                = item.Id;
                    extItem.Title             = item.Title;
                    extItem.SumTransferAmount = ToolStatus.ConvertLowerMoney(item.sumTransferAmount);
                    extItem.ProgressStr       = Convert.ToDouble(item.Progress).ToString("f1");
                    extItem.LastTimeStr       = item.remainTime;
                    extItem.AddDate           = item.AddDate;
                    extItem.TotalAmountStr    = ToolStatus.ConvertLowerMoney(item.TotalAmount);
                    DateTime EndTransferDate = DateTime.Parse(item.AddDate.ToString("yyyy-MM-dd") + " 23:59:59");
                    if (DateTime.Now > EndTransferDate)
                    {
                        extItem.LastSecond = 0;
                    }
                    else
                    {
                        extItem.LastSecond = Convert.ToInt32((EndTransferDate - DateTime.Now).TotalSeconds);
                    }
                    dataList.Add(extItem);
                }
                var objData = new { result = "1", msg = "", pageCount = pageCount, list = dataList };
                PrintJson(objData);
                #endregion
            }
            else
            {
                #region 已完成
                int transferCount = 0;
                List <SubScribeTransferInfo> tempList = new TuanDai.PortalSystem.BLL.SubScriberansferBLL().GetSubScribeTransferList(userid, 2, pageSize, pageIndex, out transferCount);
                if (transferCount == 0)
                {
                    PrintJson("0", "没有找到数据");
                    return;
                }
                int pageCount = GetPageCount(transferCount, pageSize);
                List <SubScribeTransferInfoExt> dataList = new List <SubScribeTransferInfoExt>();
                foreach (SubScribeTransferInfo item in tempList)
                {
                    SubScribeTransferInfoExt extItem = new SubScribeTransferInfoExt();
                    extItem.ProjectId         = item.ProjectId;
                    extItem.Id                = item.Id;
                    extItem.Title             = item.Title;
                    extItem.SumTransferAmount = ToolStatus.ConvertLowerMoney(item.sumTransferAmount);
                    extItem.ProgressStr       = Convert.ToDouble(item.Progress).ToString("f1");
                    dataList.Add(extItem);
                }
                var objData = new { result = "1", msg = "", pageCount = pageCount, list = dataList };
                PrintJson(objData);
                #endregion
            }
        }
Ejemplo n.º 19
0
        protected void QueryPrizeUseStatus()
        {
            if (WEBRequest.GetQueryString("prizeid") != "")
            {
                PrizeId = Guid.Parse(WEBRequest.GetQueryString("prizeid"));
            }
            if (!PrizeId.HasValue || PrizeId == Guid.Empty)
            {
                return;
            }

            Guid subId;

            Guid.TryParse(Request["subscribeid"], out subId);
            TuanDai.UserPrizeNew.ServiceClient.Models.UserPrizeRecordInfo record = null;


            TuanDai.UserPrizeNew.Client.DAL.UserPrizeRecordDAL dal =
                new TuanDai.UserPrizeNew.Client.DAL.UserPrizeRecordDAL(TdConfig.ApplicationName);
            if (subId != Guid.Empty && subId != null)
            {
                record = dal.GetSubcribePrizeStatus(subId, PrizeId.Value, false);
            }

            if (record == null)
            {
                PrizeStatus = 0;
                UserPrizeQueryClient prizeClient = new UserPrizeQueryClient(TdConfig.ApplicationName);
                string errorMsg = "";
                TuanDai.UserPrizeNew.ServiceClient.Models.UserPrizeInfo prizeInfo = prizeClient.GetUserPrizeById(PrizeId.Value, WebUserAuth.UserId.Value, out errorMsg, false);
                if (prizeInfo != null)
                {
                    PrizeStatus = prizeInfo.IsUsed ? 1 : 0;
                    if (prizeInfo.TypeId == 3)
                    {
                        PrizeDesc = ToolStatus.DeleteZero(prizeInfo.PrizeValue) + "元投资红包";
                    }
                    else if (prizeInfo.TypeId == 18)
                    {
                        PrizeDesc = ToolStatus.DeleteZero(prizeInfo.PrizeValue) + "%加息券";
                    }
                }
                return;
            }
            PrizeStatus = 1;
            if (record.PrizeTypeId == 3)
            {
                PrizeDesc = ToolStatus.DeleteZero(record.Amount) + "元投资红包";
            }
            else if (record.PrizeTypeId == 18)
            {
                PrizeDesc = ToolStatus.DeleteZero(record.Amount) + "%加息券";
                if (InvestType == "project")
                {
                    if (projectInfo != null)
                    {
                        PrizeAddInterest = CommUtils.GetInterestAmount(PayMoney, projectInfo.RepaymentType.Value, projectInfo.DeadType.Value, projectInfo.Deadline.Value, record.Amount);
                    }
                }
                else if (InvestType == "weplan")
                {
                    if (product != null)
                    {
                        PrizeAddInterest = CommUtils.GetInterestAmount(PayMoney, 1, product.DeadType.Value, product.Deadline.Value, record.Amount);
                    }
                }
            }
        }