Beispiel #1
0
        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"));
        }
Beispiel #2
0
        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"));
        }
Beispiel #3
0
 public override bool Delete(object dto)
 {
     return(dao.Delete(dto));
 }
Beispiel #4
0
        public JsonResult Delete(int id)
        {
            bool isSuccess = menuDAO.Delete(id);

            return(Json(new { status = isSuccess ? 200 : 500 }, JsonRequestBehavior.AllowGet));
        }
Beispiel #5
0
 public static int Delete(string tenMon)
 {
     return(MenuDAO.Delete(tenMon));
 }