public List <Pro_LoteBE> ListaRegistroLote(int _case, string filtro) { List <Pro_LoteBE> oListLote = new List <Pro_LoteBE>(); using (SqlConnection conexion = Sys_Conexion.Conexion.GetConexion()) { try { conexion.Open(); using (SqlCommand oSqlCommand = new SqlCommand("SP_PRO_LC_LOTE", conexion)) { oSqlCommand.Parameters.Add("@case", SqlDbType.Int).Value = _case; oSqlCommand.Parameters.Add("@filtro", SqlDbType.VarChar).Value = filtro; oSqlCommand.CommandType = CommandType.StoredProcedure; using (SqlDataReader oSqlDataReader = oSqlCommand.ExecuteReader()) { while (oSqlDataReader.Read()) { Pro_LoteBE oPro_LoteBE = new Pro_LoteBE(); oPro_LoteBE.i_idLote = (byte)(oSqlDataReader["i_idLote"]); oPro_LoteBE.dt_fchFabricacion = (DateTime)(oSqlDataReader["dt_fchFabricacion"]); oPro_LoteBE.dt_fchVencimiento = (DateTime)(oSqlDataReader["dt_fchVencimiento"]); oPro_LoteBE.totalCantidad = (double)(oSqlDataReader["totalCantidad"]); oPro_LoteBE.oListLoteDetalle = ListaRegistroLoteDetalle(oPro_LoteBE.i_idLote); oListLote.Add(oPro_LoteBE); } oSqlDataReader.Close(); } } conexion.Close(); return(oListLote); } catch (System.Exception e) { return(null); } } }
public Pro_Lote_DetalleBE() { oLoteBE = new Pro_LoteBE(); oProductoBE = new Pro_Producto.Pro_ProductoBE(); oUnidProducto = new Pro_Unidad_Producto.Pro_Unidad_ProductoBE(); }