public ActionResult DeleteConfirmed(int id) { EDITORAS editoras = db.EDITORAS.Find(id); db.EDITORAS.Remove(editoras); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "IDEDITORA,CNPJ,NOMEFANTASIA,EMAIL,TELEFONE")] EDITORAS editoras) { if (ModelState.IsValid) { db.Entry(editoras).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(editoras)); }
public ActionResult Create([Bind(Include = "IDEDITORA,CNPJ,NOMEFANTASIA,EMAIL,TELEFONE")] EDITORAS editoras) { if (ModelState.IsValid && (ValidacaoCnpj.IsCnpj(editoras.CNPJ) == true)) { db.EDITORAS.Add(editoras); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(editoras)); }
// GET: Editoras/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EDITORAS editoras = db.EDITORAS.Find(id); if (editoras == null) { return(HttpNotFound()); } return(View(editoras)); }