示例#1
0
        public IActionResult OnGet(int?id)
        {
            if (id.HasValue)
            {
                Patient = patientData.GetPatientById(id.Value);
                if (Patient == null)
                {
                    return(RedirectToPage("./NotFound"));
                }
            }
            else
            {
                Patient = new Core.Patient();
            }
            var doctors = doctorData.GetDoctors().ToList().Select(d => new { Id = d.Id, Display = $"{d.FirstName} {d.LastName}" });

            Doctors = new SelectList(doctors, "Id", "Display");
            Gender  = htmlHelper.GetEnumSelectList <Gender>();
            return(Page());
        }
示例#2
0
 public void OnGet()
 {
     Doctors = doctorData.GetDoctors();
 }