public JsonResult DeleteSubMenu(RequestDeleteSubMenu request)
 {
     try
     {
         var result = _subMenu.DeleteSubMenu(request.SubMenuId);
         return(Json(new { Result = "success" }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(Json(new { Result = "failed", Message = "Cannot Delete" }));
     }
 }
Ejemplo n.º 2
0
        public JsonResult DeleteSubMenu(RequestDeleteSubMenu request)
        {
            try
            {
                var data = _subMenuMasterQueries.GetSubMenuBySubMenuId(request.SubMenuId);
                _unitOfWorkEntityFramework.SubMenuMasterCommand.Delete(data);
                var result = _unitOfWorkEntityFramework.Commit();

                if (result)
                {
                    _notificationService.SuccessNotification("Message", "The SubMenu Deleted successfully!");
                    return(Json(new { Result = "success" }));
                }
                else
                {
                    return(Json(new { Result = "failed", Message = "Cannot Delete" }));
                }
            }
            catch (Exception)
            {
                return(Json(new { Result = "failed", Message = "Cannot Delete" }));
            }
        }