Esempio n. 1
0
        private void Producto_Load(object sender, EventArgs e)
        {
            dataGridViewProducto.DataSource = ObjetoProductoLN.MostrarProducto();
            comboBoxIDProducto.KeyPress    += new KeyPressEventHandler(ValidarCodigo);
            textBoxPrecioCosto.KeyPress    += new KeyPressEventHandler(ValidarPrecioCosto);
            textBoxPrecioVenta.KeyPress    += new KeyPressEventHandler(ValidarPrecioVenta);
            textBoxTamaño.KeyPress         += new KeyPressEventHandler(ValidarTamaño);
            textBoxStockMinimo.KeyPress    += new KeyPressEventHandler(ValidarStockMinimo);

            comboBoxRubro.DataSource    = ObjetoProductoLN.LlenarComboRubro();
            comboBoxRubro.DisplayMember = "NombreRubro";

            comboBoxTipodesc.DataSource    = ObjetoProductoLN.LlenarComboTipo();
            comboBoxTipodesc.DisplayMember = "NombreTipo";

            comboBoxMarcadesc.DataSource    = ObjetoProductoLN.LlenarComboMarca();
            comboBoxMarcadesc.DisplayMember = "NombreMarca";

            comboBoxDetalledesc.DataSource    = ObjetoProductoLN.LlenarComboDetalle();
            comboBoxDetalledesc.DisplayMember = "NombreDetalle";

            comboBoxSabordesc.DataSource    = ObjetoProductoLN.LlenarComboSabor();
            comboBoxSabordesc.DisplayMember = "NombreSabor";

            comboBoxEnvasedesc.DataSource    = ObjetoProductoLN.LlenarComboEnvase();
            comboBoxEnvasedesc.DisplayMember = "NombreEnvase";

            comboBoxIDProducto.DataSource    = ObjetoProductoLN.TraerUltimoNumeroProducto();
            comboBoxIDProducto.DisplayMember = "IDProducto";

            buttonModificar.Enabled = false;
            buttonEliminar.Enabled  = false;
        }