public async Task <IHttpActionResult> Delete(DtoVehiculo item) { try { if (item != null) { await Task.Run(() => { item.Estado = EnumEstados.Eliminado; LogicaVehiculos.ActualizarVehiculo(item); }); return(Ok("Vehiculo eliminado.")); } else { return(BadRequest("Incorrect call")); } } catch (Exception ex) { ClsVisorEventos.LogEvent(ex); return(BadRequest($"Incorrect call:{ex.Message}")); } }
public async Task <IHttpActionResult> Get(DtoVehiculo item) { try { List <DtoVehiculo> lista = new List <DtoVehiculo>(); await Task.Run(() => { lista = LogicaVehiculos.ConsultarVehiculo(item); }); if (lista != null) { return(Ok(lista)); } else { return(NotFound()); } } catch (Exception ex) { ClsVisorEventos.LogEvent(ex); return(BadRequest($"Incorrect call:{ex.Message}")); } }
public async Task <IHttpActionResult> Edit(DtoVehiculo item) { try { if (item != null) { await Task.Run(() => { LogicaVehiculos.ActualizarVehiculo(item); }); return(Ok("Vehiculo actualizado")); } else { return(BadRequest("Incorrect call")); } } catch (Exception ex) { ClsVisorEventos.LogEvent(ex); return(BadRequest($"Incorrect call:{ex.Message}")); } }