public IActionResult GetRegistrationRequestsByMinorName(string name)
        {
            var registrationRequests = registrationRequestRepository.GetRegistrationRequestsByMinorName(name);

            if (registrationRequests == null)
            {
                return(NotFound("No record found"));
            }

            return(Ok(registrationRequests.ToList()));
        }
Ejemplo n.º 2
0
        public IActionResult SearchRegistrationRequestsByMinorName(string minorName)
        {
            if (string.IsNullOrEmpty(minorName))
            {
                return(null);
            }

            RegistrationRequestViewModel model = new RegistrationRequestViewModel();

            if (string.Equals(minorName, "_all_", StringComparison.OrdinalIgnoreCase))
            {
                model.RegistrationRequests = registrationRequestRepository.GetRegistrationRequests()?.ToList();
            }
            else
            {
                model.RegistrationRequests = registrationRequestRepository.GetRegistrationRequestsByMinorName(minorName)?.ToList();
            }

            return(PartialView("_RegistrationRequestTable", model));
        }