public void Delete(HistorialViajes historial) { if (!string.IsNullOrEmpty(Convert.ToString(historial.Id))) { _crudFactory.Delete(historial); } else { throw new Exception(); } }
public EntidadBase BuildObject(Dictionary <string, object> row) { var historial = new HistorialViajes { Linea = GetStringValue(row, DB_COL_LINEA), Tren = GetStringValue(row, DB_COL_TREN), EstacionAnterior = GetStringValue(row, DB_COL_ESTACION_ANTERIOR), EstacionSiguiente = GetStringValue(row, DB_COL_ESTACION_SIGUIENTE), TiempoEstimado = GetStringValue(row, DB_COL_TIEMPO_ESTIMADO), Accion = GetStringValue(row, DB_COL_ACCION), Fecha = GetStringValue(row, DB_COL_FECHA) }; return(historial); }
public List <EntidadBase> BuildObjects(List <Dictionary <string, object> > lstRows) { var lstResults = new List <EntidadBase>(); foreach (var row in lstRows) { var historial = new HistorialViajes { Linea = GetStringValue(row, DB_COL_LINEA), Tren = GetStringValue(row, DB_COL_TREN), EstacionAnterior = GetStringValue(row, DB_COL_ESTACION_ANTERIOR), EstacionSiguiente = GetStringValue(row, DB_COL_ESTACION_SIGUIENTE), TiempoEstimado = GetStringValue(row, DB_COL_TIEMPO_ESTIMADO), Accion = GetStringValue(row, DB_COL_ACCION), Fecha = GetStringValue(row, DB_COL_FECHA) }; lstResults.Add(historial); } return(lstResults); }