Example #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"));
            }
        }
Example #2
0
        private bool GetData()
        {
            if (productId == null || productId == Guid.Empty)
            {
                return(false);
            }

            WeProductBLL bll = new WeProductBLL();

            //model = bll.GetWeProductInfo(productId);
            if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
            {
                string err         = string.Empty;
                var    weRedisInfo = TuanDai.RedisApi.Client.WePlanRedis.GetWePlanRedisByProductIdJson(productId,
                                                                                                       out err, TdConfig.ApplicationName);
                if (weRedisInfo != null)
                {
                    model = JsonConvert.DeserializeObject <WeProductDetailInfo>(weRedisInfo);
                }
                if (model == null || !string.IsNullOrEmpty(err))
                {
                    model = new WeProductBLL().GetWeProductInfo(productId);
                }
            }
            else
            {
                model = new WeProductBLL().GetWeProductInfo(productId);
            }
            if (model == null)
            {
                return(false);
            }
            return(true);
        }
Example #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);
        }
Example #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     IsWeNewHand = WEBRequest.GetString("isWeNewHand", "0") == "1";
     IsWeFQB     = WEBRequest.GetString("isWeFQB", "0") == "1";
     if (IsWeFQB || IsWeNewHand)
     {
         Guid?        productId = Tool.SafeConvert.ToGuid(WEBRequest.GetQueryString("productid"));
         WeProductBLL bll       = new WeProductBLL();
         //model = bll.GetWeProductInfo(productId.Value);
         if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
         {
             string err         = string.Empty;
             var    weRedisInfo = TuanDai.RedisApi.Client.WePlanRedis.GetWePlanRedisByProductIdJson(productId.Value,
                                                                                                    out err, TdConfig.ApplicationName);
             if (weRedisInfo != null)
             {
                 model = JsonConvert.DeserializeObject <WeProductDetailInfo>(weRedisInfo);
             }
             if (model == null || !string.IsNullOrEmpty(err))
             {
                 model = new WeProductBLL().GetWeProductInfo(productId.Value);
             }
         }
         else
         {
             model = new WeProductBLL().GetWeProductInfo(productId.Value);
         }
         if (model == null)
         {
             model = new WeProductDetailInfo();
         }
     }
 }
Example #5
0
        private bool GetData()
        {
            model = bll.GetWeProductInfo(projectId.Value);
            if (model == null)
            {
                return(false);
            }

            return(true);
        }
Example #6
0
        private bool GetData()
        {
            //model = bll.GetWeProductInfo(projectId.Value);
            if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
            {
                string err         = string.Empty;
                var    weRedisInfo = TuanDai.RedisApi.Client.WePlanRedis.GetWePlanRedisByProductIdJson(projectId.Value,
                                                                                                       out err, TdConfig.ApplicationName);
                if (weRedisInfo != null)
                {
                    model = JsonConvert.DeserializeObject <WeProductDetailInfo>(weRedisInfo);
                }
                if (model == null || !string.IsNullOrEmpty(err))
                {
                    model = new WeProductBLL().GetWeProductInfo(projectId.Value);
                }
            }
            else
            {
                model = new WeProductBLL().GetWeProductInfo(projectId.Value);
            }
            if (model == null)
            {
                return(false);
            }
            //if (model.StartDate >= DateTime.Parse(SetModel1.Param1Value) &&
            //    model.StartDate < DateTime.Parse(SetModel1.Param2Value))
            //{
            //    IsWeZnq = true;
            //    JxRate = decimal.Parse(SetModel1.Param3Value);
            //}
            //if ((model.TypeWord.ToLower().Contains("p") || model.TypeWord.ToLower().Contains("r") ||
            //     model.TypeWord.ToLower().Contains("q")) && model.StartDate >= DateTime.Parse(SetModel.Param1Value) &&
            //    model.StartDate < DateTime.Parse(SetModel.Param2Value))
            //{
            //    IsWeZnq = true;
            //    JxRate = decimal.Parse(SetModel.Param3Value);
            //}
            #region 判断满标
            if (model.StartDate > DateTime.Now && model.StatusId == 1)
            {
                IsWeFinish = false;
            }
            else if (model.StartDate < DateTime.Now && model.OrderQty != model.TotalQty)
            {
                IsWeFinish = false;
            }
            else
            {
                IsWeFinish = true;
            }
            #endregion

            return(true);
        }
Example #7
0
 /// <summary>
 /// 期限
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public string GetDeadlineString(WeProductDetailInfo model)
 {
     if (model.DeadType == 1)
     {
         return(model.Deadline + "个月");
     }
     else
     {
         return(model.Deadline + "天");
     }
 }
Example #8
0
        /// <summary>
        /// 剩余金额
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string GetLostMoneyString(WeProductDetailInfo model)
        {
            decimal amount = ((model.TotalQty ?? 0) - (model.OrderQty ?? 0)) * (model.UnitAmount ?? 0);

            if (amount > 10000)
            {
                return(ToolStatus.ConvertLowerMoney(amount / 10000) + "万");
            }
            else
            {
                return(ToolStatus.ConvertLowerMoney(amount) + "元");
            }
        }
Example #9
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));
        }
Example #10
0
        //获取We计划数据
        protected void GetWeList()
        {
            //FirstWeInfo = projectBll.WXGetHomeWeList(1).ToList().FirstOrDefault();
            string sql =
                @"  SELECT top 1 A.Id AS ProductId, A.ProductName, A.ProductTypeId, A.YearRate, A.StatusId, A.Deadline, A.StartDate, A.EndDate, A.InvestCompleteDate, A.OrderCompleteDate, ISNULL(A.MinYearRate, 0) AS MinYearRate, ISNULL(A.IsWeFQB, 0) AS IsWeFQB,pd.OrderQty,A.UnitAmount,A.PlanAmount,B.TypeWord
                        FROM  dbo.We_Product A WITH (NOLOCK)
                        INNER JOIN dbo.We_ProductType B WITH (NOLOCK) ON A.Id=b.NewProductId
                        INNER JOIN dbo.We_ProductDetail pd WITH(NOLOCK) ON a.Id = pd.ProductId
                        WHERE b.TypeWord IN('Y','C','X','B','A','G')
                        ORDER BY A.StatusId, B.SortOrder asc, A.YearRate desc, A.Deadline, A.StartDate desc";
            var para = new Dapper.DynamicParameters();

            FirstWeInfo = PublicConn.QuerySingle <WeProductDetailInfo>(sql, ref para);
        }
Example #11
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);
        }
Example #12
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);
        }
Example #13
0
        /// <summary>
        /// 获取标详情页显示的利率
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string GetProjectDetailShowRate(WeProductDetailInfo model)
        {
            //<span class='f36px c-fa7d00'>7</span>.5%+5.5%
            decimal rate      = model.YearRate ?? 0;
            string  strResult = "";

            strResult = string.Format("<span class='f36px c-fa7d00'>{0}</span>{1}%", CommUtils.GetFloatDivideStr(rate, 1), CommUtils.GetFloatDivideStr(rate, 2));
            if (model.IsNewHand && (model.TuandaiRedRate ?? 0) > 0)
            {
                decimal NewHandRate = StrObj.StrToDecimalDef((model.TuandaiRedRate ?? 0).ToString(), 0);
                strResult += string.Format("+{0}{1}%", CommUtils.GetFloatDivideStr(NewHandRate, 1), CommUtils.GetFloatDivideStr(NewHandRate, 2));
            }
            else
            {
                strResult += "";
            }
            return(strResult);
        }
Example #14
0
        protected void LoadData()
        {
            Guid?          userId           = WebUserAuth.UserId;
            WeProductBLL   bll              = new WeProductBLL();
            WebSettingBLL  setbll           = new WebSettingBLL();
            WebSettingInfo setInfo1         = setbll.GetWebSettingInfo("5E08DFE3-6CED-4E71-8CF9-2A2E3BAC9036");
            WebSettingInfo setInfo2         = setbll.GetWebSettingInfo("06A6344D-E1FB-4AAA-890A-E39351D5E7A3");
            decimal        rewardInterest_1 = 0;

            string strSQL = "select ProductId, OrderDate, isnull(InvestedAmount,0) as InvestedAmount, isnull(TuandaiRedRate,0) as TuandaiRedRate  from dbo.We_Order with(nolock) where Id=@weOrderId";

            Dapper.DynamicParameters dyParams = new Dapper.DynamicParameters();
            dyParams.Add("@weOrderId", weOrderId);
            MyWePlanOrderInfo weOrderInfo = PublicConn.QuerySingle <MyWePlanOrderInfo>(strSQL, ref dyParams);

            //model = bll.GetWeProductInfo(weOrderInfo.ProductId);
            if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
            {
                string err         = string.Empty;
                var    weRedisInfo = TuanDai.RedisApi.Client.WePlanRedis.GetWePlanRedisByProductIdJson(weOrderInfo.ProductId,
                                                                                                       out err, TdConfig.ApplicationName);
                if (weRedisInfo != null)
                {
                    model = JsonConvert.DeserializeObject <WeProductDetailInfo>(weRedisInfo);
                }
                if (model == null || !string.IsNullOrEmpty(err))
                {
                    model = new WeProductBLL().GetWeProductInfo(weOrderInfo.ProductId);
                }
            }
            else
            {
                model = new WeProductBLL().GetWeProductInfo(weOrderInfo.ProductId);
            }
            DueInterestAmount = 0;

            //查询订单加息
            RewardRate += GetOrderJxRate(weOrderInfo.TuandaiRedRate, weOrderId.Value, userId.Value);

            rewardInterest_1   = GetInterest(weOrderInfo.InvestedAmount, model.Deadline ?? 0, GetOrderJxRate(weOrderInfo.TuandaiRedRate, weOrderId.Value, userId.Value));
            RewardInterest     = rewardInterest_1;
            DueInterestAmount  = GetInterest(weOrderInfo.InvestedAmount, model.Deadline ?? 0, model.YearRate ?? 0);
            DueInterestAmount += RewardInterest;
        }
Example #15
0
 public static string GetDeadlineString(WeProductDetailInfo item)
 {
     if (item.IsWeFQB || item.ProductName.ToLower().Contains("a"))
     {
         return("到期本息...");
     }
     else if (item.ProductName.ToLower().Contains("b") || item.ProductName.ToLower().Contains("c") || item.ProductName.ToLower().Contains("h"))
     {
         return("每月付息");
     }
     else if (item.ProductName.ToLower().Contains("g") || item.IsFTB)
     {
         return("到期本息");
     }
     else
     {
         return("");
     }
 }
Example #16
0
        protected string GetWeDetailUrl(WeProductDetailInfo item)
        {
            string strGo = "";

            if (item.IsWeFQB)
            {
                strGo = "/pages/invest/WE/WeFqb_detail.aspx?id=" + item.ProductId;
            }
            else if (item.IsFTB)
            {
                strGo = "/pages/invest/WE/WeFtb_detail.aspx?id=" + item.ProductId;
            }
            else
            {
                strGo = "/pages/invest/WE/WE_detail.aspx?id=" + item.ProductId;
            }

            strGo += "&typeId=" + item.ProductTypeId + "&IsPreSell=" + (item.IsPreSell ? 1 : 0).ToString();
            return(strGo);
        }
Example #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var idStr = WEBRequest.GetString("projectid");

            if (!string.IsNullOrEmpty(idStr))
            {
                projectId = Guid.Parse(idStr);
            }
            else
            {
                Response.Redirect("/pages/invest/invest_list.aspx");
            }

            InvestType = WEBRequest.GetString("investType");

            var payMoneyStr = WEBRequest.GetString("payMoney");

            if (!string.IsNullOrEmpty(payMoneyStr))
            {
                PayMoney = decimal.Parse(payMoneyStr);
            }
            else
            {
                Response.Redirect("/pages/invest/invest_list.aspx");
            }

            ProfitMoney = WEBRequest.GetString("profitMoney");
            ProfitMoney = ProfitMoney.Replace("¥", "");
            try
            {
                if (ProfitMoney.ToText() != "" && !ProfitMoney.Contains("~"))
                {
                    //获取团币系数
                    NewVipUserInfo UserVipModel = GetNewVipUserInfo(WebUserAuth.UserId.Value);
                    decimal        tuanBiXiShu  = 0;
                    if (UserVipModel != null)
                    {
                        tuanBiXiShu = UserVipModel.TuanBiCoefficient;
                    }
                    TuanBi = Math.Floor(tuanBiXiShu * decimal.Parse(ProfitMoney)).ToString();
                }
            }
            catch
            {
                TuanBi = "0";
            }

            IsWeFQB = false;

            if (InvestType == "project")
            {
                #region 散标投资
                string sql = "select count(0) from Project with(nolock) where id=@id";
                Dapper.DynamicParameters para = new Dapper.DynamicParameters();
                para.Add("@id", projectId);
                var count = PublicConn.QuerySingle <int>(sql, ref para);
                if (count > 0)
                {
                    FinishUrl = "/pages/invest/detail.aspx?id=" + projectId;
                    sql       = "SELECT top 1 s.Id FROM dbo.Project p WITH(NOLOCK) INNER JOIN dbo.Subscribe s WITH(NOLOCK) ON p.Id = s.ProjectId WHERE p.Id=@id AND s.SubscribeUserId=@userid ORDER BY s.AddDate DESC";
                    para      = new Dapper.DynamicParameters();
                    para.Add("@id", projectId);
                    para.Add("@userid", WebUserAuth.UserId.Value);
                    var subscribeId = PublicConn.QuerySingleWrite <Guid>(sql, ref para);
                    InvestUrl =
                        "/Member/Repayment/my_return_details.aspx?SubscribeId=" + subscribeId + "&ProjectId=" + projectId + "&tab=Inprogress";
                    GoOnUrl = "/pages/invest/invest_list.aspx";

                    projectInfo = new ProjectBLL().GetProjectDetailInfo(projectId);
                    if (projectInfo.Type == 6 || projectInfo.Type == 19 || projectInfo.Type == 20 || projectInfo.Type == 21 || projectInfo.Type == 17)
                    {
                        TuanBi = TuanBi;
                    }
                    else
                    {
                        TuanBi = Math.Floor(decimal.Parse(TuanBi) / projectInfo.Deadline ?? 1).ToString();
                    }
                }
                else
                {
                    FinishUrl = "/pages/invest/zqzr_detail.aspx?projectid=" + projectId;
                    sql       = "SELECT top 1 t.m_Title,s.Id FROM dbo.t_SubScribeTransfer t WITH(NOLOCK) INNER JOIN dbo.Subscribe s WITH(NOLOCK) ON t.m_Id = s.TranId WHERE t.m_Id=@id AND s.SubscribeUserId=@userid  ORDER BY s.TranDate DESC";
                    para      = new Dapper.DynamicParameters();
                    para.Add("@id", projectId);
                    para.Add("@userid", WebUserAuth.UserId.Value);
                    var tModel = PublicConn.QuerySingleWrite <TranModel>(sql, ref para);
                    if (tModel != null)
                    {
                        InvestUrl =
                            "/Member/Repayment/my_debt_carry_detail.aspx?SubscribeId=" + tModel.Id + "&Title=" + tModel.m_Title + "&projectid=78ab9bb8-1b12-4574-9326-cbba119956d4&tab=Inprogress";
                    }
                    else
                    {
                        InvestUrl = "/Member/Repayment/my_return_list.aspx";
                    }
                    GoOnUrl = "/pages/invest/debt_list.aspx";

                    TuanBi = "0";
                }
                #endregion
            }
            else
            {
                #region We计划
                //product = new WeProductBLL().GetWeProductInfo(projectId);
                if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
                {
                    string err         = string.Empty;
                    var    weRedisInfo = TuanDai.RedisApi.Client.WePlanRedis.GetWePlanRedisByProductIdJson(projectId,
                                                                                                           out err, TdConfig.ApplicationName);
                    if (weRedisInfo != null)
                    {
                        product = JsonConvert.DeserializeObject <WeProductDetailInfo>(weRedisInfo);
                    }
                    if (product == null || !string.IsNullOrEmpty(err))
                    {
                        product = new WeProductBLL().GetWeProductInfo(projectId);
                    }
                }
                else
                {
                    product = new WeProductBLL().GetWeProductInfo(projectId);
                }
                var cookieUrl = CookieHelper.GetCookie("Anniversary4"); //HttpContext.Current.Request.Cookies["Anniversary4"];
                if (!string.IsNullOrEmpty(cookieUrl))
                {
                    activityUrl = cookieUrl;
                    //删除cookie Anniversary4
                    if (product.TypeWord.ToLower().Contains("p") || product.TypeWord.ToLower().Contains("q") || product.TypeWord.ToLower().Contains("r"))
                    {
                        CookieHelper.ClearCookie("Anniversary4");
                    }
                }
                string sql = "select count(0) from we_product with(nolock) where id=@id and iswefqb = 1";
                Dapper.DynamicParameters para = new Dapper.DynamicParameters();
                para.Add("@id", projectId);
                var count = PublicConn.QuerySingle <int>(sql, ref para);

                sql  = "select top 1 o.id from we_product p with(nolock) inner join we_order o with(nolock) on p.id=o.productid where p.id=@id and o.userid=@userid order by OrderDate desc";
                para = new Dapper.DynamicParameters();
                para.Add("@id", projectId);
                para.Add("@userid", WebUserAuth.UserId.Value);
                var orderId = PublicConn.QuerySingleWrite <Guid>(sql, ref para);
                if (count > 0)
                {
                    IsWeFQB   = true;
                    FinishUrl = "/pages/invest/WE/WeFqb_detail.aspx?id=" + projectId;
                    InvestUrl = "/Member/Repayment/Wefqb_project.aspx?weorderid=" + orderId + "&tab=Inprogress";
                }
                else
                {
                    FinishUrl = "/pages/invest/WE/WE_detail.aspx?id=" + projectId;
                    InvestUrl =
                        "/Member/Repayment/We_project.aspx?weorderid=" + orderId + "&tab=Inprogress";
                }
                GoOnUrl = "/pages/invest/WE/WE_list.aspx";

                if (product != null && (product.TuandaiCashRate ?? 0) > 0)
                {
                    if (product.CashLimitAmount == 0 || PayMoney >= product.CashLimitAmount)
                    {
                        FXAmount = PayMoney * product.TuandaiCashRate.Value / 100;
                    }
                }
                if (product != null)
                {
                    if (product.DeadType == 1)
                    {
                        TuanBi = Math.Floor(decimal.Parse(TuanBi) / product.Deadline ?? 1).ToString();
                    }
                    else
                    {
                        TuanBi = Math.Floor(decimal.Parse(TuanBi)).ToString();
                    }
                }
                #endregion
            }
            //计算红包状态
            QueryPrizeUseStatus();
        }
Example #18
0
 public string GetDetailLink(WeProductDetailInfo item)
 {
     return("/pages/invest/We/WeFtb_detail.aspx?id=" + item.ProductId + "&typeId=" + item.ProductTypeId + "&IsPreSell=0");
 }
Example #19
0
        private bool GetData()
        {
            //获取项目信息
            if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
            {
                this.model = new WeProductBLL().GetWePlanByRedis(TypeId, projectId.Value, IsPreSell, TdConfig.ApplicationName);
            }
            else
            {
                this.model = bll.GetWeProductInfo(projectId.Value);
            }
            if (model == null || model.IsFTB == false)
            {
                return(false);
            }

            #region 判断满标
            if (model.StartDate > DateTime.Now && model.StatusId == 1)
            {
                IsWeFinish = false;
            }
            else if (model.StartDate < DateTime.Now && model.OrderQty != model.TotalQty)
            {
                IsWeFinish = false;
            }
            else
            {
                IsWeFinish = true;
            }
            #endregion

            #region 判断新手标
            if (!model.IsNewHand)
            {
                WeFTBBLL ftbll = new WeFTBBLL();
                FTBRateList = this.GetWeFTBRateList(model.ProductTypeId ?? 0, model.StartDate ?? DateTime.Today);
                if (FTBRateList == null)
                {
                    FTBRateList = new List <WeProductFTBRateInfo>();
                }

                //补充提前退出前几个月的数据
                if (FTBRateList.Any())
                {
                    WeProductFTBRateInfo        firstRate = FTBRateList[0];
                    List <WeProductFTBRateInfo> tmpList   = new List <WeProductFTBRateInfo>();
                    for (int i = 1; i < model.ExitLockMonth; i++)
                    {
                        tmpList.Add(new WeProductFTBRateInfo()
                        {
                            MonthType = i, ProductTypeId = model.ProductTypeId ?? 0, YearRate = firstRate.YearRate
                        });
                    }
                    if (tmpList.Any())
                    {
                        FTBRateList.InsertRange(0, tmpList);
                    }
                }
                FTBRateList = FTBRateList.OrderByDescending(p => p.MonthType).ToList();
            }
            #endregion

            decimal deadLineType = model.DeadType == 1 ? 12 : 365;
            PreInterestRate = decimal.Parse("10000") * (model.Deadline ?? 0) * ((model.YearRate ?? 0) + (model.TuandaiRedRate ?? 0)) * decimal.Parse("0.01") / deadLineType;
            EbaoMultiple    = int.Parse(Math.Ceiling(model.YearRate.Value / decimal.Parse("2.5")).ToString());
            EbaoInterest    = GetEbaoMultipleInterest(10000);

            GetLimitInvestMoney();

            WebSettingBLL webSettingBll = new WebSettingBLL();

            preSellSet    = webSettingBll.GetWebSettingInfo("6F9D3B77-C15C-4A5A-B883-21004E10BE29");
            curSellSet    = webSettingBll.GetWebSettingInfo("B11558CB-3C6B-4DAD-9D2F-D6D2DE13CCF7");
            sellSet518    = webSettingBll.GetWebSettingInfo("5E02F517-E6FC-4451-8232-378377837EC1");
            IsPreView1218 = System.Configuration.ConfigurationManager.AppSettings["IsPreView1218"];
            if (IsPreView1218 == "1")
            {
                preSellSet.Param1Value = DateTime.Today.ToString("yyyy-MM-dd");
                preSellSet.Param2Value = DateTime.Today.ToString("yyyy-MM-dd 23:59:59");
            }
            else if (IsPreView1218 == "2")
            {
                preSellSet.Param1Value = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd");
                preSellSet.Param2Value = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd 23:59:59");

                curSellSet.Param1Value = DateTime.Today.ToString("yyyy-MM-dd");
                curSellSet.Param2Value = DateTime.Today.ToString("yyyy-MM-dd 23:59:59");
            }
            return(true);
        }
Example #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Redirect("//m.tuandai.com/pages/downOpenApp.aspx", true);
            return;

            this.projectId = WEBRequest.GetGuid("id");

            if (this.projectId != Guid.Empty)
            {
                string tdfrom     = Request.QueryString["tdfrom"];
                string DOMAINNAME = ConfigurationManager.AppSettings["CookieDomain"];
                //第三方跳投标地址记录来源信
                if (!string.IsNullOrEmpty(tdfrom))
                {
                    if (!string.IsNullOrEmpty(CookieHelper.GetCookie("tdfrom")))
                    {
                        Tool.CookieHelper.ClearCookie("tdfrom");
                    }
                    Tool.CookieHelper.WriteCookie(DOMAINNAME, "tdfrom", tdfrom, 24 * 60 * 7);//保存7天
                }
                WeProductBLL bll = new WeProductBLL();
                //WeProductDetailInfo weInfo = bll.GetWeProductInfo(projectId.Value);
                WeProductDetailInfo weInfo = null;
                if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
                {
                    string err         = string.Empty;
                    var    weRedisInfo = TuanDai.RedisApi.Client.WePlanRedis.GetWePlanRedisByProductIdJson(projectId.Value,
                                                                                                           out err, TdConfig.ApplicationName);
                    if (weRedisInfo != null)
                    {
                        weInfo = JsonConvert.DeserializeObject <WeProductDetailInfo>(weRedisInfo);
                    }
                    if (weInfo == null || !string.IsNullOrEmpty(err))
                    {
                        weInfo = new WeProductBLL().GetWeProductInfo(projectId.Value);
                    }
                }
                else
                {
                    weInfo = new WeProductBLL().GetWeProductInfo(projectId.Value);
                }
                string url;
                if (weInfo != null)
                {
                    if (weInfo.IsWeFQB)
                    {  //分期宝
                        url = string.Format("/pages/invest/WE/WeFqb_detail.aspx?id={0}&typeId={1}&IsPreSell={2}", this.projectId, weInfo.ProductTypeId, weInfo.IsPreSell ? 1 : 0);
                    }
                    else if (weInfo.IsFTB) //复投宝
                    {
                        url = string.Format("/pages/invest/WE/WeFtb_detail.aspx?id={0}&typeId={1}&IsPreSell={2}", this.projectId, weInfo.ProductTypeId, weInfo.IsPreSell ? 1 : 0);
                    }
                    else
                    { //普通We计划
                        url = string.Format("/pages/invest/WE/WE_detail.aspx?id={0}&typeId={1}&IsPreSell={2}", this.projectId, weInfo.ProductTypeId, weInfo.IsPreSell ? 1 : 0);
                    }
                    Response.Redirect(url);
                }
                else
                {
                    Response.Redirect(GlobalUtils.WebURL);
                }
            }
            else
            {
                Response.Redirect(GlobalUtils.WebURL);
            }
        }
Example #21
0
        public static string GetWePlanSurplusMoney(WeProductDetailInfo weInfo)
        {
            decimal o = (weInfo.PlanAmount ?? 0) - (weInfo.OrderQty ?? 0) * (weInfo.UnitAmount ?? 0);

            return(string.Format("<span>{0}</span>{1}", (o >= 10000) ? ToolStatus.ConvertWanMoney(o) : ToolStatus.ConvertLowerMoney(o), (o >= 10000) ? "万" : "元"));
        }
Example #22
0
        public static decimal GetFloatSurplusMoney(WeProductDetailInfo weInfo)
        {
            decimal o = (weInfo.PlanAmount ?? 0) - (weInfo.OrderQty ?? 0) * (weInfo.UnitAmount ?? 0);

            return(o);
        }
Example #23
0
        protected string GetWePlanSurplusMoney(WeProductDetailInfo weInfo)
        {
            decimal o = (weInfo.PlanAmount ?? 0) - (weInfo.OrderQty ?? 0) * (weInfo.UnitAmount ?? 0);

            return(string.Format("<span class=\"c-212121 f13px\">{0}{1}</span>", (o >= 10000) ? ToolStatus.ConvertWanMoney(o) : ToolStatus.ConvertLowerMoney(o), (o >= 10000) ? "万" : "元"));
        }
Example #24
0
        /// <summary>
        /// 标的申购
        /// </summary>
        private string Project()
        {
            try
            {
                bool data = SecurityValidation();

                string       url;
                Guid         projId = Guid.Parse(_pid);
                WeProductBLL bll    = new WeProductBLL();
                //WeProductDetailInfo weProductDetailtInfo = bll.GetWeProductInfo(projId);
                WeProductDetailInfo weProductDetailtInfo = null;
                if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
                {
                    string err         = string.Empty;
                    var    weRedisInfo = TuanDai.RedisApi.Client.WePlanRedis.GetWePlanRedisByProductIdJson(projId,
                                                                                                           out err, TdConfig.ApplicationName);
                    if (weRedisInfo != null)
                    {
                        weProductDetailtInfo = JsonConvert.DeserializeObject <WeProductDetailInfo>(weRedisInfo);
                    }
                    if (weProductDetailtInfo == null || !string.IsNullOrEmpty(err))
                    {
                        weProductDetailtInfo = new WeProductBLL().GetWeProductInfo(projId);
                    }
                }
                else
                {
                    weProductDetailtInfo = new WeProductBLL().GetWeProductInfo(projId);
                }
                if (weProductDetailtInfo != null)
                {
                    if (weProductDetailtInfo.IsWeFQB)
                    {
                        url = string.Format("/pages/invest/WE/WeFqb_detail.aspx?id={0}", projId);
                    }
                    else if (weProductDetailtInfo.IsFTB)
                    {
                        url = string.Format("/pages/invest/WE/WeFtb_detail.aspx?id={0}", projId);
                    }
                    else
                    {
                        url = string.Format("/pages/invest/WE/WE_detail.aspx?id={0}", projId);
                    }
                    url += "&typeId=" + weProductDetailtInfo.ProductTypeId + "&IsPreSell=" + (weProductDetailtInfo.IsPreSell ? 1 : 0).ToString();
                }
                else
                {
                    url = GlobalUtils.WebURL;
                }
                //url = "/pages/invest/detail.aspx?id=" + data[2];
                if (!data)
                {
                    return(url);
                }

                return(JumpBase(_telNo, url));
            }
            catch (Exception ex)
            {
                SysLogHelper.WriteErrorLog(_app + "标的申购出错", ExceptionHelper.GetExceptionMessage(ex));
                return(GlobalUtils.WebURL);
            }
        }
Example #25
0
        private bool GetData()
        {
            //获取项目信息
            if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
            {
                this.model = new WeProductBLL().GetWePlanByRedis(TypeId, projectId.Value, IsPreSell, TdConfig.ApplicationName);
            }
            else
            {
                this.model = bll.GetWeProductInfo(projectId.Value);
            }

            if (model == null)
            {
                Response.Redirect("/pages/invest/we/WE_list.aspx", true);
                return(false);
            }

            if (model.IsWeFQB)
            {
                Response.Redirect(GlobalUtils.MTuanDaiURL + "/pages/invest/WE/WeFqb_detail.aspx?id=" + model.ProductId + (IsApp?"&type=mobileapp":""));
                return(false);
            }
            if (model.IsFTB)
            {
                Response.Redirect(GlobalUtils.MTuanDaiURL + "/pages/invest/WE/WeFtb_detail.aspx?id=" + model.ProductId + (IsApp ? "&type=mobileapp" : ""));
                return(false);
            }

            #region 判断满标
            if (model.StartDate > DateTime.Now && model.StatusId == 1)
            {
                IsWeFinish = false;
            }
            else if (model.StartDate < DateTime.Now && model.OrderQty != model.TotalQty)
            {
                IsWeFinish = false;
            }
            else if (((model.OrderQty == model.TotalQty && model.InvestCompleteDate.HasValue) || (model.OrderCompleteDate.HasValue && model.OrderCompleteDate.Value.AddDays(5) <= DateTime.Now)) && !model.IsWeFQB)
            {
                IsWeFinish = true;
            }
            else
            {
                IsWeFinish = true;
            }
            #endregion

            WebSettingBLL webSettingBll = new WebSettingBLL();
            preSellSet    = webSettingBll.GetWebSettingInfo("6F9D3B77-C15C-4A5A-B883-21004E10BE29");
            curSellSet    = webSettingBll.GetWebSettingInfo("B11558CB-3C6B-4DAD-9D2F-D6D2DE13CCF7");
            sellSet518    = webSettingBll.GetWebSettingInfo("5E02F517-E6FC-4451-8232-378377837EC1");
            IsPreView1218 = System.Configuration.ConfigurationManager.AppSettings["IsPreView1218"];
            if (IsPreView1218 == "1")
            {
                preSellSet.Param1Value = DateTime.Today.ToString("yyyy-MM-dd");
                preSellSet.Param2Value = DateTime.Today.ToString("yyyy-MM-dd 23:59:59");
            }
            else if (IsPreView1218 == "2")
            {
                preSellSet.Param1Value = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd");
                preSellSet.Param2Value = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd 23:59:59");
                curSellSet.Param1Value = DateTime.Today.ToString("yyyy-MM-dd");
                curSellSet.Param2Value = DateTime.Today.ToString("yyyy-MM-dd 23:59:59");
            }
            return(true);
        }
Example #26
0
        private void GetIsWeZnq()
        {
            Guid?         userId = WebUserAuth.UserId;
            WeProductBLL  bll    = new WeProductBLL();
            WebSettingBLL setbll = new WebSettingBLL();
            //var weproduct = bll.GetWeProductInfo(model.ProductId);
            WeProductDetailInfo weproduct = null;

            if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
            {
                string err         = string.Empty;
                var    weRedisInfo = TuanDai.RedisApi.Client.WePlanRedis.GetWePlanRedisByProductIdJson(model.ProductId,
                                                                                                       out err, TdConfig.ApplicationName);
                if (weRedisInfo != null)
                {
                    weproduct = JsonConvert.DeserializeObject <WeProductDetailInfo>(weRedisInfo);
                }
                if (weproduct == null || !string.IsNullOrEmpty(err))
                {
                    weproduct = new WeProductBLL().GetWeProductInfo(model.ProductId);
                }
            }
            else
            {
                weproduct = new WeProductBLL().GetWeProductInfo(model.ProductId);
            }
            IsY7Z7 = weproduct.TypeWord.ToLower().Contains("y7") || weproduct.TypeWord.ToLower().Contains("z7");

            //查询订单加息
            RewardRate    += GetOrderJxRate(weOrderId.Value, userId.Value);
            RewardInterest = GetInterest(model.AmountInvestment, model.Deadline, RewardRate);

            DueInterestAmount = model.DueInterestAmount + RewardInterest;
            if (RewardRate > 0)
            {
                IsWeZnq = true;
            }

            /*
             *
             * WebSettingInfo setInfo1 = setbll.GetWebSettingInfo("5E08DFE3-6CED-4E71-8CF9-2A2E3BAC9036");
             * WebSettingInfo setInfo2 = setbll.GetWebSettingInfo("06A6344D-E1FB-4AAA-890A-E39351D5E7A3");
             * decimal rewardInterest_1 = 0, rewardInterest_2 = 0, rewardInterest_3 = 0;
             * //查询预热期加息
             * if (setInfo1 != null)
             * {
             *  if (weproduct.StartDate.Value >= DateTime.Parse(setInfo1.Param1Value) && weproduct.StartDate.Value < DateTime.Parse(setInfo1.Param2Value))
             *  {
             *      IsWeZnq = weproduct.TypeWord.ToLower().IsIn("p", "q", "r");
             *      if (IsWeZnq)
             *      {
             *          RewardRate += decimal.Parse(setInfo1.Param3Value);
             *          rewardInterest_1 = GetInterest(model.AmountInvestment, model.Deadline, decimal.Parse(setInfo1.Param3Value));
             *      }
             *  }
             * }
             * //查询7.8号后加息
             * if (setInfo2 != null)
             * {
             *  if (weproduct.StartDate.Value >= DateTime.Parse(setInfo2.Param1Value) && weproduct.StartDate.Value < DateTime.Parse(setInfo2.Param2Value))
             *  {
             *      IsWeZnq = true;
             *      RewardRate += decimal.Parse(setInfo2.Param3Value);
             *      rewardInterest_2 = GetInterest(model.AmountInvestment, model.Deadline, decimal.Parse(setInfo2.Param3Value));
             *  }
             * }
             * //查询定向加息
             * string strSQL = "SELECT TOP 1 RedRate FROM dbo.UserAddInterest with(nolock) WHERE UserId=@UserId AND @OrderDate>=StartDate AND @OrderDate<EndDate AND @Deadline>=StartDeadline AND @Deadline<=EndDeadline order by RedRate desc";
             * Dapper.DynamicParameters dyParams = new Dapper.DynamicParameters();
             * dyParams.Add("@UserId", userId);
             * dyParams.Add("@Deadline", model.Deadline);
             * dyParams.Add("@OrderDate", weproduct.StartDate.Value);
             * decimal? specialRate = TuanDai.DB.TuanDaiDB.QueryFirstOrDefault<decimal?>(TdConfig.DBRead, strSQL, ref dyParams);
             * if (specialRate.HasValue && specialRate.Value > 0)
             * {
             *  IsWeZnq = true;
             *  RewardRate += specialRate.Value;
             *  rewardInterest_3 = GetInterest(model.AmountInvestment, model.Deadline, specialRate.Value);
             * }
             * RewardInterest = rewardInterest_1 + rewardInterest_2 + rewardInterest_3;
             * DueInterestAmount = model.DueInterestAmount + RewardInterest;
             */
        }