Beispiel #1
0
        public ActionResult RemoveDispatcherFromCompany(int id)
        {
            var userid     = User.Identity.GetUserId();
            var company    = _companyService.GetAll().First(x => x.UserId == userid);
            var dispatcher = _dispatcherService.GetAll().First(x => x.Id == id);

            if (dispatcher.Company.Id == company.Id)
            {
                _dispatcherService.RemoveDispatcher(dispatcher);
            }
            return(RedirectToAction($"Dispatchers"));
        }