public void DeleteMenuCategory(MenuCategory menugroup) { try { db.BeginTransaction(); db.Execute("Delete MenuDetails where MenuID=@0", menugroup.ID); db.Delete(menugroup); db.CompleteTransaction(); } catch { db.AbortTransaction(); } }
public void AddMenuCategory(MenuCategory menugroup) { db.Insert(menugroup); }
public JsonResult AddMenuCategory(MenuCategory menugroup) { try { sc.AddMenuCategory(menugroup); return Json(new { success = true, msg = "Xóa menu thành công" }, JsonRequestBehavior.AllowGet); } catch { return Json(new { success = false, msg = "Đã có lỗi xảy ra" }, JsonRequestBehavior.AllowGet); } }