public Boolean BuscarIdCategoria(string id)
        {
            DataTable t1 = conexion.consulta(string.Format("SELECT idCategoria, nombre, descripcion FROM taller.categoria where idcategoria= '{0}'", id));

            if (t1.Rows.Count > 0)
            {
                IdCategoria = Convert.ToInt32(t1.Rows[0][0].ToString());
                Nombre      = t1.Rows[0][1].ToString();
                Descripcion = t1.Rows[0][2].ToString();
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#2
0
        public Boolean BuscarProducto(string id)
        {
            DataTable t1 = conexion.consulta(string.Format("SELECT idInventario, producto, existencia, precio, precioVenta FROM taller.inventario where producto='{0}'", id));

            if (t1.Rows.Count > 0)
            {
                idInventario = Convert.ToInt32(t1.Rows[0][0].ToString());
                producto     = t1.Rows[0][1].ToString();
                existencia   = Convert.ToInt32(t1.Rows[0][2].ToString());
                precio       = Convert.ToInt32(t1.Rows[0][3].ToString());
                return(true);
            }
            else
            {
                return(false);
            }
        }