/// <summary> /// Add a player Menu /// </summary> public void AddPlayerMenu() { bool isGood = false; while (!isGood) { Console.Clear(); PrintHeader("Database Editor - Add Player"); Console.WriteLine(); string userName = CLIHelper.GetString("ENTER A NAME:"); bool noExceptions = true; try { _playerDAL.AddPlayer(userName); } catch (Exception e) { Console.WriteLine("ERROR:" + e.Message); noExceptions = false; string exInput = CLIHelper.GetXorY("Sorry something's gone wrong, press Q to quit or R to retry", "q", "r"); if (exInput.ToLower() == "q") { isGood = true; } } if (noExceptions) { Console.WriteLine("Success! Press any key to return to the DataBase Editor Main Menu"); Console.ReadKey(); isGood = true; } } }
public int Create(TblPlayer player) { return(objplayer.AddPlayer(player)); }