Professional Documents
Culture Documents
Script C#
Script C#
comand.ExecuteNonQuery();
bd.cerrarBD();
}
//EN EL FORMULARIO
//deben de poner un boton foto
private void btnfoto_Click(object sender, EventArgs e)
{
try
{
openFileDialog1.ShowDialog();
if (openFileDialog1.FileName.Equals("") == false)
{
pctFoto.Load(this.openFileDialog1.FileName);
}
}
catch (Exception ex)
{
MessageBox.Show("No se pudo cargar la imagen: " +
ex.ToString());
}
//en el boton agregar
private void btnAgregar_Click(object sender, EventArgs e)
{
metodosABC.AgregarRegistros(txtCodMed.Text, txtNomMed.Text,
cboProv.SelectedValue.ToString(), cboCat.Text,
Int32.Parse(txtCant.Text),
float.Parse(txtPrecio.Text),pctFoto, Int32.Parse(txtStock.Text));
MessageBox.Show("Datos guardados");
txtCant.Text = "0";
txtCodMed.Text = "";
txtNomMed.Text = "";
txtPrecio.Text = "0";
txtStock.Text = "0";
txtCodMed.Focus();
}