public ActionResult DeleteConfirmed(int id) { tblrepresentante tblrepresentante = db.tblrepresentantes.Find(id); db.tblrepresentantes.Remove(tblrepresentante); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "RepresentanteId,Nombres,Email,Cargo,Cedula,CentroPracticaId")] tblrepresentante tblrepresentante) { if (ModelState.IsValid) { db.Entry(tblrepresentante).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CentroPracticaId = new SelectList(db.tblcentropracticas, "CentroPracticaId", "Nombre", tblrepresentante.CentroPracticaId); return(View(tblrepresentante)); }
// GET: tblrepresentantes/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblrepresentante tblrepresentante = db.tblrepresentantes.Find(id); if (tblrepresentante == null) { return(HttpNotFound()); } return(View(tblrepresentante)); }
// GET: tblrepresentantes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblrepresentante tblrepresentante = db.tblrepresentantes.Find(id); if (tblrepresentante == null) { return(HttpNotFound()); } ViewBag.CentroPracticaId = new SelectList(db.tblcentropracticas, "CentroPracticaId", "Nombre", tblrepresentante.CentroPracticaId); return(View(tblrepresentante)); }