Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("DoctorID,FirstName,LastName,LoginID")] Doctor doctor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(doctor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(doctor));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("PatientID,DoctorID,FirstName,LastName,HealthCardNum,BirthDate")] Patient patient)
        {
            if (ModelState.IsValid)
            {
                _context.Add(patient);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DoctorID"] = new SelectList(_context.Doctors, "DoctorID", "DoctorID", patient.DoctorID);
            return(View(patient));
        }