示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CentralStore centralStore = db.CentralStores.Find(id);

            db.CentralStores.Remove(centralStore);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id,Item,Class,Price,CreatedDate,IsDeleted")] CentralStore centralStore)
 {
     if (ModelState.IsValid)
     {
         db.Entry(centralStore).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(centralStore));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "Id,Item,Class,Price,CreatedDate,IsDeleted")] CentralStore centralStore)
        {
            if (ModelState.IsValid)
            {
                db.CentralStores.Add(centralStore);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(centralStore));
        }
示例#4
0
        // GET: CentralStores/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CentralStore centralStore = db.CentralStores.Find(id);

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