Exemplo n.º 1
0
        public static void Menu()
        {
            var console = new ProcessingConsole();

            while (true)
            {
                InputMenu();
                var choose = Convert.ToInt32(Console.ReadLine());
                switch (choose)
                {
                default: throw new Exception("This number not exist in this menu");

                case 0:
                {
                    Environment.Exit(0);
                    break;
                }

                case 1:
                {
                    console.Show();
                    break;
                }

                case 2:
                {
                    console.Sort();
                    break;
                }

                case 3:
                {
                    console.Find(Convert.ToInt32(IocStatic.OutputMessage("Length:")));
                    break;
                }

                case 4:
                {
                    console.Delete(Convert.ToInt32(IocStatic.OutputMessage("Length")));
                    break;
                }

                case 5:
                {
                    console.Replace(Convert.ToInt32(IocStatic.OutputMessage("Index:")), Convert.ToInt32(IocStatic.OutputMessage("Length")),
                                    IocStatic.OutputMessage("new string:"));
                    break;
                }

                case 6:
                {
                    break;
                }
                }
            }
        }
Exemplo n.º 2
0
        public static void Menu()
        {
            var taxiConsole = new TaxiCompanyConsole();

            while (true)
            {
                InputMenu();
                var choose = Convert.ToInt32(IocStatic.OutputMessage(">>"));
                switch (choose)
                {
                default: throw new Exception("This number not exist in this menu");

                case 1:
                {
                    taxiConsole.ShowList();
                    break;
                }

                case 2:
                {
                    taxiConsole.Create();
                    break;
                }

                case 3:
                {
                    taxiConsole.CompanyCost();
                    break;
                }

                case 4:
                {
                    taxiConsole.Sort();
                    break;
                }

                case 5:
                {
                    taxiConsole.SpeedSelection(Convert.ToDouble(IocStatic.OutputMessage("Min: ")), Convert.ToDouble(IocStatic.OutputMessage("Max: ")));
                    break;
                }

                case 0:
                {
                    Environment.Exit(0);
                    break;
                }
                }
            }
        }
Exemplo n.º 3
0
        public void Create()
        {
            var car = new Car {
                Name        = IocStatic.OutputMessage("Name"),
                Consumption = Convert.ToDouble(IocStatic.OutputMessage("Consumption")),
                Cost        = Convert.ToDouble(IocStatic.OutputMessage("Cost")),
                Year        = Convert.ToInt32(IocStatic.OutputMessage("Year")),
                StateNumber = IocStatic.OutputMessage("State number"),
                Vin         = IocStatic.OutputMessage("Vin number"),
                MaxSpeed    = Convert.ToDouble(IocStatic.OutputMessage("Max Speed"))
            };

            _taxiCarCompany.Add(car);
            _taxiCarCompany.Save();
            Console.Clear();
        }