private void ListByColor()
        {
            string       consoleVal;
            ColorManager colorManager = MainConsoleManager.GetColorManager().Data;

            ConsoleTexts.WriteConsoleMenuInFrame(Messages.ListHeaderColorSelect, _colorScreen.StrColorList());
            //ConsoleTexts.WriteDataList("COLORS", _colorManager.GetAll());
            consoleVal = ConsoleTexts.ConsoleWriteReadLine(Messages.SelectColorId);
            int colorId = Convert.ToInt32(consoleVal);

            string color             = colorManager.GetById(colorId).Data.Name;
            List <CarDetailDto> cars = _carManager.GetCarDetailsByColorId(colorId).Data;

            ConsoleTexts.WriteDataList(color + Messages.ListHeaderColoredCar, cars);
        }
        public virtual void Menu()
        {
            string consoleVal;

            string[] menuItems = new string[] { "1-Add New Form", "2-Update Form", "3-Delete Form", "4-View Form", "5-RETURN MAIN MENU" };

            ConsoleTexts.WriteConsoleMenuInFrame(_menuTitle, menuItems);

            consoleVal = ConsoleTexts.ConsoleWriteReadLine(Messages.SelectNumberOfMenuItem);
            if (consoleVal == "")
            {
                consoleVal = "0";
            }
            int selected = Convert.ToInt32(consoleVal);

            switch (selected)
            {
            case 1:
                AddForm();
                Menu();
                break;

            case 2:
                UpdateForm();
                Menu();
                break;

            case 3:
                DeleteForm();
                Menu();
                break;

            case 4:
                ListForm();
                Menu();
                break;

            case 5:
                MainConsoleManager.MainMenu();
                break;

            default:
                Console.WriteLine(Messages.WrongChoice);
                Menu();
                break;
            }
        }
        private void ListByBrands()
        {
            string       consoleVal;
            BrandManager brandManager = MainConsoleManager.GetBrandManager().Data;

            ConsoleTexts.WriteConsoleMenuInFrame(Messages.ListHeaderBrandSelect, _brandScreen.StrBrandList());
            consoleVal = ConsoleTexts.ConsoleWriteReadLine(Messages.SelectBrandId);
            int brandId = Convert.ToInt32(consoleVal);

            string brand             = brandManager.GetById(brandId).Data.Name;
            List <CarDetailDto> cars = _carManager.GetCarDetailsByBrandId(brandId).Data;

            ConsoleTexts.WriteDataList(brand + Messages.ListHeaderBrandedCar, cars);

            Console.Write(Messages.MessageForReturnToMenu);
            Console.ReadKey();
        }
 static void Main(string[] args)
 {
     MainConsoleManager.MainMenu();
 }
Exemple #5
0
 static void Main(string[] args)
 {
     //MainConsoleManager mainManager = new MainConsoleManager();
     MainConsoleManager.MainMenu();
 }