Example #1
0
        private void UpdateMode(Model.BoatCatalog boatCatalog)
        {
            if (Cin.boolResponseOfQuestion(View.ConsoleIn.FAQProceedUnlock, "yY"))
            {
                while (true)
                {
                    try
                    {
                        Cout.Print(View.ConsoleIn.FAQBoatWhichtoEdit);
                        int clientsChoice = -1 + Cin.readKeyToInt();

                        boat = boatCatalog.Read(clientsChoice);

                        if (Cin.boolResponseOfQuestion(string.Format(View.ConsoleIn.FAQPreviousValue, boat.Type), "yY"))
                        {
                            Cout.Print(View.ConsoleIn.FAQBoatType);
                            boat.Type = (Model.Boat.TypeBoat)Cin.readKeyToInt();
                        }

                        if (Cin.boolResponseOfQuestion(string.Format(View.ConsoleIn.FAQPreviousValue, boat.Length), "yY"))
                        {
                            boat.Length = int.Parse(Cin.ResponseToAskedQustion(View.ConsoleIn.FAQBoatLength));
                        }

                    }
                    catch (Exception e)
                    {
                        new View.Error(e);
                        Cin.boolResponseOfQuestion(View.ConsoleIn.FAQContinueWithY, "yY");
                        break;
                    }
                    break;
                }
            }
        }
Example #2
0
        private void DeleteMode(Model.BoatCatalog boatCatalog)
        {
            if (Cin.boolResponseOfQuestion(View.ConsoleIn.FAQProceedUnlock, "yY"))
            {
                while (true)
                {
                    try
                    {
                        Cout.Print(View.ConsoleIn.FAQBoatWhichtoDelete);
                        int clientsChoice = -1 + Cin.readKeyToInt();

                        boat = boatCatalog.Read(clientsChoice);

                        boatCatalog.delete(boat);

                    }
                    catch (Exception e)
                    {
                        new View.Error(e);
                        Cin.boolResponseOfQuestion(View.ConsoleIn.FAQContinueWithY, "yY");
                        break;
                    }
                    break;
                }
            }
        }