Ejemplo n.º 1
0
        public ActionResult <VolunteerActivityUpdatedResModel> Manage_VolunteerActivity_Update(VolunteerActivityViewModel model)
        {
            VolunteerActivityUpdatedResModel returnModel = new VolunteerActivityUpdatedResModel();

            if (_volunteerActivityService.ActivityDistinctForUpdate(model))
            {
                int result = _volunteerActivityService.Update(model);
                if (result > 0)
                {
                    returnModel.IsSuccess                  = true;
                    returnModel.ResultCount                = result;
                    returnModel.baseViewModel.Message      = "更新成功";
                    returnModel.baseViewModel.ResponseCode = 200;
                    //_ILogger.Information("活动信息更新成功");
                    return(Ok(returnModel));
                }
                else
                {
                    returnModel.IsSuccess                  = false;
                    returnModel.ResultCount                = 0;
                    returnModel.baseViewModel.Message      = "活动信息更新失败";
                    returnModel.baseViewModel.ResponseCode = 400;
                    //_ILogger.Information("活动信息更新失败");
                    return(BadRequest(returnModel));
                }
            }
            else
            {
                returnModel.IsSuccess                  = false;
                returnModel.ResultCount                = 0;
                returnModel.baseViewModel.Message      = "活动信息修改失败,该活动已存在";
                returnModel.baseViewModel.ResponseCode = 400;
                //_ILogger.Information("活动信息修改失败,该活动已存在");
                return(BadRequest(returnModel));
            }
        }
Ejemplo n.º 2
0
        public ActionResult <VolunteerActivityUpdatedResModel> Manage_VolunteerActivity_Delete(VolunteerActivityDeleteViewModel delModel)
        {
            VolunteerActivityUpdatedResModel returnModel = new VolunteerActivityUpdatedResModel();
            int result = _volunteerActivityService.DeleteByID(delModel);

            if (result > 0)
            {
                returnModel.IsSuccess                  = true;
                returnModel.ResultCount                = result;
                returnModel.baseViewModel.Message      = "信息已删除";
                returnModel.baseViewModel.ResponseCode = 200;
                //_ILogger.Information("活动信息已删除");
                return(Ok(returnModel));
            }
            else
            {
                returnModel.IsSuccess                  = false;
                returnModel.ResultCount                = 0;
                returnModel.baseViewModel.Message      = "活动信息删除失败";
                returnModel.baseViewModel.ResponseCode = 400;
                //_ILogger.Information("活动信息删除失败");
                return(BadRequest(returnModel));
            }
        }