public RechargeViewMolde()
     : base("资金管理")
 {
     this.RechargeCommand = new UniversalCommand(Recharge);
 }
 /// <summary>
 /// 实例化一个新的玩法标签的封装
 /// </summary>
 /// <param name="name">名称</param>
 /// <param name="selectTagCommand">选中玩法标签的命令</param>
 public TagOfBet(string name, UniversalCommand selectTagCommand)
 {
     this.Name = name;
     this.SelectTagCommand = selectTagCommand;
 }
 public EditSelfBankInfoViewModel()
     : base("个人中心")
 {
     this.EdirCommand = new UniversalCommand(Edit);
 }
        /// <summary>
        /// 实例化一个新的操作视图的基类
        /// </summary>
        /// <param name="selectedButtonName">高亮按键的名称</param>
        public ManagerViewModelBase(string selectedButtonName)
        {
            //初始化参数
            this.PageName = selectedButtonName;

            //初始化命令
            this.JumpCommand = new UniversalCommand(new Action<object>(Jump));
            this.LogoutCommand = new UniversalCommand(new Action<object>(Logout));
            this.CloseNoticeWindowCommand = new UniversalCommand(new Action<object>(CloseNoticeWindow));

            //加载公告列表
            ShowBulletins(2);
            DispatcherTimer timer = new DispatcherTimer();
            timer.Interval = new TimeSpan(0, 0, 5);
            timer.Tick += (sender, e) => { ShowBulletins(2); };
            timer.Start();

            DispatcherTimer timer2 = new DispatcherTimer();
            timer2.Interval = new TimeSpan(0, 0, 1);
            timer2.Tick += (sender, e) => { ShowUnreadNotices(); };
            timer2.Start();

            #region 加载中奖排行

            Dictionary<string, List<TopBonus>> tD = DataManager.GetValue<Dictionary<string, List<TopBonus>>>(DataKey.IWorld_Client_TopBouns);
            if (ContrastManager.Contrasts.Any(c => c.ButtonNames.Any(bName => bName == selectedButtonName)))
            {
                if (!tD.Keys.Any(key => key == selectedButtonName))
                {
                    GetTopBonusImport import = new GetTopBonusImport
                    {
                        Notes = 7,
                        TicketId = DataManager.GetValue<List<LotteryService.LotteryTicketExport>>(DataKey.IWorld_Client_Tickets)
                            .First(x => x.Name == selectedButtonName).Id,
                        Token = DataManager.GetValue<string>(DataKey.IWorld_Client_Token)
                    };
                    LotteryServiceClient client = new LotteryServiceClient();
                    client.GetTopBonusCompleted += (sender, e) =>
                    {
                        if (e.Result.Success) { return; }
                        tD.Add(selectedButtonName, e.Result.Info);
                        DataManager.SetValue(DataKey.IWorld_Client_TopBouns, tD);
                        e.Result.Info.OrderByDescending(x => x.Sum).ToList();
                    };
                }
                else
                {
                    tD[selectedButtonName].OrderByDescending(x => x.Sum).ToList().ForEach(x => this.TopBonus.Add(x));
                }
            }
            else
            {
                tD["_all"].OrderByDescending(x => x.Sum).ToList().ForEach(x => this.TopBonus.Add(x));
            }

            #endregion
        }
 public WithdrawalViewModel()
     : base("资金管理")
 {
     this.WithdrawalCommand = new UniversalCommand(Withdrawal);
 }
        public MainViewModel(string ticketName)
            : base(ticketName)
        {
            this.ReadyBetCommand = new UniversalCommand(ReadyBet);
            this.ClearBetCommand = new UniversalCommand(ClearBet);
            this.OpenChasingWindowCommand = new UniversalCommand(OpenChasingWindow);
            this.DoBetWindowCommand = new UniversalCommand(DoBetWindow);
            this.DoBetWindowCommand.SetCanExecute(false);

            this.Tags = new ObservableCollection<TagOfBet>();
            this.HowToPlays = new ObservableCollection<HowToPlayOfBet>();
            this.Seats = new ObservableCollection<SeatOfBet>();
            this.Lotteries = new ObservableCollection<LotteryExport>();
            this.Bettings = new ObservableCollection<BettingExport>();

            lotteryClient.GetLotteriesCompleted += ShowGetLotteriesResult;
            lotteryClient.GetBettingsCompleted += ShowGetBettingsResult;
            lotteryClient.BetCompleted += ShowBetResult;

            List<LotteryTicketExport> tickets = DataManager.GetValue<List<LotteryTicketExport>>(DataKey.IWorld_Client_Tickets);
            this.Ticket = tickets.First(x => x.Name == ticketName);
            this.Ticket.Tags.ForEach(x =>
                {
                    TagOfBet tag = new TagOfBet(x.Name, new UniversalCommand(SelectTag));
                    this.Tags.Add(tag);
                });
            this.Tags.First().Selected = true;
            AuthorExport userInfo = DataManager.GetValue<AuthorExport>(DataKey.IWorld_Client_UserInfo);
            this.maxPoinN = userInfo.PlayInfo.Rebate_Normal;
            this.maxPoinUn = userInfo.PlayInfo.Rebate_IndefinitePosition;
            RefreshLotteryInfo();
            RefreshBettings();

            Storyboard s = new Storyboard();
            s.Duration = new System.Windows.Duration(new TimeSpan(0, 0, 1));
            s.Completed += (sender, e) =>
                {
                    List<LotteryTicketExport> _tickets = DataManager.GetValue<List<LotteryTicketExport>>(DataKey.IWorld_Client_Tickets);
                    LotteryTicketExport _ticket = tickets.First(x => x.Name == ticketName);
                    if (this.Ticket.Issue != _ticket.Issue)
                    {
                        this.Ticket.Issue = _ticket.Issue;
                        this.Ticket.NextIssue = _ticket.NextIssue;
                        this.Ticket.NextLotteryTime = _ticket.NextLotteryTime;
                        this.Ticket.LotteryValues = _ticket.LotteryValues;
                        RefreshLotteryInfo();
                        RefreshLotteries();
                    }

                    Storyboard storyboard = (Storyboard)sender;
                    storyboard.Begin();
                };
            s.Begin();
        }
 /// <summary>
 /// 实例化一个新的玩法的封装
 /// </summary>
 /// <param name="name">名称</param>
 /// <param name="selectHowToPlayCommand">选中玩法的命令</param>
 public HowToPlayOfBet(string name, UniversalCommand selectHowToPlayCommand)
 {
     this.Name = name;
     this.SelectHowToPlayCommand = selectHowToPlayCommand;
 }
 /// <summary>
 /// 实例化一个新的登陆页的视图模型
 /// </summary>
 public LoginViewModel()
 {
     this.LoginCommand = new UniversalCommand(Login);
 }
 /// <summary>
 /// 实例化一个新的用于投注的号码的封装
 /// </summary>
 /// <param name="num">号码</param>
 /// <param name="clearBetCommand">清理已选投注的命令</param>
 public NumOfBet(int num, UniversalCommand clearBetCommand)
 {
     this.Num = num;
     this.ClearBetCommand = clearBetCommand;
 }