Example #1
0
        protected void LoadData()
        {
            Guid userId = WebUserAuth.UserId.Value;

            TuanDai.PortalSystem.BLL.UserBLL bll = new TuanDai.PortalSystem.BLL.UserBLL();
            userModel = bll.GetUserBasicInfoModelById(userId);
            if (userModel == null)
            {
                Response.Redirect("/Member/my_account.aspx");
                return;
            }

            GetProfitStatistics(userId);
            GetAccountInfo(userId);
            GetPayStatistics(userId);

            JoinTDDay = Tool.DateHelper.GetDateDiffDay(DateTime.Parse(userModel.AddDate.Value.ToString("yyyy-MM-dd")), DateTime.Today.AddDays(1));
            if (JoinTDDay <= 0)
            {
                JoinTDDay = 1;
            }

            totalPayAmount = paymodel.RepayedInterest + (fundAccountInfo.TotalPayOutMember ?? 0) + (fundAccountInfo.TotalWithdrawDepositHandRecharge ?? 0)
                             + (fundAccountInfo.TotalPayOutAvalidate ?? 0) + (fundAccountInfo.TotalInvestCommission ?? 0) + (fundAccountInfo.BorrowCommission ?? 0);
            //计算累计收入 待收不算累计  =逾期收益+已收利息+活动奖励+红包收益
            if (profitmodel != null)
            {
                totalInAmount = profitmodel.overDueAmount + profitmodel.recAmount + (fundAccountInfo.RewardMoney ?? 0) + profitmodel.prizeAmount + profitmodel.extenderMoney;
            }

            GetTotalWithDrawal();
        }
Example #2
0
        protected void InitData()
        {
            ActivityBLL activitybll = new ActivityBLL();

            if (WebUserAuth.IsAuthenticated)
            {
                this.UserId = WebUserAuth.UserId.Value;

                TuanDai.PortalSystem.BLL.UserBLL userbll = new TuanDai.PortalSystem.BLL.UserBLL();
                userModel = userbll.GetUserBasicInfoModelById(UserId);


                UserGrowthBLL userGrowthbll = new UserGrowthBLL();
                TuanDai.VipSystem.BLL.UserBLL vipuserbll = new TuanDai.VipSystem.BLL.UserBLL();
                //List<int> typeList = userGrowthbll.GetUserRecord(UserId);
                //UserValidInfo Validmodel = vipuserbll.GetUserValidInfo(UserId);

                this.model = vipuserbll.GetUserInfo(this.UserId);

                this.GetUserPrivileges(this.model.Level);

                this.list       = new UserPrivilegeBLL().GetUserPrivilegeInfo(this.UserId);
                this.recordList = activitybll.QueryActivityReceiveRecord(this.UserId);
                this.strAction  = this.GetAction();
                if (this.model != null)
                {
                    this.percent = this.model.Growth == 0 || this.model.CurLevelMaxGrowth == 0 ? "0" : (Convert.ToDecimal(this.model.Growth) / this.model.CurLevelMaxGrowth * 100).ToString("0.00");
                }
                if (list != null)
                {
                    this.count = list.Select(p => p.TypeId).Distinct().Count();
                }
                else
                {
                    this.count = 0;
                }
            }
            this.activityList = activitybll.GetActivityList();
            this.GetActivityInfo();
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid?userId = WebUserAuth.UserId;

            if (userId != Guid.Empty && userId != null)
            {
                TuanDai.PortalSystem.BLL.UserBLL bll = new TuanDai.PortalSystem.BLL.UserBLL();
                var userInfo = bll.GetUserBasicInfoModelById(userId.Value);
                if (userInfo.IsValidateMobile)
                {
                    TelNo = userInfo.TelNo;
                }
                else
                {
                    Response.Redirect("/Member/my_account.aspx");
                }
            }
            else
            {
                Response.Redirect("/user/Login.aspx");
            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TuanDai.Payment.Log.Info(this.GetType().ToString(), "开始易宝回调");
            string callback_result = "";

            try
            {
                if (Request["data"] == null || Request["encryptkey"] == null)
                {
                    TuanDai.Payment.Log.Info(this.GetType().ToString(), "参数不正确");
                    Response.Write("参数不正确!");
                    Response.End();
                }

                TuanDai.Payment.Log.Info(this.GetType().ToString(), "易宝回调加密参数:" + Request["data"] + ",密钥:" + Request["encryptkey"]);
                //商户注意:接收到易宝的回调信息后一定要回写success用以保证握手成功!

                string data       = Request["data"];       //回调中的参数data
                string encryptkey = Request["encryptkey"]; //回调中的参数encryptkey
                callback_result = YJPayUtil.checkYbCallbackResult(data, encryptkey);
                var resultData = JsonConvert.DeserializeObject <SortedDictionary <string, string> >(callback_result);
                TuanDai.Payment.Log.Info(this.GetType().ToString(), "The Pay result is Values  : " + callback_result);

                if (resultData == null || resultData.ContainsKey("error_msg"))
                {
                    Response.Write("参数不正确!");
                    Response.End();
                }

                var status         = resultData["status"].ToString();
                var rechargeMoney  = resultData["amount"].ToString();
                var out_trade_no   = resultData["orderid"].ToString();
                var transaction_id = resultData["yborderid"].ToString();

                string            strSQL   = "p_OnLineRechargeHandler";
                DynamicParameters dyParams = new DynamicParameters();
                dyParams.Add("@orderno", out_trade_no);
                dyParams.Add("@MediumMoney", decimal.Parse(rechargeMoney) / 100);
                dyParams.Add("@MediumOrderNo", transaction_id);
                dyParams.Add("@outStatus", 0, DbType.Int32, ParameterDirection.Output, 20);
                if (status == "1")
                {
                    dyParams.Add("@handlerStatus", 2);
                }
                else
                {
                    dyParams.Add("@handlerStatus", 1);
                }
                PublicConn.ExecuteTD(PublicConn.DBWriteType.FundWrite, strSQL, ref dyParams, CommandType.StoredProcedure);

                int result = dyParams.Get <int>("@outStatus");
                if (result == 1)
                {
                    AccountRechareInfo accountRechare = getAccountRechare(out_trade_no);
                    if (accountRechare != null)
                    {
                        //List<int> typeList = new List<int>() { 2, 3, 4, 6, 8,9,11, 12 };
                        //if (db.AccountRechare.Count(p => p.UserId == accountRechare.UserId && p.Status == 2 && typeList.Contains(p.type)) == 1)
                        //{
                        //    TuanDai.PortalSystem.BLL.VipGetWorthBLL.AddGetWorth(accountRechare.UserId, (int)ConstString.UserGrowthType.FirstReCharge, null, 0);
                        //}

                        TuanDai.PortalSystem.BLL.UserBLL bll = new TuanDai.PortalSystem.BLL.UserBLL();
                        UserBasicInfoInfo userBasicInfo      = bll.GetUserBasicInfoModelById(accountRechare.UserId);
                        if (userBasicInfo != null)
                        {
                            var isNewSmsRequest = ConfigHelper.getConfigString("IsNewSmsRequest", "0");
                            if (isNewSmsRequest == "0")
                            {
                                var parameters = new Dictionary <string, object>();
                                parameters.Add("User", userBasicInfo);
                                parameters.Add("CurrentDate", DateTime.Now);
                                parameters.Add("RechargeMoney", rechargeMoney);
                                parameters.Add("Host", GlobalUtils.WebURL);

                                var messageSender = new BusinessDll.MessageSend();
                                messageSender.SendMessage2(eventCode: MessageTemplates.RechargeSuccess, parameters: parameters,
                                                           mobile: userBasicInfo.TelNo, email: userBasicInfo.Email, userId: userBasicInfo.Id);
                            }
                            else
                            {
                                SmsRequest rechargeSuccessSmsRequest = new SmsRequest();
                                rechargeSuccessSmsRequest.EventCode      = MsgTemplatesType.RechargeSuccess;
                                rechargeSuccessSmsRequest.PlatformSource = PlatformSource.Pc;
                                rechargeSuccessSmsRequest.UserId         = userBasicInfo.Id;
                                rechargeSuccessSmsRequest.EmailAddress   = userBasicInfo.Email;
                                rechargeSuccessSmsRequest.Mobile         = userBasicInfo.TelNo;
                                rechargeSuccessSmsRequest.Parameters     = new Dictionary <string, object>();
                                rechargeSuccessSmsRequest.Parameters.Add("RechargeMoney", rechargeMoney);

                                string errorMessage = string.Empty;
                                SmsClient.SendMessage(rechargeSuccessSmsRequest, ref errorMessage);
                            }
                        }
                    }
                }

                //NetLog.WriteBatchwithdrawHandler("交易成功", string.Concat("签名:", sPara["sign"].ToString(), "签名方式:", sPara["sign_type"].ToString(), "我方处理状态:", result.ToString().Trim(), "连连处理状态:", sPara["result_pay"].ToString()));
                Response.Write(@"SUCCESS");
                Response.End();

                //SoftLog.LogStr("支付成功回调信息:" + callback_result, "yeepay/CallbackLog");
            }
            catch (Exception err)
            {
                TuanDai.Payment.Log.Info(this.GetType().ToString(), "支付失败:" + err.ToString() + "," + Request["data"] + Environment.NewLine + Request["encryptkey"] + "处理结果:" + callback_result);
                //SoftLog.LogStr("支付失败:" + err.ToString() + "," + Request["data"] + Environment.NewLine + Request["encryptkey"] + "处理结果:" + callback_result, "yeepay/CallbackLog");
                Response.Write("支付失败!");
                Response.End();
            }
            finally
            {
                //SoftLog.LogStr("支付回调信息" + Request["data"] + Environment.NewLine + Request["encryptkey"] + "处理结果:" + callback_result, "yeepay/CallbackLog");
            }
        }
Example #5
0
        protected void GetFinanceDraw()
        {
            Response.ContentType = "application/json";
            try
            {
                DrawResult model  = new DrawResult();
                Guid?      userId = WebUserAuth.UserId;
                if (userId == Guid.Empty)
                {
                    model.Status = -99;
                }
                else
                {
                    TuanDai.PortalSystem.BLL.UserBLL userbll = new TuanDai.PortalSystem.BLL.UserBLL();

                    TuanDai.PortalSystem.Model.UserBasicInfoInfo userInfo = userbll.GetUserBasicInfoModelById(userId.Value);
                    if (userInfo == null)
                    {
                        model.Status = -99;
                        PrintJson(model);
                    }
                    var param = new DynamicParameters();
                    param.Add("@userId", userId);
                    param.Add("@NickName", userInfo.NickName);
                    param.Add("@outStatus", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output);
                    param.Add("@PrizeName", "", System.Data.DbType.String, System.Data.ParameterDirection.Output);
                    param.Add("@PrizeType", -1, System.Data.DbType.Int32, System.Data.ParameterDirection.Output);
                    param.Add("@PrizeAmount", 0, System.Data.DbType.Decimal, System.Data.ParameterDirection.Output);
                    param.Add("@PrizeId", Guid.Empty, System.Data.DbType.Guid, System.Data.ParameterDirection.Output);
                    param.Add("@PrizeRecordId", Guid.Empty, System.Data.DbType.Guid, System.Data.ParameterDirection.Output);

                    //using (SqlConnection connection = CreateReadConnection())
                    //{
                    //    connection.Execute("p_activity_GetPrize_XinXingFansMeet", param, null, null,
                    //        CommandType.StoredProcedure);
                    //    model.Status = param.Get<int>("@outStatus");
                    //    model.PrizeName = param.Get<string>("@PrizeName");
                    //    model.PrizeType = param.Get<int>("@PrizeType");
                    //    model.PrizeAmount = param.Get<decimal>("PrizeAmount");
                    //    model.PrizeId = param.Get<Guid?>("@PrizeId");
                    //    model.PrizeRecordId = param.Get<Guid?>("@PrizeRecordId");
                    //    connection.Close();
                    //    connection.Dispose();
                    //}

                    if (model.Status == 1)
                    {
                        model.NickName = userInfo.NickName;
                        int    subTypeId   = 1;
                        string description = string.Empty;
                        if (model.PrizeType == 3)
                        {
                            subTypeId   = 20;
                            description = string.Format("单笔投资满{0}元即可使用{1}元", model.PrizeAmount * 10, model.PrizeAmount);
                        }
                        else if (model.PrizeType == 10)
                        {
                            description = model.PrizeName;
                        }
                        else
                        {
                            description = "谢谢参与";
                        }
                        #region  写入团宝箱
                        if (model.PrizeType == 3 || model.PrizeType == 10)
                        {
                            TuanDai.PortalSystem.Model.SendUserPrizeInfo prizeInfo = new TuanDai.PortalSystem.Model.SendUserPrizeInfo();
                            prizeInfo.UserId = userId.Value;
                            string strRuleId = "";
                            if (model.PrizeType == 3)
                            {
                                if (model.PrizeAmount == 100)
                                {
                                    strRuleId = "4a00620e-934c-407b-8d94-28b0ec8a785f";
                                }
                                else if (model.PrizeAmount == 50)
                                {
                                    strRuleId = "5e12a736-bc66-4bd5-8f1a-e99ac134a77b";
                                }
                                else if (model.PrizeAmount == 10)
                                {
                                    strRuleId = "ddaddc5b-bb05-45bc-8242-8fb313373acf";
                                }
                                else if (model.PrizeAmount == 5)
                                {
                                    strRuleId = "b3b24200-e9df-4241-b94b-290be8185215";
                                }
                            }
                            else if (model.PrizeType == 10)
                            {
                                strRuleId = "05453294-23f7-4c19-bfe8-6f98e3c0d138";
                            }
                            if (strRuleId.IsNotEmpty())
                            {
                                prizeInfo.RuleId = Guid.Parse(strRuleId);//规则Id
                            }
                            else
                            {
                                prizeInfo.RuleId = Guid.Empty;
                            }
                            prizeInfo.PrizeName   = model.PrizeName;
                            prizeInfo.PrizeValue  = model.PrizeAmount;
                            prizeInfo.Description = "信者行万里团粉见面会抽奖-" + description;
                            int pStatus = -1;
                            userbll.SendUserPrizeNew(prizeInfo, out pStatus);

                            if (pStatus != 1)
                            {
                                //写入失败时,回滚之前数据
                                model.Status = -5;
                                this.RollBackGamePrizeData(userId.Value, model.PrizeId.Value);
                            }
                        }
                        #endregion
                    }
                }
                model.CurrentDate = DateTime.Now.ToString("yyyy-MM-dd");
                PrintJson(model);
            }
            finally {
                Response.End();
            }
        }