Ejemplo n.º 1
0
        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"));
        }
Ejemplo n.º 3
0
        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();
            }
        }
Ejemplo n.º 4
0
 public bool Update(T newRecord)
 {
     try
     {
         T old = GetOne(newRecord.Id);
         _db.Entry(old).CurrentValues.SetValues(newRecord);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }