public ActionResult DeleteConfirmed(int id) { KaczkaModels kaczkaModels = db.KaczkaProducts.Find(id); db.KaczkaProducts.Remove(kaczkaModels); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Wiek,Pasza,Producent,Cena,Bialko,Energia,Oleje,Wapn,Fosfor,Sod,Lizyna,Metionina,Treonina")] KaczkaModels kaczkaModels) { if (ModelState.IsValid) { db.Entry(kaczkaModels).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(kaczkaModels)); }
public ActionResult Create([Bind(Include = "Id,Wiek,Pasza,Producent,Cena,Bialko,Energia,Oleje,Wapn,Fosfor,Sod,Lizyna,Metionina,Treonina")] KaczkaModels kaczkaModels) { if (ModelState.IsValid) { db.KaczkaProducts.Add(kaczkaModels); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(kaczkaModels)); }
// GET: Kaczka/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } KaczkaModels kaczkaModels = db.KaczkaProducts.Find(id); if (kaczkaModels == null) { return(HttpNotFound()); } return(View(kaczkaModels)); }