Пример #1
0
        private void BuscarFormaPag()
        {
            txValor.IsEnabled = false;
            txCod_fpg.Focus();

            PesquisarFormas_pag pg = new PesquisarFormas_pag();

            pg.ShowDialog();

            txCod_fpg.Text   = pg.Selecionado.Id.ToString();
            txForma_pag.Text = (pg.Selecionado.Id == 0
                ? "Não selecionado"
                : pg.Selecionado.Descricao);

            if (pg.Selecionado.Id > 0)
            {
                txValor.IsEnabled = true;
                txValor.Focus();
            }

            if (Itens_pagamento.FirstOrDefault(i => i.Forma_pagamento_id == pg.Selecionado.Id) != null)
            {
                txForma_pag.Text  = "Condição já informada.";
                txValor.IsEnabled = false;
            }
        }
Пример #2
0
        private void btSelecionar_forma_pagamento_Click(object sender, RoutedEventArgs e)
        {
            PesquisarFormas_pag pfg = new PesquisarFormas_pag();

            pfg.ShowDialog();

            if (pfg.Selecionado.Id > 0)
            {
                if (pfg.Selecionado.Tipo_pagamento != (int)Tipo_pagamento.DINHEIRO)
                {
                    MessageBox.Show("A condição de pagamento para movimentações de caixa deve ser do tipo 'DINHEIRO'", "Condição de pagamento inválida", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }

                txCod_forma_pagamento.Text       = pfg.Selecionado.Id.ToString();
                txDescricao_forma_pagamento.Text = pfg.Selecionado.Descricao;
                txValor_movimentacao.Focus();
            }
        }