Exemple #1
0
        public List <metadatos.producto> obtener(List <SqlParameter> filtros = null)
        {
            list = new List <metadatos.producto>();

            using (oCon = new SqlServer())
            {
                if (filtros != null)
                {
                    foreach (SqlParameter p in filtros)
                    {
                        oCon.addParameter(p);
                    }
                }
                try
                {
                    using (SqlDataReader drInfo = oCon.executeReader("proc_get" + this.GetType().Name))
                    {
                        while (drInfo.Read())
                        {
                            obj = new metadatos.producto()
                            {
                                IdProducto = convertir.toNInt64(drInfo["idproducto"]),
                                Producto   = drInfo["producto"].ToString()
                            };

                            list.Add(obj);
                        }
                    }
                }
                catch (SqlException ex)
                {
                    _errorMensaje = ex.Message.ToString();
                }
            }

            return(list);
        }
Exemple #2
0
 public producto()
 {
     obj = new metadatos.producto();
 }