public async Task <IActionResult> PutDoctor(int id, Doctor doctor) { if (id != doctor.did) { return(BadRequest()); } _context.Entry(doctor).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DoctorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Putmedicine(int id, medicine medicine) { if (id != medicine.MedicineId) { return(BadRequest()); } _context.Entry(medicine).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!medicineExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutAdmin(int id, Admin admin) { if (id != admin.aid) { return(BadRequest()); } _context.Entry(admin).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdminExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPatient(int id, Patient patient) { if (id != patient.pid) { return(BadRequest()); } _context.Entry(patient).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PatientExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }