예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            BStore bstore = db.BStores.Find(id);

            db.BStores.Remove(bstore);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult Edit(int id = 0)
        {
            BStore bstore = db.BStores.Find(id);

            if (bstore == null)
            {
                return(HttpNotFound());
            }
            return(View(bstore));
        }
예제 #3
0
 public ActionResult Edit(BStore bstore)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bstore).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(bstore));
 }
예제 #4
0
        public ActionResult Create(BStore bstore)
        {
            if (ModelState.IsValid)
            {
                db.BStores.Add(bstore);
                db.SaveChanges();
                return(RedirectToAction("Create"));
            }

            return(View(bstore));
        }