示例#1
0
        private void SelecionarTipoMov()
        {
            PesquisarTmv pt = new PesquisarTmv();

            pt.ShowDialog();

            if (pt.Selecionado.Id == 0)
            {
                MessageBox.Show("O tipo de movimento deve ser selecionado antes de iniciar a operação!", "Atenção", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                SelecionarTipoMov();
            }
            else
            {
                txCod_tipo.Text  = pt.Selecionado.Id.ToString();
                txNome_tipo.Text = pt.Selecionado.Descricao;

                if (pt.Selecionado.Cfop == 0)
                {
                    BStatus.Alert("O tipo de movimento selecionado não possui CFOP. Não será permitido emitir NFC-e.");
                }
                else
                {
                    BStatus.Success("Tipo de movimento OK");
                }

                btNFCe.IsEnabled = (pt.Selecionado.Cfop != 0);
                txCfop.Text      = pt.Selecionado.Cfop.ToString();

                lbCliente_fornecedor.Content = (pt.Selecionado.Utiliza_fornecedor
                     ? "Fornecedor"
                     : "Cliente");

                Tipo_movimento = pt.Selecionado;
            }
        }
        private void btSelecionarMovDevolucao_Click(object sender, RoutedEventArgs e)
        {
            PesquisarTmv pt = new PesquisarTmv();

            pt.ShowDialog();

            txCod_movDevol.Text   = pt.Selecionado.Id.ToString();
            txMovimentoDevol.Text = (pt.Selecionado.Id == 0
                ? "Não selecionado"
                : pt.Selecionado.Descricao);
        }