Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<string> fullName = new List<string>();
- List<string> position = new List<string>();
- bool programmIsExit = true;
- while (programmIsExit)
- {
- Console.WriteLine($"Кадровый учет:\n");
- Console.WriteLine($"1. Добавить досье\n2. Вывести все досье\n3. Удалить досье\n4. Выход");
- switch (int.Parse(Console.ReadLine()))
- {
- case 1:
- Console.Clear();
- Console.WriteLine("Введите ФИО");
- fullName.Add(Console.ReadLine());
- Console.Clear();
- Console.WriteLine("Введите должность");
- position.Add(Console.ReadLine());
- Console.Clear();
- break;
- case 2:
- OutputAllDossier(fullName, position);
- break;
- case 3:
- Console.Clear();
- Console.WriteLine("Введите порядковый номер сотрудника");
- int serialNumber = int.Parse(Console.ReadLine());
- fullName.RemoveAt(serialNumber);
- position.RemoveAt(serialNumber);
- Console.Clear();
- break;
- case 4:
- programmIsExit = false;
- break;
- default:
- Console.WriteLine("Вы не выбрали не один из пунктов меню пожалуйста повторите попытку");
- break;
- }
- }
- }
- static void OutputAllDossier(List<string> fullName, List<string> position)
- {
- Console.Clear();
- for (int i = 0; i < fullName.Count; i++)
- {
- Console.Write($"{i}. {fullName[i]} - {position[i]}\n");
- }
- Console.ReadKey();
- Console.Clear();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement