public ActionResult DeleteConfirmed(int id) { tbldepartamento tbldepartamento = db.tbldepartamento.Find(id); db.tbldepartamento.Remove(tbldepartamento); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,nome,descricao")] tbldepartamento tbldepartamento) { if (ModelState.IsValid) { db.Entry(tbldepartamento).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tbldepartamento)); }
public ActionResult Create([Bind(Include = "Id,nome,descricao")] tbldepartamento tbldepartamento) { if (ModelState.IsValid) { db.tbldepartamento.Add(tbldepartamento); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tbldepartamento)); }
// GET: tbldepartamentoes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbldepartamento tbldepartamento = db.tbldepartamento.Find(id); if (tbldepartamento == null) { return(HttpNotFound()); } return(View(tbldepartamento)); }