//BOTONES

        private void btn_registrar_Click(object sender, EventArgs e)
        {
            if (validar.campoVacio(txt_articulo.Text))
            {
                MessageBox.Show(this, "No hay artículo seleccionado", "ADVERTENCIA", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (validar.campoVacio(txt_precioCoste.Text))
            {
                MessageBox.Show(this, "No ha ingresado precio de coste", "ADVERTENCIA", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (ProveedoresArticulo.esProveedorAsociado(int.Parse(dgv_articulos.CurrentRow.Cells[3].Value.ToString()), int.Parse(cbx_proveedor.SelectedValue.ToString())))
            {
                MessageBox.Show(this, "Ya se encuentra registrado el proveedor para este artículo", "ADVERTENCIA", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (!validar.decimalValido(txt_precioCoste.Text))
            {
                MessageBox.Show(this, "No ha ingresado un precio válido", "ADVERTENCIA", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                tomarDatos();
                ProveedoresArticulo.crear(ProveedoresArticulo);
                MessageBox.Show(this, "Se ha registrado correctamente el proveedor del artículo", "PROVEEDOR ARTICULO", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                groupBox1.Enabled    = true;
                groupBox2.Enabled    = false;
                txt_filtro.Text      = "";
                txt_articulo.Text    = "";
                txt_precioCoste.Text = "";
                cargarDataGrid();
            }
        }
Exemple #2
0
        //BOTONES

        private void btn_actualizar_Click(object sender, EventArgs e)
        {
            if (validar.campoVacio(txt_precio.Text))
            {
                MessageBox.Show(this, "Debe ingresar el precio del artículo", "ADVERTENCIA", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (!validar.decimalValido(txt_precio.Text))
            {
                MessageBox.Show(this, "Debe ingresar el precio de forma correcta", "ADVERTENCIA", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                tomarProveedorArticulo();
                ProveedoresArticulo.actualizar(ProveedoresArticulo);
                MessageBox.Show(this, "Se ha modificado correctamente el artículo del proveedor", "PROVEEDOR ARTICULO", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                groupBox2.Enabled      = false;
                btn_actualizar.Enabled = false;
                groupBox1.Enabled      = true;
                txt_precio.Text        = "";
                txt_filtro.Text        = "";
                cargarDataGrid();
            }
        }
Exemple #3
0
        //METODOS

        public void buscarListaArticuloProveedor()
        {
            ListaProveedoresArticulo.Clear();
            ListaProveedoresArticulo = ProveedoresArticulo.mostrarDatos();
        }