Example #1
0
        public override bool Eliminar()
        {
            DbArticulo articulos = new DbArticulo();
            bool       Retornar  = false;

            try
            {
                Retornar = articulos.Ejecutar(String.Format("Delete from Articulos where ArticuloId =" + this.ArticuloId));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Retornar);
        }
Example #2
0
        public override bool Insertar()
        {
            DbArticulo articulos = new DbArticulo();
            bool       Retornar  = false;

            try
            {
                Retornar = articulos.Ejecutar(String.Format("Insert into Articulos(Descripcion,Foto,Precio) Values('{0}','{1}',{2})", this.Descripcion, this.Foto, this.Precio));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Retornar);
        }
Example #3
0
        public override bool Editar()
        {
            bool       Retornar = false;
            DbArticulo articulo = new DbArticulo();

            try
            {
                articulo.Ejecutar(String.Format("Update Articulos set Descripcion='{0}',Foto='{1}',Precio={2} where ArticuloId ={3}", this.Descripcion, this.Foto, this.Precio, this.ArticuloId));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Retornar);
        }