Пример #1
0
 private void ExecuteAddBetCommand(Object obj)
 {
     if (mViewModel.SelectedMatch != null)
     {
         WcfBet newBet = new WcfBet();
         newBet.MatchId       = mViewModel.SelectedMatch.Id;
         newBet.BettorId      = mViewModel.Bettor.Id;
         newBet.HomeTeamScore = 0;
         newBet.AwayTeamScore = 0;
         newBet.Date          = DateTime.Now;
         mViewModel.Bets.Add(newBet);
         WcfHelper.client.AddBet(newBet);
         ReloadBets();
         mViewModel.SelectedBet   = newBet;
         mViewModel.ShowBet       = System.Windows.Visibility.Visible;
         mViewModel.ShowNotBet    = System.Windows.Visibility.Hidden;
         mViewModel.BetIsEditable = true;
     }
 }
Пример #2
0
 public void DeleteBet(WcfBet bet)
 {
     Database.DeleteBet(Database.GetBetById(bet.Id));
 }
Пример #3
0
 public void EditBet(WcfBet bet)
 {
     Database.EditBet(Database.GetBetById(bet.Id), bet.HomeTeamScore, bet.AwayTeamScore);
 }
Пример #4
0
 public void AddBet(WcfBet bet)
 {
     Database.AddBet(Database.GetBettorById(bet.BettorId), Database.GetMatchById(bet.MatchId), bet.HomeTeamScore, bet.AwayTeamScore, bet.Date);
 }