public List<Talla_staging> obtener_lista_items_customer_staging(int id_staging, int summary){ List<Talla_staging> lista = new List<Talla_staging>(); Conexion con = new Conexion(); try{ SqlCommand com = new SqlCommand(); SqlDataReader leer = null; com.Connection = con.AbrirConexion(); com.CommandText = "SELECT id_staging_count,id_talla,total FROM staging_count " + " WHERE id_staging='" + id_staging + "' "; leer = com.ExecuteReader(); while (leer.Read()){ Talla_staging ts = new Talla_staging(); ts.total = Convert.ToInt32(leer["total"]); ts.id_talla = Convert.ToInt32(leer["id_talla"]); lista.Add(ts); }leer.Close(); }finally { con.CerrarConexion(); con.Dispose(); } return lista; }
public List<Talla_staging> obtener_cantidades_tallas_estilo(int posummary) { List<Talla_staging> lista = new List<Talla_staging>(); Conexion conn = new Conexion(); try { SqlCommand comando = new SqlCommand(); SqlDataReader leerFilas = null; comando.Connection = conn.AbrirConexion(); comando.CommandText = "SELECT TALLA_ITEM,CANTIDAD,EXTRAS,EJEMPLOS FROM ITEM_SIZE WHERE ID_SUMMARY='" + posummary + "' "; leerFilas = comando.ExecuteReader(); while (leerFilas.Read()) { Talla_staging ts = new Talla_staging(); ts.id_talla = Convert.ToInt32(leerFilas["TALLA_ITEM"]); ts.talla = consultas.obtener_size_id(Convert.ToString(leerFilas["TALLA_ITEM"])); ts.total = Convert.ToInt32(leerFilas["CANTIDAD"]) + Convert.ToInt32(leerFilas["EXTRAS"]) + Convert.ToInt32(leerFilas["EJEMPLOS"]); lista.Add(ts); } leerFilas.Close(); } finally { conn.CerrarConexion(); conn.Dispose(); } return lista; }