示例#1
0
        public IActionResult Delete(Menu model)
        {
            var bll = new MenuBll();
            var rst = bll.Delete(model);

            return(Json(rst));
        }
示例#2
0
        /// <summary>
        /// 删除菜单
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult DeleteMenu(string id)
        {
            var i = menuBll.Delete(id);

            return(Json(1 == i ? new RetJson()
            {
                Code = 200, Flag = true, Msg = "操作成功"
            } : new RetJson()
            {
                Code = 200, Flag = false, Msg = "操作失败"
            }, JsonRequestBehavior.AllowGet));
        }
示例#3
0
        public JsonResult DeleteMenu(int id)
        {
            var bll = new MenuBll();

            if (bll.Exists($"ParentId={id} AND IsDelete=0"))
            {
                return(Json(ErrorModel.DeleteForbidden));
            }

            var success = bll.Delete(id);

            return(Json(success ? ErrorModel.OperateSuccess : ErrorModel.OperateFailed));
        }
        public ActionResult Delete(long id)
        {
            var apiResult = new APIResult();

            try
            {
                MenuBll.Delete(id);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }
            return(Json(apiResult));
        }