예제 #1
0
        public virtual void Delete(T entity)
        {
            if (_context.Entry(entity).State == EntityState.Detached)
            {
                _dbSet.Attach(entity);
            }

            _dbSet.Remove(entity);
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "ID_Username,Nume,Prenume,Email,Parola,ID_NumeFunctie")] Membrii membrii)
 {
     if (ModelState.IsValid)
     {
         db.Entry(membrii).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("../Membrii/Index"));
     }
     ViewBag.ID_NumeFunctie = new SelectList(db.Functies, "ID_NumeFunctie", "ID_NumeFunctie", membrii.ID_NumeFunctie);
     return(View(membrii));
 }
 public ActionResult Edit([Bind(Include = "ID_NumeResursa,ID_Locatie,CostZi,ID_Status")] Resurse resurse)
 {
     if (ModelState.IsValid)
     {
         db.Entry(resurse).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ID_Locatie = new SelectList(db.Locaties, "ID_Locatie", "ID_Locatie", resurse.ID_Locatie);
     ViewBag.ID_Status  = new SelectList(db.Status, "ID_Status", "ID_Status", resurse.ID_Status);
     return(View(resurse));
 }