コード例 #1
0
ファイル: Program.cs プロジェクト: MechanoRealist/Portfolio
        public static void Main()
        {
            MenuLeft = new MenuBox {
                LeftBoundary = 0, RightBoundary = HalfWindowWidth - 1, TopBoundary = 0, BottomBoundary = TwoThirdsWindowHieght - 1
            };                                                                                                                                             // defining the coordinates of the 3 windows
            MenuRight = new MenuBox {
                LeftBoundary = HalfWindowWidth + 1, RightBoundary = Console.WindowWidth, TopBoundary = 0, BottomBoundary = TwoThirdsWindowHieght - 1
            };
            MenuBottom = new MenuBox {
                LeftBoundary = 0, RightBoundary = Console.WindowWidth, TopBoundary = TwoThirdsWindowHieght + 2, BottomBoundary = Console.WindowHeight - 1
            };
            Program.MenuRight.Clear();          // fill the box with 'space' (emptying the field)
            Program.MenuLeft.Clear();
            Customers     = Customer.GetList(); // getting lists from DB
            Cars          = Car.GetList();
            CarServicings = CarServicing.GetList();

            DrawFrame();
            int menuChoice = ConsoleHelper.Menu(false, 3, MenuBottom.TopBoundary + 2, MenuBottom.LeftBoundary + 10, "Edit/Read Cars", "Edit/Read Customers", "Edit/Read Servicings"); // options for MAIN menu

            switch (menuChoice)
            {
            case 0:
                Car.Menu();
                break;

            case 1:
                Customer.Menu();
                break;

            case 2:
                CarServicing.Menu();
                break;
            }

            Console.WriteLine("U made it to the end somehow");
            Console.ReadLine();
        }