protected async Task HandleValidSubmit() { if (Game.Id == Guid.Empty) //new { if (await GameDataService.AddGame(Game)) { StatusClass = "alert-success"; Message = "New game added successfully."; Saved = true; } else { StatusClass = "alert-danger"; Message = "Something went wrong adding the new game. Please try again."; Saved = false; } } else { await GameDataService.UpdateGame(Game); StatusClass = "alert-success"; Message = "Game updated successfully."; Saved = true; } }
private void Enter_Click(object sender, RoutedEventArgs e) { if (IsValid()) { GameDataService.AddGame(CreateGame()); this.Close(); } else { MessageBox.Show("Please write all fields ..."); } }