Beispiel #1
0
        public void NewCatalogAction()
        {
            _view.Show("Set name for catalog:");
            string catalogName = Console.ReadLine();

            if (catalogName == "")
            {
                Console.WriteLine("Name cannot be empty!");
                Route nextController = _routes.FirstOrDefault(b => b.Id == "1");
                redirect(nextController.Action, nextController.Controller, null);
            }
            else
            {
                ModelStorage.AddBookStorage(new Catalog(catalogName));
                _view.Show($"Catalog with name {catalogName} has been create");
                Route nextController = _routes.FirstOrDefault(b => b.Id == "back");
                redirect(nextController.Action, nextController.Controller, null);
            }
        }