private void BtnGrabar_OnClick(object sender, RoutedEventArgs e) { try { Cursor = Cursors.Wait; _alumnoClass.Grabar(_alumno); MessageBox.Show(@"Registro guardado correctamente", Title, MessageBoxButton.OK, MessageBoxImage.Information); BtnNuevo.RaiseEvent(e); BtnListar.RaiseEvent(e); } catch (Exception ex) { MessageBox.Show(ex.Message, Title, MessageBoxButton.OK, MessageBoxImage.Error); } finally { Cursor = Cursors.Arrow; } }
private void btnGrabar_Click(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; alumnoBindingSource.EndEdit(); _alumnoClass.Grabar(_alumno); MessageBox.Show(@"Registro guardado correctamente", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); btnListar.PerformClick(); } catch (Exception ex) { MessageBox.Show(ex.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } finally { Cursor = Cursors.Default; } }