Ejemplo n.º 1
0
        static int id_input()
        {
            int res;

            console_color_1();
            Console.WriteLine("Enter id of order:");
            string input = Console.ReadLine();

            while (!Validation1.check_if_int(input) || Convert.ToInt32(input) < 1)
            {
                Console.WriteLine("Reenter id of order. It must be a natural number.");
                input = Console.ReadLine();
            }
            console_color_2();
            res = Convert.ToInt32(input);
            return(res);
        }
Ejemplo n.º 2
0
        static int menu()
        {
            int res;

            console_color_1();
            Console.WriteLine("YOU ARE NOW IN MAIN MENU");
            Console.WriteLine("ENTER YOIR CHOICE:");
            console_color_2();
            Console.WriteLine("1 - search some data through all info\n" +
                              "2 - sort collection by some argument\n" +
                              "3 - delete any order(by its id) and rewrite collection in file\n" +
                              "4 - add an order and rewrite collection in file\n" +
                              "5 - edit an order and rewrite collection in file\n" +
                              "6 - exit program\n");
            string choice = Console.ReadLine();

            while (!Validation1.check_if_int(choice) || Convert.ToInt32(choice) < 1 || Convert.ToInt32(choice) > 6)
            {
                Console.WriteLine("REENTER YOIR CHOICE:");
                choice = Console.ReadLine();
            }
            res = Convert.ToInt32(choice);
            return(res);
        }