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

            db.YGoodsType.Remove(yGoodsType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "ID,Name,Sort,Icon")] YGoodsType yGoodsType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(yGoodsType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(yGoodsType));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "ID,Name,Sort,Icon")] YGoodsType yGoodsType)
        {
            if (ModelState.IsValid)
            {
                db.YGoodsType.Add(yGoodsType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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