public ActionResult ExcluirMenu(MenuModelView menu) { if (menu == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (!ModelState.IsValid) { ViewBag.Role = new SelectList(roleDAO.List(), "Id", "Description", menu.Role); return(View(menu)); } var model = MenuFactory.BuildModel(menu); model.Role = roleDAO.GetById(menu.Role); menuDAO.Delete(model); return(RedirectToAction("IndexMenus")); }
public ActionResult Delete(int id) { var dao = new MenuDAO(); var result = dao.Delete(id); switch (result) { case true: { SetAlert("Xóa menu " + id + " thành công", "success"); logger.Info("Xóa menu " + id + " thành công!"); return(RedirectToAction("Index")); } case false: { SetAlert("Xóa menu " + id + " không thành công", "error"); logger.Error("Xóa menu " + id + " không thành công!"); return(RedirectToAction("Index")); } } return(RedirectToAction("DsMenu")); }
public override bool Delete(object dto) { return(dao.Delete(dto)); }
public JsonResult Delete(int id) { bool isSuccess = menuDAO.Delete(id); return(Json(new { status = isSuccess ? 200 : 500 }, JsonRequestBehavior.AllowGet)); }
public static int Delete(string tenMon) { return(MenuDAO.Delete(tenMon)); }