Beispiel #1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            tbl_dishesType tbl_dishesType = db.tbl_dishesType.Find(id);

            db.tbl_dishesType.Remove(tbl_dishesType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "id,code,name")] tbl_dishesType tbl_dishesType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_dishesType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbl_dishesType));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "id,code,name")] tbl_dishesType tbl_dishesType)
        {
            if (ModelState.IsValid)
            {
                tbl_dishesType.id = Guid.NewGuid();
                db.tbl_dishesType.Add(tbl_dishesType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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