示例#1
0
        public static List <Comanda> ObtenerTodos(string estadoComanda)
        {
            List <Comanda> lista = new List <Comanda>();
            DataSet        ds    = ComandaDato.SeleccionarTodos(estadoComanda);

            foreach (DataRow fila in ds.Tables[0].Rows)
            {
                Comanda registro = new Comanda();

                registro.comanda_id     = fila["comanda_id"].ToString();
                registro.estadoComanda  = EstadoComandaLN.SeleccionarEstadoComanda(fila["estadoComanda_id"].ToString());
                registro.mesa           = MesaLN.SeleccionarMesa(fila["mesa_id"].ToString());
                registro.estadoCuenta   = EstadoCuentaLN.SeleccionarEstadoCuenta(fila["estadoCuenta_id"].ToString());
                registro.nombreCliente  = fila["nombreCliente"].ToString();
                registro.usuarioComanda = UsuarioLN.SeleccionarUsuarioPorId(fila["usuario_id"].ToString());

                lista.Add(registro);
            }
            return(lista);
        }