Beispiel #1
0
        public IActionResult ManageBusWorker()
        {
            var viewmodel = new ManageBusWorkerViewModel();

            viewmodel.BusWorkers = busWorkerRepository.GetAll();
            return(View(viewmodel));
        }
Beispiel #2
0
        public IActionResult ManageBusWorker(ManageBusWorkerViewModel viewModel)
        {
            var busWorker = new BusWorker();

            busWorker.Certificate = certificateRepository.Get(viewModel.LicenseId);
            busWorker.CitizenUser = citizenUserRepository.GetUserByLogin(viewModel.CitizenLogin);
            busWorkerRepository.Save(busWorker);
            viewModel.BusWorkers = busWorkerRepository.GetAll();
            return(View(viewModel));
        }