public async Task <IActionResult> Create([Bind("PatientID,Name,Gender")] Patient patient) { if (ModelState.IsValid) { _context.Add(patient); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(patient)); }
public async Task <IActionResult> Create([Bind("DepartmentID,Name")] Department department) { if (ModelState.IsValid) { _context.Add(department); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(department)); }
public async Task <IActionResult> Create([Bind("DoctorID,Name,DepartmentID")] Doctor doctor) { if (ModelState.IsValid) { _context.Add(doctor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DepartmentID"] = new SelectList(_context.Department, "DepartmentID", "Name", doctor.DepartmentID); return(View(doctor)); }
public async Task <IActionResult> Create([Bind("MedicalRecordID,Date,DoctorID,PatientID,PatientCondition,Indications")] MedicalRecord medicalRecord) { if (ModelState.IsValid) { _context.Add(medicalRecord); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DoctorID"] = new SelectList(_context.Doctor, "DoctorID", "Name", medicalRecord.DoctorID); ViewData["PatientID"] = new SelectList(_context.Patient, "PatientID", "Name", medicalRecord.PatientID); return(View(medicalRecord)); }