public DoctorServiceResponse modifyDoctor(Doctor doctor) { if (!context.Doctors.Any(s => s.IdDoctor == doctor.IdDoctor)) { return(new DoctorServiceResponse { doctors = null, Error = "There are no doctors with this id" }); } context.Entry(doctor).State = EntityState.Modified; context.SaveChanges(); return(getDoctors()); }
public ActionResult Edit([Bind(Include = "Id,Name,MobileNo,PersonalAdress")] Doctor doctor) { if (ModelState.IsValid) { db.Entry(doctor).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(doctor)); }
public ActionResult Edit([Bind(Include = "Id,DoctorCode,DoctorName,Specialist,AvailableFromDate,ToDate,ContactNo,Description")] Doctor doctor) { if (ModelState.IsValid) { db.Entry(doctor).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(doctor)); }