Example #1
0
        static void Main(string[] args)
        {
            ExDeviderV2.AdditionalEx(); //--------------------------------------------------------------------------------------------------------------------

            AdditionalEx.Show();

            ExDeviderV2.Ex2(); //--------------------------------------------------------------------------------------------------------------------

            Company comp = new Company();

            Console.WriteLine($" Exp is more than 5 years have:\n { comp[5]}");

            ExDeviderV2.Ex3();//--------------------------------------------------------------------------------------------------------------------

            Product_list priceTable = new Product_list();


            Console.WriteLine("\nSorted list by shops name! '");
            for (int i = 0; i < 2; i++)
            {
                Console.WriteLine(priceTable[i]);
            }

            ExDeviderV2.Line();

            Console.WriteLine("enter product id/name to seach:");
            string product = Console.ReadLine();

            Console.WriteLine(priceTable[product]);
        }
Example #2
0
        public Company()
        {
            string name;
            string post;
            int    year;
            string tmp;

            staff = new Worker[5];



            for (int i = 0; i < 5; i++)
            {
                Console.WriteLine("Введите имя сотрудника");
                name = Console.ReadLine();

                Console.WriteLine("Введите должность");
                post = Console.ReadLine();

                Console.WriteLine("Введите год начала работы ");
                tmp = Console.ReadLine();

                try
                {
                    year = Convert.ToInt32(tmp);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Unullowed year value entered! ");
                    Console.WriteLine(e.Message);
                    year = DateTime.Now.Year;
                }

                staff[i] = new Worker(name, post, year);

                ExDeviderV2.Line();
            }


            Sort();
        }