void ActionAddAward() { ConsoleKey Key; Award NewAward = new Award(); string Answer; do { Answer = TextAddAward(); try { NewAward = Award.Parse(BLL.GetAllAwards(), Answer); PrintAwardData(NewAward); BLL.AddAward(NewAward); Console.WriteLine("Succsessfully added"); } catch (ArgumentException e) { Console.WriteLine(e.Message); } finally { Console.WriteLine("Try again? (Press <<Y>>)"); Key = Console.ReadKey().Key; } } while (Key != ConsoleKey.Escape); }
public void CreateNewAward() { Console.WriteLine("Please insert title for create new award"); string title = Console.ReadLine(); //validation title and bla-bla-bla if it's okay: _awardLogic.AddAward(title); }
public IHttpActionResult AddAward([FromBody] AwardDTO award) { if (_bll.AddAward(award)) { return(Ok()); } return(InternalServerError()); }