Exemple #1
0
        public IActionResult CancelRequest(int requestId)
        {
            ServiceRequest serviceRequest = _oDServiceRequestRepository.GetServiceRequestIdAsync(requestId).Result;

            if (serviceRequest != null)
            {
                _oDServiceRequestRepository.RemoveRequest(serviceRequest);
                return(RedirectToAction("MyRequests", new { applicantId = serviceRequest.ApplicantId }));
            }
            else
            {
                ViewBag.ErrorMessage = $"Error Canceling Request, Request Not Found";
                return(View("NotFound"));
            }
        }