コード例 #1
0
        /// <summary>
        /// Evento para Editar un registro
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnEditar_Click(object sender, RoutedEventArgs e)
        {
            var botonEditar = (Button)e.Source;

            try
            {
                var problemaSintomaInfoSelecionado =
                    (ProblemaSintomaInfo)Extensor.ClonarInfo(botonEditar.CommandParameter);

                if (problemaSintomaInfoSelecionado != null)
                {
                    ObtenerListaSintomas(problemaSintomaInfoSelecionado);
                    var problemaSintomaEdicion = new ProblemaSintomaEdicion(problemaSintomaInfoSelecionado)
                    {
                        ucTitulo =
                        {
                            TextoTitulo =
                                Properties.Resources.ProblemaSintoma_Editar_Titulo
                        }
                    };
                    MostrarCentrado(problemaSintomaEdicion);
                    ReiniciarValoresPaginador();
                    Buscar();
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal],
                                  Properties.Resources.ProblemaSintoma_ErrorEditar, MessageBoxButton.OK,
                                  MessageImage.Error);
            }
        }
コード例 #2
0
 /// <summary>
 /// Evento para un nuevo registro
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BtnNuevo_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var problemaSintomaEdicion = new ProblemaSintomaEdicion
         {
             ucTitulo =
             {
                 TextoTitulo =
                     Properties.Resources.ProblemaSintoma_Nuevo_Titulo
             }
         };
         MostrarCentrado(problemaSintomaEdicion);
         ReiniciarValoresPaginador();
         Buscar();
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal],
                           Properties.Resources.ProblemaSintoma_ErrorNuevo, MessageBoxButton.OK,
                           MessageImage.Error);
     }
 }