Пример #1
0
        protected bool isNeedViewGift = false;//是否未看过实物奖品

        protected void Page_Load(object sender, EventArgs e)
        {
            string err = "";

            UserId = WebUserAuth.UserId.Value;
            var prizeClient = new TuanDai.UserPrizeNew.Client.UserPrizeQueryClient(TdConfig.ApplicationName);
            var list        = prizeClient.GetUserPrizeUnusedCountByType(UserId, out err);

            if (list != null && list.Count > 0)
            {
                Prize1 =
                    list.Where(o => o.typeId == 4 || o.typeId == 11 || o.typeId == 13 || o.typeId == 14)
                    .Sum(o => o.prizeValue);
                Prize2 = list.Where(o => o.typeId == 3).Sum(o => o.prizeValue);
                Prize8 = list.Where(o => o.typeId == 16).Sum(o => o.prizeValue);
                Prize3 = list.Where(o => o.typeId == 2).Count() > 0
                    ? list.Where(o => o.typeId == 2).FirstOrDefault().prizeCount
                    : 0;
                Prize7 = list.Where(o => o.typeId == 18).Count() > 0
                    ? list.Where(o => o.typeId == 18).FirstOrDefault().prizeCount
                    : 0;
                Prize9   = list.Exists(o => o.typeId == 20) ? list.First(o => o.typeId == 20).prizeCount : -1;
                Prize10  = list.Exists(o => o.typeId == 21) ? list.First(o => o.typeId == 21).prizeCount: 0;
                Prize10 += list.Exists(o => o.typeId == 23) ? list.First(o => o.typeId == 23).prizeCount : 0;

                if (Prize9 == -1)
                {
                    var used = prizeClient.GetUserPrizeHistoryByUser(new GetUserPrizeHistoryByUserRequest {
                        userId = UserId, pageIndex = 1, pageSize = 1, typeId = new List <int> {
                            20
                        }
                    }, out err);
                    if (string.IsNullOrEmpty(err) && used != null)
                    {
                        Prize9 = used.totalCount > 0 ? 0 : -1;//如果有已过期或已使用的 prize9为0,为-1时不显示tab
                    }
                }
            }
            Prize6 = GetPrize6();
        }
Пример #2
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"));
        }