public ActionResult DeleteConfirmed(int id) { ModelosOCA modelosOCA = db.ModelosOCAs.Find(id); db.ModelosOCAs.Remove(modelosOCA); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(ModelosOCA modelosOCA) { if (ModelState.IsValid) { db.Entry(modelosOCA).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(modelosOCA)); }
public ActionResult Create(ModelosOCA modelosOCA) { if (ModelState.IsValid) { db.ModelosOCAs.Add(modelosOCA); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(modelosOCA)); }
// GET: ModelosOCA/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ModelosOCA modelosOCA = db.ModelosOCAs.Find(id); if (modelosOCA == null) { return(HttpNotFound()); } return(View(modelosOCA)); }