public void AddNewBoardGame(IAddNewBoardGameView inForm, IBoardGameRepository boardGameRepository) { if (inForm.ShowViewModal()) { try { string name = inForm.BoardGameName; int minPlayers = inForm.MinPlayers; int maxPlayers = inForm.MaxPlayers; int playingTimeInMinutes = inForm.PlayingTimeInMinutes; decimal rating = inForm.Rating; decimal complexity = inForm.Complexity; int availableCopies = inForm.AvailableCopies; int releaseYear = inForm.ReleaseYear; GameType gameType = boardGameRepository.GetGameTypeByName(inForm.GameType); BoardGame newBoardGame = BoardGameFactory .CreateBoardGame(name, minPlayers, maxPlayers, playingTimeInMinutes, rating, complexity, availableCopies, releaseYear, gameType); boardGameRepository.AddBoardGame(newBoardGame); } catch (Exception ex) { MessageBox.Show("EXCEPTION: " + ex.Message); throw; } } }