Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Karnet karnet = db.Karnet.Find(id);

            db.Karnet.Remove(karnet);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "Id,Dni,Koszt")] Karnet karnet)
 {
     if (ModelState.IsValid)
     {
         db.Entry(karnet).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(karnet));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "Id,Dni,Koszt")] Karnet karnet)
        {
            if (ModelState.IsValid)
            {
                db.Karnet.Add(karnet);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(karnet));
        }
Example #4
0
        // GET: Karnet/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Karnet karnet = db.Karnet.Find(id);

            if (karnet == null)
            {
                return(HttpNotFound());
            }
            return(View(karnet));
        }