예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Soupiska soupiska = db.Soupiskas.Find(id);

            db.Soupiskas.Remove(soupiska);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Jmeno,Prijmeni,Narodnost,Post,Popis")] Soupiska soupiska)
 {
     if (ModelState.IsValid)
     {
         db.Entry(soupiska).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(soupiska));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "Id,Jmeno,Prijmeni,Narodnost,Post,Popis")] Soupiska soupiska)
        {
            if (ModelState.IsValid)
            {
                db.Soupiskas.Add(soupiska);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(soupiska));
        }
예제 #4
0
        // GET: Soupiska/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Soupiska soupiska = db.Soupiskas.Find(id);

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