Exemple #1
0
 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());
 }
Exemple #2
0
 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));
 }