Пример #1
0
        private Det_ordenes build_det_orden(MySqlDataReader data)
        {
            Det_ordenes item = new Det_ordenes(
                data.GetInt32("id"),
                data.GetInt32("id_orden"),
                data.GetDouble("cantidad"),
                data.GetInt32("id_producto")
                );

            return(item);
        }
Пример #2
0
        public List <Det_ordenes> get_detalles(int id_orden)
        {
            string             query  = "select id, id_orden, cantidad, id_producto from tbadetordenes where id_orden='" + id_orden + "'";
            MySqlDataReader    data   = runQuery(query);
            List <Det_ordenes> result = new List <Det_ordenes>();

            if (data.HasRows)
            {
                while (data.Read())
                {
                    Det_ordenes item = build_det_orden(data);
                    result.Add(item);
                }
            }
            return(result);
        }