public async Task <IActionResult> Edit(int id, [Bind("AppointmentId,PatientId,PatientFullName,DoctorId,DiagnosisId,DiagnosName,TotalSum,AppointmentPlaced")] AppointmentDone appointmentDone) { if (id != appointmentDone.AppointmentId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(appointmentDone); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AppointmentDoneExists(appointmentDone.AppointmentId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(appointmentDone)); }
public async Task <IActionResult> Create([Bind("AppointmentId,PatientId,PatientFullName,DoctorId,DiagnosisId,DiagnosName,TotalSum,AppointmentPlaced")] AppointmentDone appointmentDone) { if (ModelState.IsValid) { _context.Add(appointmentDone); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(appointmentDone)); }