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; } }
public void DeleteBet(WcfBet bet) { Database.DeleteBet(Database.GetBetById(bet.Id)); }
public void EditBet(WcfBet bet) { Database.EditBet(Database.GetBetById(bet.Id), bet.HomeTeamScore, bet.AwayTeamScore); }
public void AddBet(WcfBet bet) { Database.AddBet(Database.GetBettorById(bet.BettorId), Database.GetMatchById(bet.MatchId), bet.HomeTeamScore, bet.AwayTeamScore, bet.Date); }