Example #1
0
        private void btIncluir_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                PontoTurmaDTO detalheDTO = new PontoTurmaDTO();
                detalheDTO.IdPontoEscala = ((PontoEscalaViewModel)DataContext).PontoEscalaSelected.Id;

                ((PontoEscalaViewModel)DataContext).PontoTurmaSelected = detalheDTO;
                PontoTurma viewDetalhe = new PontoTurma();
                viewDetalhe.btSair.Click   += new RoutedEventHandler(btSair_Click);
                viewDetalhe.btGravar.Click += new RoutedEventHandler(btGravar_Click);
                tabDetalhe.Content          = viewDetalhe;
                tabDetalhe.IsSelected       = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Alerta do sistema");
            }
        }
Example #2
0
 private void btConsultar_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (((PontoEscalaViewModel)DataContext).PontoTurmaSelected != null)
         {
             tabDetalhe.IsSelected = true;
             PontoTurma viewDetalhe = new PontoTurma();
             viewDetalhe.btSair.Click   += new RoutedEventHandler(btSair_Click);
             viewDetalhe.btGravar.Click += new RoutedEventHandler(btGravar_Click);
             tabDetalhe.Content          = viewDetalhe;
         }
         else
         {
             MessageBox.Show("Selecione um elemento na lista.", "Alerta do sistema");
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }