private void cmdAceptar_Click(object sender, EventArgs e) { if (Validar()) { LlenarArticulo(); if (_Opcion == 1) { db.IniciaTrans(); if (Art.AgregarArticulo() >= 1) { if (Art.AddArticulo_LstPrecio() >= 1) { db.TerminaTrans(); MessageBoxAdv.Show("Registro agregado", "Confirmacion", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { db.CancelaTrans(); MessageBoxAdv.Show("Existe un problema al registrar en listas.", "Artículos", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { db.CancelaTrans(); MessageBoxAdv.Show("Existe un problema al guardar.", "Artículos", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else if (_Opcion == 2) { if (Art.ActualizaArticulo() >= 1) { MessageBoxAdv.Show("Registro Actualizado", "Confirmacion", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } } } }
private void cmdAceptar_Click(object sender, EventArgs e) { if (Validar()) { LlenarArticulo(); if (_Opcion == 1) { if (Art.AgregarArticulo() >= 1) { MessageBox.Show("Registro agregado", "Confirmacion", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else if (_Opcion == 2) { if (Art.ActualizaArticulo() >= 1) { MessageBox.Show("Registro Actualizado", "Confirmacion", MessageBoxButtons.OK, MessageBoxIcon.Information); } } this.Close(); } }