Advertisement
Montagne94

27. Кадровый учет продвинутый

Oct 15th, 2020 (edited)
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.40 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace ConsoleApp1
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             List<string> fullName = new List<string>();
  11.             List<string> position = new List<string>();
  12.  
  13.             bool programmIsExit = true;
  14.  
  15.             while (programmIsExit)
  16.             {
  17.                 Console.WriteLine($"Кадровый учет:\n");
  18.                 Console.WriteLine($"1. Добавить досье\n2. Вывести все досье\n3. Удалить досье\n4. Выход");
  19.  
  20.                 switch (int.Parse(Console.ReadLine()))
  21.                 {
  22.                     case 1:
  23.                         Console.Clear();
  24.                         Console.WriteLine("Введите ФИО");
  25.                         fullName.Add(Console.ReadLine());
  26.  
  27.                         Console.Clear();
  28.                         Console.WriteLine("Введите должность");
  29.                         position.Add(Console.ReadLine());
  30.                         Console.Clear();
  31.                         break;
  32.                     case 2:
  33.                         OutputAllDossier(fullName, position);
  34.                         break;
  35.                     case 3:
  36.                         Console.Clear();
  37.                         Console.WriteLine("Введите порядковый номер сотрудника");
  38.                         int serialNumber = int.Parse(Console.ReadLine());
  39.  
  40.                         fullName.RemoveAt(serialNumber);
  41.                         position.RemoveAt(serialNumber);
  42.  
  43.                         Console.Clear();
  44.                         break;
  45.                     case 4:
  46.                         programmIsExit = false;
  47.                         break;
  48.                     default:
  49.                         Console.WriteLine("Вы не выбрали не один из пунктов меню пожалуйста повторите попытку");
  50.                         break;
  51.                 }
  52.             }
  53.         }
  54.  
  55.  
  56.         static void OutputAllDossier(List<string> fullName, List<string> position)
  57.         {
  58.             Console.Clear();
  59.             for (int i = 0; i < fullName.Count; i++)
  60.             {
  61.                 Console.Write($"{i}. {fullName[i]} - {position[i]}\n");
  62.             }
  63.             Console.ReadKey();
  64.             Console.Clear();
  65.         }
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement