private void AgregarDetalle() { try { var frm = new MntCompraDetalleForm(ViewModel.CompraId, ViewModel.CompraDetalleViewModels); frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(string.Format("Ocurrió un error al agregar, mensaje de error: {0}", ex.Message) , "Agregar", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ModificarDetalle() { try { var viewModel = (CompraDetalleViewModel)compraDetalleViewModelsBindingSource.Current; var frm = new MntCompraDetalleForm(viewModel, ViewModel.CompraDetalleViewModels); frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(string.Format("Ocurrió un error al modificar, mensaje de error: {0}", ex.Message) , "Modificar", MessageBoxButtons.OK, MessageBoxIcon.Error); } }