public CLSTipoAlmacenCollection ConsultarTipoAlmacenBAL(string psCriterio) { CLSTipoAlmacenCollection tipoAlmacenCollection = new CLSTipoAlmacenCollection(); try { tipoAlmacenCollection = base.ConsultarTipoAlmacenCollection(psCriterio); return(tipoAlmacenCollection); } catch { throw; } }
protected CLSTipoAlmacenCollection ConsultarTipoAlmacenCollection(string psCriterio) { DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(); CLSTipoAlmacenCollection tipoAlmacenCollection = new CLSTipoAlmacenCollection(); CLSTipoAlmacen tipoAlmacen; try { da.SelectCommand = new SqlCommand(Procedimientos.sp_ConsCatTipoAlmacen, this.Conexion); da.SelectCommand.CommandType = CommandType.StoredProcedure; da.SelectCommand.Parameters.Add("@Criterio", SqlDbType.VarChar).Value = psCriterio; da.Fill(ds); if (ds.Tables[0].Rows.Count > 0) { int renglones = ds.Tables[0].Rows.Count; int columnas = ds.Tables[0].Columns.Count; for (int contador = 0; contador < ds.Tables[0].Rows.Count; contador++) { tipoAlmacen = new CLSTipoAlmacen(); tipoAlmacen.Codigo = ds.Tables[0].Rows[contador]["CODIGO"].ToString().Trim(); tipoAlmacen.Descripcion = ds.Tables[0].Rows[contador]["DESCRIPCION"].ToString().Trim(); tipoAlmacen.Werks = ds.Tables[0].Rows[contador]["WERKS"].ToString().Trim(); tipoAlmacenCollection.Add(tipoAlmacen); } } return(tipoAlmacenCollection); } catch (Exception ex) { throw new Exception(Errores.ConsultarRegistro + Errores.MensajeOriginal + ex.Message.ToString()); } finally { this.Conexion.Close(); } }