Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            KaczkaModels kaczkaModels = db.KaczkaProducts.Find(id);

            db.KaczkaProducts.Remove(kaczkaModels);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 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));
 }
Пример #3
0
        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));
        }
Пример #4
0
        // 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));
        }