/// <summary>Captura los datos en los textboxs para poder modificar el precio.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> private void buttonModificar_Click(object sender, EventArgs e) { try { ModificarPrecio mod = new ModificarPrecio(textBox1.Text, Int32.Parse(textBox2.Text)); mod.ModificarP(); MessageBox.Show("Insercion de datos exitosa"); Mostrar_Stock mos = new Mostrar_Stock(); dataGridView1.DataSource = mos.MostrarStock(); } catch (ArgumentNullException error) { MessageBox.Show("Complete los datos requeridos." + "\n" + error.ParamName, "Demo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } catch (ArgumentOutOfRangeException error) { MessageBox.Show(error.ParamName, "Demo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } catch (Exception error) { MessageBox.Show("Ha ocurrido un error." + "\n" + "Detalle: " + error.Message, "Demo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } }
private void Mostrar_Stocks_Load(object sender, EventArgs e) { Mostrar_Stock mos = new Mostrar_Stock(); dataGridView1.DataSource = mos.MostrarStock(); }
/// <summary>Captura los datos para hacer la actualizacion del stock.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> private void buttonActualizar_MS_Click(object sender, EventArgs e) { Mostrar_Stock mos = new Mostrar_Stock(); dataGridView1.DataSource = mos.MostrarStock(); }