Exemplo n.º 1
0
        /// <summary>
        /// 意见箱表单删除
        /// </summary>
        /// <param name="suggestBoxDelViewModel"></param>
        /// <returns></returns>
        public int SuggestBox_Delete(SuggestBoxDelViewModel suggestBoxDelViewModel)
        {
            int DeleteRowsNum = _ISuggestBoxRepository
                                .DeleteByFoodInfoIdList(suggestBoxDelViewModel.DeleleIdList);

            if (DeleteRowsNum == suggestBoxDelViewModel.DeleleIdList.Count)
            {
                return(DeleteRowsNum);
            }
            else
            {
                return(-1);
            }
        }
Exemplo n.º 2
0
        public ActionResult <SuggestBoxDelResModel> Manage_Suggest_Delete(SuggestBoxDelViewModel suggestBoxDelViewModel)
        {
            SuggestBoxDelResModel suggestBoxDelResModel = new SuggestBoxDelResModel();
            int DeleteResult = _suggestBoxService.SuggestBox_Delete(suggestBoxDelViewModel);

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