예제 #1
0
        public ActionResult Update(ButtonAddModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new ResultInfo()
                {
                    ErrorNo = -1, ErrorMsg = ResSuggest.OperateFail + GetModelInvalidMsg()
                }));
            }

            var updateModel = Mapper.Map <ButtonAddModel, Button>(model);

            if (_buttonService.Update(updateModel))
            {
                return(Json(new ResultInfo()
                {
                    ErrorNo = 0, ErrorMsg = ResSuggest.UpdateSuccess
                }));
            }
            else
            {
                return(Json(new ResultInfo()
                {
                    ErrorNo = -1, ErrorMsg = ResSuggest.UpdateFail
                }));
            }
        }
예제 #2
0
 public async Task <IActionResult> Update(ButtonDto update)
 {
     if (await _btnService.Update(update))
     {
         return(NoContent());
     }
     return(BadRequest($"Updating Button {update.ID} failed on save"));
 }
예제 #3
0
 public async Task <IActionResult> Update([FromBody] ButtonDto updateButton)
 {
     return(ActionResultInstance(await _userService.Update(updateButton, updateButton.Id)));
 }
예제 #4
0
 public Task <IResultModel> Update(ButtonUpdateModel model)
 {
     return(_service.Update(model));
 }