Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            store store = db.stores.Find(id);

            db.stores.Remove(store);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "book_id,book_name,book_price,author_name,year_published")] store store)
 {
     if (ModelState.IsValid)
     {
         db.Entry(store).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(store));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "book_id,book_name,book_price,author_name,year_published")] store store)
        {
            if (ModelState.IsValid)
            {
                db.stores.Add(store);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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