Esempio n. 1
0
        private static void SearchSteaks()
        {
            int   steakId = SteakView.SearchSteak();
            Steak mySteak = SteakRepository.ListById(steakId);

            SteakView.DisplaySteak(mySteak);
        }
Esempio n. 2
0
        private static void CreateSteak()
        {
            Steak mySteak = SteakView.GetNewSteakData();

            SteakRepository.Create(mySteak);
            SteakView.DisplaySteak(mySteak);
        }
Esempio n. 3
0
        private static void DisplaySteaks()
        {
            List <Steak> steaks = SteakManager.Data.SteakRepository.ListAll();

            foreach (Steak steak in steaks)
            {
                SteakView.DisplaySteak(steak);
            }
        }
Esempio n. 4
0
        private static void EditSteak()
        {
            int   Id      = SteakView.SearchSteak();
            Steak mySteak = SteakRepository.ListById(Id);

            mySteak = SteakView.EditSteakInfo(mySteak);
            SteakRepository.Edit(mySteak.Id, mySteak);
            SteakView.DisplaySteak(mySteak);
        }
Esempio n. 5
0
        // 1. Search for the steak you want to remove. Use SteakView.GetSteakId() to get the id of the steak to remove?
        // 2. Get that steak using SteakRepository.ListById(Id);
        // 3. SteakView.ConfirmRemoveSteak(steak);
        // 4. SteakRepository.Delete(Id);
        private static void RemoveSteak()
        {
            var   searchedId = SteakView.SearchSteak();
            Steak mySteak    = SteakRepository.ListById(searchedId);

            SteakView.ConfirmRemoveSteak(mySteak);
            SteakRepository.Delete(searchedId);


            //var id = SteakRepository.ListById(searchedId);

            /**if (SteakView.ConfirmRemoveSteak(mySteak) == true)
             * {
             *  SteakManager.Data.SteakRepository.Delete();
             *
             * }*/

            Console.WriteLine("Updated Steak List:");
            DisplaySteaks();
        }