public ActionResult EditDoctor(Doctor doctor) { db.Entry(doctor).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", new { id = Session["userID"] })); }
public ActionResult EditDoctor(Doctor doctor) { db.Entry(doctor).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("IndexDoc")); }
public void QuitReferral(int DoctorId, Referral Referral) { Doctor TargetDoctor; using (var db2 = new DoctorContext()) { TargetDoctor = db2.Doctors.Include("Referrals").First(x => x.Id.Equals(DoctorId)); TargetDoctor.Referrals.Remove(Referral); db2.Entry(TargetDoctor).State = EntityState.Modified; db2.SaveChanges(); } }
public bool Update(T newRecord) { try { T old = GetOne(newRecord.Id); _db.Entry(old).CurrentValues.SetValues(newRecord); return(true); } catch (Exception ex) { return(false); } }