public async Task <TblOperationImageRel> SelectOperationImageRelById(int id) { HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync($"api/OperationImageRelCore/SelectOperationImageRelById?id={id}", id); TblOperationImageRel ans = await httpResponseMessage.Content.ReadAsAsync <TblOperationImageRel>(); return(ans); }
public async Task <TblOperationImageRel> AddOperationImageRel(TblOperationImageRel operationImageRel) { HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync("api/OperationImageRelCore/AddOperationImageRel", operationImageRel); TblOperationImageRel ans = await httpResponseMessage.Content.ReadAsAsync <TblOperationImageRel>(); return(ans); }
public DtoTblOperationImageRel(TblOperationImageRel operationImageRel, HttpStatusCode statusEffect) { id = operationImageRel.id; OperationId = operationImageRel.OperationId; ImageId = operationImageRel.ImageId; StatusEffect = statusEffect; }
public async Task <bool> UpdateOperationImageRel(TblOperationImageRel operationImageRel, int logId) { List <object> operationImageRelAndLogId = new List <object>(); operationImageRelAndLogId.Add(operationImageRel); operationImageRelAndLogId.Add(logId); HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync("api/OperationImageRelCore/UpdateOperationImageRel", operationImageRelAndLogId); bool ans = await httpResponseMessage.Content.ReadAsAsync <bool>(); return(ans); }
public IHttpActionResult AddOperationImageRel(TblOperationImageRel operationImageRel) { var task = Task.Run(() => new OperationImageRelService().AddOperationImageRel(operationImageRel)); if (task.Wait(TimeSpan.FromSeconds(10))) { if (task.Result.id != -1) { return(Ok(new DtoTblOperationImageRel(task.Result, HttpStatusCode.OK))); } else { return(Conflict()); } } return(StatusCode(HttpStatusCode.RequestTimeout)); }
public IHttpActionResult UpdateOperationImageRel(List <object> operationImageRelLogId) { TblOperationImageRel operationImageRel = JsonConvert.DeserializeObject <TblOperationImageRel>(operationImageRelLogId[0].ToString()); int logId = JsonConvert.DeserializeObject <int>(operationImageRelLogId[1].ToString()); var task = Task.Run(() => new OperationImageRelService().UpdateOperationImageRel(operationImageRel, logId)); if (task.Wait(TimeSpan.FromSeconds(10))) { if (task.Result) { return(Ok(true)); } else { return(Conflict()); } } return(StatusCode(HttpStatusCode.RequestTimeout)); }
public TblOperationImageRel AddOperationImageRel(TblOperationImageRel operationImageRel) { return(new OperationImageRelRepo().AddOperationImageRel(operationImageRel)); }
public bool UpdateOperationImageRel(TblOperationImageRel operationImageRel, int logId) { return(new OperationImageRelRepo().UpdateOperationImageRel(operationImageRel, logId)); }