public static EstadoComanda SeleccionarEstadoComanda(string id) { EstadoComanda estadoComanda = null; SqlDataReader data = null; try { data = EstadoComandaDato.SeleccionarEstadoComanda(id); while (data.Read()) { estadoComanda = new EstadoComanda(); estadoComanda.estadoComanda_id = data["estadoComanda_id"].ToString(); estadoComanda.descripcion = data["descripcion"].ToString(); } return(estadoComanda); } catch (Exception ex) { throw ex; } finally { data.Close(); } }
public static List <EstadoComanda> ObtenerTodos() { List <EstadoComanda> lista = new List <EstadoComanda>(); DataSet ds = EstadoComandaDato.SeleccionarTodos(); foreach (DataRow fila in ds.Tables[0].Rows) { EstadoComanda registro = new EstadoComanda(); registro.estadoComanda_id = fila["estadoComanda_id"].ToString(); registro.descripcion = fila["descripcion"].ToString(); lista.Add(registro); } return(lista); }