public async Task <IActionResult> UpdateFloor(UpdateFloorDTO input) { try { await _floorService.UpdateFloor(input); return(Ok()); } catch (Exception) { throw; } }
public bool UpdateFloor([FromBody] Floor floor) { _logger.LogInfo("API HttpPut api/floors"); try { return(_floorService.UpdateFloor(floor)); } catch (System.Exception e) { _logger.LogError("API HttpPut api/floors " + e.Message); throw e; } }
public Task <AlpApiResponse> UpdateFloor([FromBody] FloorDto floor) { var sessionToken = HttpContext.Request.Headers["sessiontoken"]; if (!_accountService.Authorize(sessionToken, new List <RoleType> { RoleType.Admin })) { return(Task.FromResult(new AlpApiResponse { Success = false, Message = "Nincs jogosultsága ehhez a művelethez!" })); } return(_floorService.UpdateFloor(floor)); }
/// <summary> /// Change a single value in the list /// </summary> /// <param name=<em>"id"</em>>The id of the value to be changed</param> /// <param name=<em>"value"</em>>The new value</param> // PUT: api/Status/5 public HttpResponseMessage Put(int id, [FromBody] Floor obj) { try { Floor res = null; if (id >= 0) { res = _FloorService.UpdateFloor(id, obj); } if (res != null) { return(Request.CreateResponse(HttpStatusCode.OK, res)); } else { return(Request.CreateErrorResponse(HttpStatusCode.NotAcceptable, "Data Not Updated")); } } catch (Exception) { return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } }