Example #1
0
        private void OnInitData()
        {
            basicinfo = bll.GetUserBasicInfoModelById(userId);

            //从Java接口获取银行卡信息
            var bankJavaService = new BankFromJavaService();

            if (GlobalUtils.IsBankService)
            {
                WXResponsePublicInfo <WXResponseSelectBankInfoChild> bankInfo = bankJavaService.GetBankInfo(userId, ServiceType.TuoMin);
                if (bankInfo != null && bankInfo.respData != null)
                {
                    bankName = bankInfo.respData.bankName;
                    bankNo   = bankInfo.respData.bankNo;
                }
            }
            if (string.IsNullOrEmpty(bankNo))
            {
                GlobalUtils.GetBankImg(basicinfo.Id, out bankName);
                var bankinfo = GlobalUtils.GetBankInfo(basicinfo.Id);
                if (bankinfo != null)
                {
                    bankNo = bankinfo.BankNo;
                }
            }

            if (basicinfo.sex == 2)
            {
                sexname = "小姐";
            }
            vailStatus  = getVailStatusByUserModel(basicinfo);
            accountInfo = new FundAccountBLL().GetFundAccountInfoById(userId);
            if (GlobalUtils.IsBankService)
            {
                cadAviMoney = bankJavaService.GetAviMoney(userId);
            }
            else
            {
                cadAviMoney = bll.GetDrawAviAmount(userId);
            }

            WebSettingInfo setmodel = new WebSettingBLL().GetWebSettingInfo("1F9F7CF7-267E-4F88-B3A4-F2775401CA0F");

            topwithdrawamount = (basicinfo.Level ?? 1) == (int)ConstString.UserType.VipUser ? decimal.Parse(setmodel.Param5Value) : decimal.Parse(setmodel.Param4Value);

            //UserPrizeBll prizebll = new UserPrizeBll();
            //VoucherInfoList = prizebll.GetWithdrawVoucher(userId);
            string err = "";
            //从接口获取未使用提现券
            List <TuanDai.UserPrizeNew.ServiceClient.Models.UserPrizeInfo> ulist =
                new TuanDai.UserPrizeNew.Client.UserPrizeQueryClient(TdConfig.ApplicationName).GetWithdrawVoucher(userId, out err);

            if (!string.IsNullOrEmpty(err))
            {
                TuanDai.LogSystem.LogClient.LogClients.ErrorLog(TdConfig.ApplicationName, "TuanDai.UserPrizeNew.Client.UserPrizeQueryClient.GetUserPrizeListByUserId", userId.ToString(), err);
            }
            WithdrawVoucherInfo1 wvi = null;

            if (VoucherInfoList == null)
            {
                VoucherInfoList = new List <WithdrawVoucherInfo1>();
            }
            if (ulist != null && ulist.Count > 0)
            {   //循坏写入VoucherInfoList
                foreach (var u in ulist)
                {
                    wvi                = new WithdrawVoucherInfo1();
                    wvi.Amount         = u.PrizeValue;
                    wvi.ExpirationDate = u.ExpirationDate;
                    wvi.Id             = u.Id;
                    wvi.SubTypeId      = u.SubTypeId;
                    if (wvi.ExpirationDate.HasValue)
                    {
                        wvi.DateDeadline = (int)MyDateTime.DateDiff(MyDateTime.DateDiffOption.Day, DateTime.Now,
                                                                    wvi.ExpirationDate.Value);
                    }
                    VoucherInfoList.Add(wvi);
                }
            }
            count = VoucherInfoList.Count;
            //获取默认支付方式
            DefPayType = 2;

            IsNoCanDraw = (DateTime.Now > DateTime.Parse(DateTime.Now.ToString("d") + " 22:59:59") &&
                           DateTime.Now <= DateTime.Parse(DateTime.Now.ToString("d") + " 23:59:59")) || (DateTime.Now >= DateTime.Parse(DateTime.Now.ToString("d") + " 00:00:00") &&
                                                                                                         DateTime.Now < DateTime.Parse(DateTime.Now.ToString("d") + " 00:10:00"));
        }
Example #2
0
        protected void OnInitData()
        {
            UserBankInfo ubi = new UserBankInfo();
            UserBLL      bll = new UserBLL();

            userModel = bll.GetUserBasicInfoModelById(userId);
            var javaBankService = new BankFromJavaService();

            if (!GlobalUtils.IsOpenCGT)
            {
                if (string.IsNullOrEmpty(userModel.BankAccountNo))
                {
                    string sql = @"SELECT BankNo,BankType FROM dbo.UserBankInfo WITH(NOLOCK) WHERE UserId = @UserId ";

                    DynamicParameters para = new DynamicParameters();
                    para.Add("@UserId", userId);
                    ubi = PublicConn.QuerySingle <UserBankInfo>(sql, ref para);

                    if (ubi != null)
                    {
                        userModel.BankAccountNo = ubi.BankNo;
                        userModel.BankType      = ubi.BankType;
                    }
                }
            }
            else
            {
                if (GlobalUtils.IsBankService)
                {
                    bankInfoFromJava = javaBankService.GetBankInfo(userId, ServiceType.TuoMin);
                    if (bankInfoFromJava != null && bankInfoFromJava.respData != null)
                    {
                        bankName = bankInfoFromJava.respData.bankName;
                        bankNo   = bankInfoFromJava.respData.bankNo;
                    }
                }

                if (string.IsNullOrEmpty(bankNo))
                {
                    GlobalUtils.GetBankImg(userModel.Id, out bankName);
                    bankNo = userModel.BankAccountNo;
                }
            }
            vailStatus = getVailStatusByUserModel(userModel);
            this.IsValidateIdentity = userModel.IsValidateIdentity;
            if (GlobalUtils.IsBankService)
            {
                AviMoney = javaBankService.GetAviMoney(userId);
            }
            else
            {
                AviMoney = bll.GetUserAviMoney(userId);
            }


            bank = GetSupportBank();

            if (!GlobalUtils.IsOpenCGT)
            {
                string sType = WEBRequest.GetString("selectType");
                if (sType == "")
                {
                    //获取默认支付方式
                    if (GlobalUtils.IsWeiXinBrowser)
                    {
                        if (userModel.BankAccountNo.ToText().IsEmpty())
                        {
                            DefPayType = 1;
                        }
                        else
                        {
                            DefPayType = 2;
                        }
                    }
                    else
                    {
                        DefPayType = 2;
                    }
                }
                //判断openid为空时,重新授权
                if (GlobalUtils.IsWeiXinBrowser)
                {
                    if (GlobalUtils.OpenId.IsEmpty())
                    {
                        string strOpenId = TuanDai.WXApiWeb.Common.WeiXinApi.GetUserWXOpenId(userModel.Id);
                        if (strOpenId.IsNotEmpty())
                        {
                            GlobalUtils.WriteOpenIdToCookie(strOpenId.ToText());
                        }
                        else
                        {
                            TuanDai.WXApiWeb.Common.WeiXinApi wxApi = new Common.WeiXinApi();
                            wxApi.GetOpenidAndAccessToken(this);
                        }
                    }
                }
            }
            WebSettingInfo rechargeSet = new TuanDai.PortalSystem.DAL.WebSettingDAL().GetWebSettingInfo("9A89CBAE-6550-4EA1-8224-EB645F38F8FA");

            MinRechargeAmount = decimal.Parse(rechargeSet.Param1Value);

            this.CheckUseKuaiJiePay();
        }