public override void CargarDatos(int?entidadId) { // Instancion por medio del Inyector el Objeto Grupo vacuna = ObjectFactory.GetInstance <Dominio.DatosPaciente.Entidades.Vacuna>(); if (entidadId.HasValue) { vacuna = datosPacienteUoW.VacunaRepositorio.ObtenerPorId(entidadId.Value); this.txtAbreviatura.Text = vacuna.Abreviatura; this.txtVacuna.Text = vacuna.Nombre; } else { Mensaje.Mostrar(new Exception("Error al cargar los Datos"), Constantes.TipoMensaje.Error); } }
public override void NuevoRegistro() { try { vacuna = ObjectFactory.GetInstance <Dominio.DatosPaciente.Entidades.Vacuna>(); vacuna.Abreviatura = this.txtAbreviatura.Text; vacuna.Nombre = this.txtVacuna.Text; datosPacienteUoW.VacunaRepositorio.Insertar(vacuna); datosPacienteUoW.Commit(); this.txtAbreviatura.Focus(); } catch (Exception ex) { Mensaje.Mostrar(ex, Constantes.TipoMensaje.Error); } }