public ActionResult Delete(int id) { AdresaFactura adresafactura = db.AdresaFactura.Find(id); db.AdresaFactura.Remove(adresafactura); db.SaveChanges(); return(RedirectToAction("Index", "Home")); }
public ActionResult Edit(int id) { AdresaFactura adresafactura = db.AdresaFactura.Find(id); if (!User.IsInRole("Admin")) { return(HttpNotFound("You don't have acces to modify this ")); } return(View(adresafactura)); }
public ActionResult Create(AdresaFactura f) { if (!ModelState.IsValid) { return(View("New", f)); } db.AdresaFactura.Add(f); db.SaveChanges(); return(RedirectToAction("Index", "Home")); }
public ActionResult Update(AdresaFactura f) { if (!ModelState.IsValid) { return(View("Edit", f)); } AdresaFactura adresafactura = db.AdresaFactura.Single(s => s.AdresaFacturaId == f.AdresaFacturaId); db.SaveChanges(); return(RedirectToAction("Index", "Home")); }