Exemple #1
0
        public override DataTable Listado(string Campos, string Condicion, string Orden)
        {
            DataTable  dt         = new DataTable();
            DbArticulo cone       = new DbArticulo();
            string     OrdenFinal = "";

            if (!Orden.Equals(""))
            {
                OrdenFinal = "Orden By " + Orden;
            }

            return(cone.ObtenerDatos("Select " + Campos + "From Articulos" + Condicion + " --"));
        }
Exemple #2
0
        public override bool Buscar(int IdBuscado)
        {
            DataTable  dt       = new DataTable();
            DbArticulo articulo = new DbArticulo();

            bool Retornar = false;

            try
            {
                dt = articulo.ObtenerDatos("Select * from Articulos where ArticuloId =" + IdBuscado);
                if (dt.Rows.Count > 0)
                {
                    this.ArticuloId  = (int)dt.Rows[0]["ArticuloId"];
                    this.Descripcion = dt.Rows[0]["Descripcion"].ToString();
                    this.Foto        = dt.Rows[0]["Foto"].ToString();
                    this.Precio      = Convert.ToSingle(dt.Rows[0]["Precio"].ToString());
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Retornar);
        }