private void GuardarButton_Click_1(object sender, EventArgs e) { if (_ViewModel.IsValid()) { try { _ViewModel.Edit(); _OnEditSuccess(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show(_ViewModel.ErrorMessage); } }
private void GuardarButton_Click(object sender, EventArgs e) { if (_ViewModel.IsValid()) { try { _ViewModel.Add(); _OnAddSuccess(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show(_ViewModel.ErrorMessage, "Nombre Incorrecto"); } }