public ActionResult DeleteConfirmed(int id) { BydloModels bydloModels = db.BydloProducts.Find(id); db.BydloProducts.Remove(bydloModels); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Wiek,Typ,Pasza,Producent,Cena,Bialko,Energia,Oleje_I_Tluszcze,Wapn,Fosfor,Sod")] BydloModels bydloModels) { if (ModelState.IsValid) { db.Entry(bydloModels).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bydloModels)); }
public ActionResult Create([Bind(Include = "ID,Wiek,Typ,Pasza,Producent,Cena,Bialko,Energia,Oleje_I_Tluszcze,Wapn,Fosfor,Sod")] BydloModels bydloModels) { if (ModelState.IsValid) { db.BydloProducts.Add(bydloModels); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bydloModels)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BydloModels bydloModels = db.BydloProducts.Find(id); if (bydloModels == null) { return(HttpNotFound()); } return(View(bydloModels)); }