Exemplo n.º 1
0
        private void click_agregar(Object sender, EventArgs e, Button but_modificar, Button button_eliminar, TextBox text_codigo, TextBox text_nombre, TextBox text_nombre_proveedores, TextBox text_precio_costo, TextBox text_venta)
        {
            CatalogoProducto lstCatalago = new CatalogoProducto();

            if (lstCatalago.treaerXID(int.Parse(text_codigo.Text)) != null)
            {
                MessageBox.Show("el id ya existe");
            }
            else
            {
                but_modificar.Enabled     = true;
                text_nombre.Enabled       = true;
                text_precio_costo.Enabled = true;
                text_venta.Enabled        = true;
            }
        }
Exemplo n.º 2
0
        private void click_buscar(Object sender, EventArgs e, Button but_agregar, Button but_modificar, Button but_eliminar, TextBox text_codigo, TextBox text_nombre, TextBox text_nombre_proveedores, TextBox text_precio_costo, TextBox text_venta)
        {
            CatalogoProducto lstCatalago = new CatalogoProducto();
            Producto         producto    = lstCatalago.treaerXID(int.Parse(text_codigo.Text));

            if (producto == null)
            {
                MessageBox.Show("el producto no existe");
            }
            else
            {
                text_nombre.Enabled       = true;
                text_precio_costo.Enabled = true;
                text_venta.Enabled        = true;

                text_nombre.Text       = producto.getProducto();
                text_precio_costo.Text = producto.getPrecioCosto().ToString();
                text_venta.Text        = producto.getPrecioVenta().ToString();
            }
            but_agregar.Enabled   = true;
            but_modificar.Enabled = true;
            but_eliminar.Enabled  = true;
        }