コード例 #1
0
        public static void Show(int num, string path)
        {
            LinqWorkerForCustumers linqWorker = new LinqWorkerForCustumers(path);

            switch (num)
            {
            case 1:
                decimal prise;
                ShowTask1(linqWorker.Task1(out prise));
                Console.WriteLine("\nPrise: " + prise);
                break;

            case 2: ShowTask2(linqWorker.Task2()); break;

            case 3: ShowTask3(linqWorker.Task3(ConsoleWorker.getIntegerValue("give me Prise "))); break;

            case 4: ShowTask4(linqWorker.Task4()); break;

            case 5: ShowTask5(linqWorker.Task5()); break;

            case 6: ShowTask6(linqWorker.Task6()); break;

            case 7: ShowTask7(linqWorker.Task7()); break;
            }
            Console.WriteLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            //need add Log For out information.
            //need shange void to list methods
            string path = $"{Environment.CurrentDirectory}\\Data\\Customers.xml";

            LinqWorkerForCustumers linqWorker = new LinqWorkerForCustumers(path);

            int i           = 10;
            int CountOfTask = 7;

            while (i != 0)
            {
                i = ConsoleWorker.getIntegerValue("We have 7 tasks. Press number 1-7 for show some task. If you whant see all task press 8. 0 - exit\n");
                if (i == CountOfTask + 1)
                {
                    for (int y = 1; y < CountOfTask + 1; y++)
                    {
                        Console.WriteLine($"====================== Task {y} ======================");
                        ShowResult.Show(y, path);
                    }
                }
                else
                {
                    ShowResult.Show(i, path);
                }
            }


            Console.Read();
        }