public async Task <ResponseResult> UpdateDowntime(UpdateDowntimeViewModel model) { ResponseResult responseResult = new ResponseResult(); StringContent content = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json"); using (var response = await httpClient.PostAsync("api/LineSupport/UpdateDowntime", content)) { string apiResponse = await response.Content.ReadAsStringAsync(); responseResult = JsonConvert.DeserializeObject <ResponseResult>(apiResponse); } return(responseResult); }
public async Task <IActionResult> UpdateDowntime([FromBody] UpdateDowntimeViewModel model) { try { await context.Database.ExecuteSqlCommandAsync(SPTestTech.Activities_update, model.Wc, model.DowntimeType, model.DowntimeDetail, model.StationOrTester, model.Duration, model.UpdatedBy); return(Ok(new ResponseResult(200))); } catch (Exception ex) { return(BadRequest(new ResponseResult(400, ex.Message))); } }
public async Task <IActionResult> UpdateDowntime([FromBody] UpdateDowntimeViewModel model) { var result = await testTechService.UpdateDowntime(model); return(Json(new { statusCode = result.StatusCode })); }