private void Execute_AgregarCommand() { RegistrarHistorialView registrarHistorialView = new RegistrarHistorialView(false, null, ConductoresViewModel.Instance.ListaConductores, UnidadVehicularViewModel.Instance.ListaUnidadesVehiculares); registrarHistorialView.ShowDialog(); if (registrarHistorialView.isRegistered) { var newHistorial = registrarHistorialView.GetHistorial(); //newHistorial.Id = ListaHistoriales. try { //Primero se lo paso a la capa negocio para que lo registre, si lo registra, lo pongo en la capa Presentacion if (TransporteDR.HistorialBO.Registrar(newHistorial)) { LoadData(); CurrentHistorial = ListaHistoriales.FirstOrDefault(x => x.Id == newHistorial.Id); MessageBox.Show($"{newHistorial.Id} Registrado con exito"); } else { MessageBox.Show("Algo ha ocurrIdo con el proceso de registro, por favor intentar de nuevo o reiniciar el computador.\nSi el problema persiste, contactar con el encargado del Sistema"); } } catch (Exception ex) { MessageBox.Show(ex.Message); if (!(ex.InnerException is null)) { MessageBox.Show(ex.InnerException.Message); } } } /*if (registrarPersonaView.isRegistered) * { * listaPersonas.Add(registrarPersonaView.GetPersona()); * } * * //MessageBox.Show("Agregar persona View");*/ }