Beispiel #1
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();
         }
     }
 }
Beispiel #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);
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Redirect("//m.tuandai.com/pages/downOpenApp.aspx", true);
            return;

            projectId = WEBRequest.GetGuid("id");
            var type = WEBRequest.GetString("type");

            this.TypeId    = WEBRequest.GetInt("typeId", 0);
            this.IsPreSell = WEBRequest.GetInt("IsPreSell", 0) == 1;

            if (type == "mobileapp")
            {
                IsApp          = true;
                IsShowRightBar = false;
            }
            if (!IsPostBack)
            {
                bll = new WeProductBLL();
                if (this.projectId != null && this.projectId != Guid.Empty)
                {
                    if (!this.GetData())
                    {
                        return;
                    }
                }
                else
                {
                    Response.Redirect(GlobalUtils.MTuanDaiURL + "/pages/invest/WE/WE_list.aspx");
                }
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Redirect("//m.tuandai.com/pages/downOpenApp.aspx", true);
            return;

            projectId = WEBRequest.GetGuid("id");
            var activityUrl = WEBRequest.GetString("Anniversary4");
            var type        = WEBRequest.GetString("type");

            if (type == "mobileapp")
            {
                IsApp          = true;
                IsShowRightBar = false;
            }
            if (!string.IsNullOrEmpty(activityUrl))
            {
                CookieHelper.WriteCookie("Anniversary4", activityUrl);
                //HttpContext.Current.Response.SetCookie(new HttpCookie("Anniversary4",activityUrl));//写入活动传过来的url
            }
            if (!IsPostBack)
            {
                bll = new WeProductBLL();
                if (this.projectId != null && this.projectId != Guid.Empty)
                {
                    if (!this.GetData())
                    {
                        return;
                    }
                }
                else
                {
                    Response.Redirect(GlobalUtils.MTuanDaiURL + "/pages/invest/WE/WE_list.aspx");
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// 绑定we计划相关列表
        /// </summary>
        private List <WeProductDetailInfo> GetInvestListWePlan(out int iRecordCount)
        {
            List <WeProductDetailInfo> returnList;

            if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
            {
                List <string> typeWordArrary = null;
                if (ConfigHelper.getConfigString("IsOpenSyb") == "1")
                {
                    typeWordArrary = new List <string>()
                    {
                        "C", "B", "A", "G", "36", "24", "18", "12", "6", "3", "1", "H"
                    };
                }
                else
                {
                    typeWordArrary = new List <string>()
                    {
                        "C", "B", "A", "G", "36", "24", "18", "12", "6", "H"
                    };
                }
                IList <WeProductDetailInfo> tmpList = new WeProductBLL().GetWePlanListByRedis(typeWordArrary, TdConfig.ApplicationName);
                //returnList = FilterPreSellWe(tmpList).ToList();
                returnList = tmpList.ToList();
                if (returnList != null)
                {
                    returnList = returnList.Where(p => p.IsNewHand == false).ToList();
                }
                iRecordCount = returnList != null ? returnList.Count : 0;
            }
            else
            {
                returnList = WXGetWePlanShowList(15, 1, out iRecordCount);
            }
            if (returnList != null)
            {
                if (ConfigHelper.getConfigString("IsOpenSyb") == "1")
                {
                    returnList = returnList.Where(p => p.IsPreSell == false).OrderBy(p => p.StatusId).ThenBy(p => p.SortOrder).ToList();
                }
                else
                {
                    returnList = returnList.Where(p => p.IsPreSell == false && p.FTBSubType != 3).OrderBy(p => p.StatusId).ThenBy(p => p.SortOrder).ToList();
                }
            }


            return(returnList);
        }
Beispiel #6
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;
        }
Beispiel #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     projectId = Tool.SafeConvert.ToGuid(WEBRequest.GetQueryString("id"));
     if (!IsPostBack)
     {
         bll = new WeProductBLL();
         if (this.projectId != Guid.Empty)
         {
             if (!this.GetData())
             {
                 return;
             }
             //未登陆时,充值处显示登陆按钮
             if (!WebUserAuth.IsAuthenticated)
             {
                 ReChangeStr = "<a href=\"javascript:window.location.href='/user/login.aspx?ReturnUrl='+location.href\" class=\"btn-chargemoney\">登录</a>";
             }
         }
         else
         {
             Response.Redirect(GlobalUtils.WebURL + "/pages/invest/WE/WE_list.aspx");
         }
     }
 }
Beispiel #8
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);
            }
        }
Beispiel #9
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;
             */
        }
Beispiel #10
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);
            }
        }