public virtual void Delete(T entityToDelete) { if (db.Entry(entityToDelete).State == EntityState.Detached) { DbSet.Attach(entityToDelete); } DbSet.Remove(entityToDelete); }
public ActionResult Edit([Bind(Include = "ID,TIPO")] TIPO_EMPLEADOS tIPO_EMPLEADOS) { if (ModelState.IsValid) { db.Entry(tIPO_EMPLEADOS).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tIPO_EMPLEADOS)); }
public Produto Update(Produto produto) { //Definindo a não trazer o proxy do banco para não levar para a outra aplicação. //O contexto do banco fica somente aqui. _db.Configuration.ProxyCreationEnabled = false; _db.Entry(produto).State = System.Data.EntityState.Modified; _db.SaveChanges(); return(produto); }
public ActionResult Edit([Bind(Include = "ID,NOMBRE")] CAT_PRODUCTOS cAT_PRODUCTOS) { if (ModelState.IsValid) { db.Entry(cAT_PRODUCTOS).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cAT_PRODUCTOS)); }
public ActionResult Edit([Bind(Include = "ID,NOMBRE,AP_PATERNO,AP_MATERNO,DIRECCION,TELEFONO,EMAIL")] PROVEEDORES pROVEEDORES) { if (ModelState.IsValid) { db.Entry(pROVEEDORES).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pROVEEDORES)); }
public ActionResult Edit([Bind(Include = "ID,NOMBRE,AP_PATERNO,AP_MATERNO,DEPARTAMENTOID")] TRABAJADORESUX tRABAJADORESUX) { if (ModelState.IsValid) { db.Entry(tRABAJADORESUX).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DEPARTAMENTOID = new SelectList(db.DEPARTAMENTOS, "ID", "NOMBRE", tRABAJADORESUX.DEPARTAMENTOID); return(View(tRABAJADORESUX)); }
public ActionResult Edit([Bind(Include = "ID,USERNAME,PASSWORD,NOMBRE,AP_PATERNO,AP_MATERNO,TIPO_EMPLEADOID")] EMPLEADOS eMPLEADOS) { if (ModelState.IsValid) { db.Entry(eMPLEADOS).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.TIPO_EMPLEADOID = new SelectList(db.TIPO_EMPLEADO, "ID", "TIPO", eMPLEADOS.TIPO_EMPLEADOID); return(View(eMPLEADOS)); }
public ActionResult Edit([Bind(Include = "ID,CODIGOBARRAS,NOMBRE,PRECIO,UBICACION,CATEGORIASID")] PRODUCTOS pRODUCTOS) { if (ModelState.IsValid) { db.Entry(pRODUCTOS).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CATEGORIASID = new SelectList(db.CAT_PRODUCTO, "ID", "NOMBRE", pRODUCTOS.CATEGORIASID); return(View(pRODUCTOS)); }
public async Task <IHttpActionResult> PutOffer(string id, Offer Offer) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != Offer.Id) { return(BadRequest("Incorrect id")); } if (!OfferExists(id)) { return(NotFound()); } Offer.UpdatedOn = DateTime.Now; db.Entry(Offer).State = EntityState.Modified; await db.SaveChangesAsync(); return(StatusCode(HttpStatusCode.OK)); }
public void Update(Contato obj) { _context.Entry(obj).State = EntityState.Modified; _context.SaveChanges(); }
public DbEntityEntry DataBaseEntityValue(T entity) { DbEntityEntry full = Context.Entry(entity); return(full); }
public void Update(T entity) { db.Entry(entity).State = EntityState.Modified; db.SaveChanges(); }