// GET: Papeleria/Create public ActionResult Create() { Papeleria papeleria = new Papeleria { Nombre_papeleria = "", Contacto_papeleria = "", Direccion_papeleria = "" }; return(View(papeleria)); }
public ActionResult Delete(int id, FormCollection collection) { try { Papeleria papeleria = db.Papelerias.Single(g => g.Id_papeleria == id); db.Papelerias.Remove(papeleria); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(Papeleria papeleria) { try { db.Papelerias.Add(papeleria); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, FormCollection collection) { try { Papeleria papeleria = db.Papelerias.Single(g => g.Id_papeleria == id); if (TryUpdateModel <Papeleria>(papeleria)) { db.SaveChanges(); return(RedirectToAction("Index")); } return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: Papeleria/Delete/5 public ActionResult Delete(int id) { Papeleria papeleria = db.Papelerias.Single(g => g.Id_papeleria == id); return(View(papeleria)); }