示例#1
0
        private void btIncluir_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                TributCofinsCodApuracaoDTO detalheDTO = new TributCofinsCodApuracaoDTO();
                detalheDTO.IdTributConfiguraOfGt = ((TributConfiguraOfGtViewModel)DataContext).TributConfiguraOfGtSelected.Id;

                ((TributConfiguraOfGtViewModel)DataContext).TributCofinsCodApuracaoSelected = detalheDTO;
                TributCofinsCodApuracao viewDetalhe = new TributCofinsCodApuracao();
                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");
            }
        }
示例#2
0
 private void btConsultar_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (((TributConfiguraOfGtViewModel)DataContext).TributCofinsCodApuracaoSelected != null)
         {
             tabDetalhe.IsSelected = true;
             TributCofinsCodApuracao viewDetalhe = new TributCofinsCodApuracao();
             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;
     }
 }