Пример #1
0
 public IActionResult OnGet(int id)
 {
     Doctor = doctorData.GetDoctorById(id);
     if (Doctor == null)
     {
         return(RedirectToPage("~/NotFound"));
     }
     return(Page());
 }
Пример #2
0
        public IActionResult OnGet(int?id)
        {
            if (id.HasValue)
            {
                Doctor = doctorData.GetDoctorById(id.Value);
                if (Doctor == null)
                {
                    return(RedirectToPage("./NotFound"));
                }
            }
            else
            {
                Doctor = new Core.Doctor();
            }
            var clinics = clinicData.GetClinics().ToList().Select(p => new { Id = p.Id, Display = p.Name });

            Clinics = new SelectList(clinics, "Id", "Display");
            Gender  = htmlHelper.GetEnumSelectList <Gender>();
            return(Page());
        }