public ActionResult ConfirmFreelancer(int id, string loginFreelancer) { try { var role = _clientUser.GetRoleUser(User.Identity.Name); if (role == "Customer") { _clientOrder.AssignFreelancer(id, loginFreelancer); } } catch (System.ServiceModel.EndpointNotFoundException ex) { ModelState.AddModelError(String.Empty, "Ошибка подключения к серверу. Сервер недоступен"); } return(RedirectToAction("Index", "Home")); }