private void btnCrear_Click(object sender, EventArgs e) { try { if (ValidarExistenciaDeUbicaciones() && ValidarExistenciaDeFechas() && ValidarFechaDeVencimiento() && ValidarFechaDePublicacion() && this.validator.Validate()) { IList <Publicacion> publicaciones = this.CrearListaDePublicaciones(); foreach (Publicacion publicacion in publicaciones) { decimal codPublicacionNueva = publicacionRepository.CrearPublicacion(publicacion); IList <UbicacionPersistente> ubicaciones = this.CrearListaDeUbicaciones(codPublicacionNueva); ubicacionRepository.InsertarListaDeUbicaciones(ubicaciones); } MessageBoxUtil.ShowInfo("Publicación creada correctamente."); NavigableFormUtil.BackwardTo(this, previousForm); } } catch (StoredProcedureException) { MessageBoxUtil.ShowError("Error al generar la publicacion."); } }