public List <recibos_item> obtener_lista_items_customer(int id_recibo, int summary) { List <recibos_item> lista = new List <recibos_item>(); Conexion con = new Conexion(); try{ SqlCommand com = new SqlCommand(); SqlDataReader leer = null; com.Connection = con.AbrirConexion(); com.CommandText = "SELECT ri.id_inventario,ri.total,ri.id_recibo_item,i.id_size FROM recibos_items ri,inventario i " + " where ri.id_recibo='" + id_recibo + "' AND ri.id_summary=" + summary + " AND i.id_inventario=ri.id_inventario "; leer = com.ExecuteReader(); while (leer.Read()) { recibos_item ri = new recibos_item(); ri.id_recibo_item = Convert.ToInt32(leer["id_recibo_item"]); ri.id_inventario = Convert.ToInt32(leer["id_inventario"]); ri.id_talla = Convert.ToInt32(leer["id_size"]); ri.total = Convert.ToInt32(leer["total"]); //ri.item = obtener_inventario(ri.id_inventario); //ri.lista_cajas = obtener_cajas_recibo(ri.id_recibo_item); lista.Add(ri); } leer.Close(); }finally { con.CerrarConexion(); con.Dispose(); } return(lista); }
public List <recibos_item> obtener_lista_items(string id_recibo) { List <recibos_item> lista = new List <recibos_item>(); Conexion con = new Conexion(); try{ SqlCommand com = new SqlCommand(); SqlDataReader leer = null; com.Connection = con.AbrirConexion(); com.CommandText = "Select ri.id_inventario,ri.total,ri.id_recibo_item from recibos_items ri where ri.id_recibo='" + id_recibo + "' "; leer = com.ExecuteReader(); while (leer.Read()) { recibos_item ri = new recibos_item(); ri.id_recibo_item = Convert.ToInt32(leer["id_recibo_item"]); ri.id_inventario = Convert.ToInt32(leer["id_inventario"]); ri.total = Convert.ToInt32(leer["total"]); ri.item = obtener_inventario(ri.id_inventario); ri.lista_cajas = obtener_cajas_recibo(ri.id_recibo_item); lista.Add(ri); } leer.Close(); }finally{ con.CerrarConexion(); con.Dispose(); } return(lista); }