Beispiel #1
0
        /// <summary>
        /// 删除菜单
        /// </summary>
        /// <param name="foodInfoDelViewModel"></param>
        /// <returns></returns>
        public int Food_Delete(FoodInfoDelViewModel foodInfoDelViewModel)
        {
            int DeleteRowsNum = _IFoodInfoRepository
                                .DeleteByFoodInfoIdList(foodInfoDelViewModel.DeleleIdList);

            if (DeleteRowsNum == foodInfoDelViewModel.DeleleIdList.Count)
            {
                return(DeleteRowsNum);
            }
            else
            {
                return(-1);
            }
        }
Beispiel #2
0
        public ActionResult <FoodInfoDelResModel> Manage_Food_Delete(FoodInfoDelViewModel foodInfoDelViewModel)
        {
            FoodInfoDelResModel foodInfoDelResModel = new FoodInfoDelResModel();
            int DeleteResult = _foodService.Food_Delete(foodInfoDelViewModel);

            if (DeleteResult > 0)
            {
                foodInfoDelResModel.DelCount                   = DeleteResult;
                foodInfoDelResModel.IsSuccess                  = true;
                foodInfoDelResModel.baseViewModel.Message      = "删除成功";
                foodInfoDelResModel.baseViewModel.ResponseCode = 200;
                _ILogger.Information("删除菜单信息成功");
                return(Ok(foodInfoDelResModel));
            }
            else
            {
                foodInfoDelResModel.DelCount                   = -1;
                foodInfoDelResModel.IsSuccess                  = false;
                foodInfoDelResModel.baseViewModel.Message      = "删除失败";
                foodInfoDelResModel.baseViewModel.ResponseCode = 400;
                _ILogger.Information("删除菜单信息失败");
                return(BadRequest(foodInfoDelResModel));
            }
        }