Exemplo n.º 1
0
        static void StartRepairing()
        {
            Console.Write("Введите имя механика: ");
            string mechName = Console.ReadLine();

            if (mechanicRepository.GetByName(mechName) == null)
            {
                WrongData();
                return;
            }
            Guid MechanicId = mechanicRepository.GetByName(mechName).Id;

            Console.Write("Введите номер автобуса: ");
            string busNum = Console.ReadLine();

            if (busRepository.GetByNum(busNum) == null)
            {
                WrongData();
                return;
            }
            Guid BusId = busRepository.GetByNum(busNum).Id;

            var service = new Service
            {
                BusId      = BusId,
                MechanicId = MechanicId
            };

            serviceRepository.SetRepair(service);
            busRepository.Update(BusId, Status[2]);
        }