Пример #1
0
        static void Main(string[] args)
        {
            //1
            UnemployedManager um = new UnemployedManager();

            Console.WriteLine("\n\nUnemployed manager test\n");
            um.AddUnemployed(); // добавить нового безработного
            um.DisplayAll(); // вывод всех

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
            Console.Clear();

            um.DelUnemployed(); // удалить безработного
            um.DisplayAll(); // вывод всех

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
            Console.Clear();

            um.AddUnemployed(); // добавить нового безработного
            um.AddUnemployed(); // добавить нового безработного
            um.SearchUnemployed(); //вывод только заданого пользователем

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
            Console.Clear();

            //2
            Vacancy vm = new Vacancy(); //менеджер управления свободными вакансиями

            Console.Clear();
            Console.WriteLine("\n\n Vacancy manager test\n");
            vm.AddVacancy(); // добавление вакансии
            vm.DisplayAll(); //вывод всех

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
            Console.Clear();

            vm.DelVacancy(); // удаление заданой вакансии
            vm.DisplayAll(); //вывод всех

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
            Console.Clear();

            vm.AddVacancy(); // добавление вакансии
            vm.AddVacancy(); // добавление вакансии
            vm.ShowVacancy(); //вывод заданой вакансии

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
            Console.Clear();
        }
Пример #2
0
        public HttpResponseMessage AddVacancy([FromBody] Vacancy vacancy)
        {
            HttpResponseMessage message = new HttpResponseMessage();

            if (vacancy != null)
            {
                message.Content = new StringContent(Vacancy.AddVacancy(vacancy));
            }
            else
            {
                message.Content      = new StringContent("object is null, please check parameters");
                message.ReasonPhrase = "check the json format or the right parameters";
            }

            return(message);
        }