private void btnSetForma_Click(object sender, EventArgs e)
        {
            if (listFormas.Count == 0)
            {
                AbrirDialog("Não há Formas de Cobrança cadastradas ou ativas...", "Formas de Cobrança",
                            DialogType.OK, DialogIcon.Exclamation);
                return;
            }

            var dic     = listFormas.ToDictionary(x => (int)x.IDAPagarForma, x => x.APagarForma);
            var textBox = txtAPagarForma;

            Main.frmComboLista frm = new Main.frmComboLista(dic, textBox, _cartao.IDAPagarForma);

            // show form
            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                _cartao.IDAPagarForma = (int)frm.propEscolha.Key;
                textBox.Text          = frm.propEscolha.Value;
            }

            //--- select
            textBox.Focus();
            textBox.SelectAll();
        }
        // SELECT SITUACAO
        //------------------------------------------------------------------------------------------------------------
        private void btnSetSituacao_Click(object sender, EventArgs e)
        {
            if (Program.lstSituacao == null || Program.lstSituacao.Count == 0)
            {
                AbrirDialog("Não há Situações cadastradas...", "Situações",
                            DialogType.OK, DialogIcon.Exclamation);
                return;
            }

            var dic = Program.lstSituacao.ToDictionary(x => (int)x.IDSituacao, x => x.Situacao);

            Main.frmComboLista frm = new Main.frmComboLista(dic, txtSituacao, IDSituacao);

            // show form
            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                IDSituacao       = (byte)frm.propEscolha.Key;
                txtSituacao.Text = frm.propEscolha.Value;
                ObterDados();
            }

            //--- select
            txtSituacao.Focus();
            txtSituacao.SelectAll();
        }
        private void btnSetCartao_Click(object sender, EventArgs e)
        {
            if (listCartao.Count == 0)
            {
                AbrirDialog("Não há registro de Cartão de Crédito cadastrados...", "Cartão de Crédito",
                            DialogType.OK, DialogIcon.Exclamation);
                return;
            }

            // seleciona o TextBox
            TextBox textBox = txtCartaoCredito;

            var dic = listCartao.ToDictionary(x => (int)x.IDCartaoCredito, x => x.CartaoDescricao);

            Main.frmComboLista frm = new Main.frmComboLista(dic, textBox, _forma.IDCartaoCredito);

            // show form
            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                _forma.IDCartaoCredito = (byte)frm.propEscolha.Key;
                textBox.Text           = frm.propEscolha.Value;
            }

            //--- select
            textBox.Focus();
            textBox.SelectAll();
        }
        private void btnSetModo_Click(object sender, EventArgs e)
        {
            // create dic
            if (dicModo == null)
            {
                dicModo = new Dictionary <int, string>()
                {
                    { 1, "Documento" }, { 2, "Cheque" }, { 3, "Cartao" }
                };
            }

            // seleciona o TextBox
            TextBox textBox = txtPagFormaModo;

            Main.frmComboLista frm = new Main.frmComboLista(dicModo, textBox, _forma.IDCartaoCredito);

            // show form
            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                _forma.IDPagFormaModo = (byte)frm.propEscolha.Key;
                textBox.Text          = frm.propEscolha.Value;
            }

            //--- select
            textBox.Focus();
            textBox.SelectAll();
        }
        private void btnSetBandeira_Click(object sender, EventArgs e)
        {
            if (listBandeiras.Count == 0)
            {
                AbrirDialog("Não há Bandeiras de Cartão cadastradas...", "Bandeiras",
                            DialogType.OK, DialogIcon.Exclamation);
                return;
            }

            // seleciona o TextBox
            TextBox textBox = txtCartaoBandeira;

            var dic = listBandeiras.ToDictionary(x => (int)x.IDCartaoBandeira, x => x.CartaoBandeira);

            Main.frmComboLista frm = new Main.frmComboLista(dic, textBox, _cartao.IDCartaoBandeira);

            // show form
            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                _cartao.IDCartaoBandeira = (byte)frm.propEscolha.Key;
                textBox.Text             = frm.propEscolha.Value;
            }

            //--- select
            textBox.Focus();
            textBox.SelectAll();
        }
        // OPEN CONGREGACAO PROCURA FORM
        //------------------------------------------------------------------------------------------------------------
        private void btnCongregacaoEscolher_Click(object sender, EventArgs e)
        {
            if (congregacaoList.Count == 0)
            {
                AbrirDialog("Não há congregações cadastradas...", "Congregação",
                            DialogType.OK, DialogIcon.Exclamation);
                return;
            }

            var dic = congregacaoList.ToDictionary(x => (int)x.IDCongregacao, x => x.Congregacao);

            Main.frmComboLista frm = new Main.frmComboLista(dic, txtCongregacao, _conta.IDCongregacao);

            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                _conta.IDCongregacao = frm.propEscolha.Key;
                txtCongregacao.Text  = frm.propEscolha.Value;
            }

            //--- select
            txtCongregacao.Focus();
            txtCongregacao.SelectAll();
        }
Esempio n. 7
0
        private void btnSetEstadoCivil_Click(object sender, EventArgs e)
        {
            if (Program.lstEstadoCivil == null || Program.lstEstadoCivil.Count == 0)
            {
                AbrirDialog("Não há Estado Civil cadastrados...", "Estado Civil",
                            DialogType.OK, DialogIcon.Exclamation);
                return;
            }

            var dic = Program.lstEstadoCivil.ToDictionary(x => (int)x.IDEstadoCivil, x => x.EstadoCivil);

            Main.frmComboLista frm = new Main.frmComboLista(dic, txtEstadoCivil, _membro.IDEstadoCivil);

            // show form
            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                _membro.IDEstadoCivil = (byte)frm.propEscolha.Key;
                txtEstadoCivil.Text   = frm.propEscolha.Value;
            }

            //--- select
            txtEstadoCivil.Focus();
            txtEstadoCivil.SelectAll();
        }
        // OPEN BANDEIRA PROCURA LIST
        //------------------------------------------------------------------------------------------------------------
        private void btnSetBandeira_Click(object sender, EventArgs e)
        {
            if (operadoraList.Count == 0)
            {
                AbrirDialog("Não há BANDEIRAS cadastradas...", "BANDEIRAS",
                            DialogType.OK, DialogIcon.Exclamation);
                return;
            }

            var dic = bandeirasList.ToDictionary(x => (int)x.IDCartaoBandeira, x => x.CartaoBandeira);

            Main.frmComboLista frm = new Main.frmComboLista(dic, txtCartaoBandeira, _taxa.IDCartaoBandeira);

            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                if (Sit == EnumFlagEstado.RegistroSalvo)
                {
                    Sit = EnumFlagEstado.Alterado;
                }

                _taxa.IDCartaoBandeira = frm.propEscolha.Key;
                txtCartaoBandeira.Text = frm.propEscolha.Value;
            }

            //--- select
            txtCartaoBandeira.Focus();
            txtCartaoBandeira.SelectAll();
        }
        // OPEN OPERADORA PROCURA LIST
        //------------------------------------------------------------------------------------------------------------
        private void btnSetOperadora_Click(object sender, EventArgs e)
        {
            if (operadoraList.Count == 0)
            {
                AbrirDialog("Não há operadoras cadastradas...", "Operadoras",
                            DialogType.OK, DialogIcon.Exclamation);
                return;
            }

            var dic = operadoraList.ToDictionary(x => (int)x.IDCartaoOperadora, x => x.CartaoOperadora);

            Main.frmComboLista frm = new Main.frmComboLista(dic, txtCartaoOperadora, _taxa.IDCartaoOperadora);

            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                _taxa.IDCartaoOperadora = frm.propEscolha.Key;
                txtCartaoOperadora.Text = frm.propEscolha.Value;
                lblContaProvisoria.Text = operadoraList.First(x => x.IDCartaoOperadora == frm.propEscolha.Key).Conta;
            }

            //--- select
            txtCartaoOperadora.Focus();
            txtCartaoOperadora.SelectAll();
        }
        // OPEN LIST
        //------------------------------------------------------------------------------------------------------------
        private void btnSetMotivo_Click(object sender, EventArgs e)
        {
            if (listMotivos == null || listMotivos.Count == 0)
            {
                AbrirDialog("Não há Motivos de Acréscimo cadastrados...", "Motivos de Acréscimo",
                            DialogType.OK, DialogIcon.Exclamation);
                return;
            }

            var dic = listMotivos.ToDictionary(x => (int)x.IDAcrescimoMotivo, x => x.AcrescimoMotivo);

            Main.frmComboLista frm = new Main.frmComboLista(dic, txtAcrescimoMotivo, _motivo.IDAcrescimoMotivo);

            // show form
            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                _motivo.IDAcrescimoMotivo = (byte)frm.propEscolha.Key;
                _motivo.AcrescimoMotivo   = frm.propEscolha.Value;
                txtAcrescimoMotivo.Text   = frm.propEscolha.Value;
            }

            //--- select
            txtAcrescimoMotivo.Focus();
            txtAcrescimoMotivo.SelectAll();
        }
        // OPEN PROCURA FORM
        //------------------------------------------------------------------------------------------------------------
        private void btnSetCartao_Click(object sender, EventArgs e)
        {
            try
            {
                // --- Ampulheta ON
                Cursor.Current = Cursors.WaitCursor;

                if (ListCartao.Count == 0)
                {
                    AbrirDialog("Não há Cartão de Crédito cadastrados ou ativos...", "Cartão de Crédito",
                                DialogType.OK, DialogIcon.Exclamation);
                    return;
                }

                var dic                = ListCartao.ToDictionary(x => (int)x.IDCartaoCredito, x => x.CartaoDescricao);
                var textBox            = txtCartaoDescricao;
                Main.frmComboLista frm = new Main.frmComboLista(dic, textBox, IDCartaoSelected);

                // show form
                frm.ShowDialog();

                //--- check return
                if ((frm.DialogResult == DialogResult.OK) && (frm.propEscolha.Key != IDCartaoSelected))
                {
                    IDCartaoSelected        = frm.propEscolha.Key;
                    txtCartaoDescricao.Text = frm.propEscolha.Value;
                    ObterDados();
                }

                //--- select
                textBox.Focus();
                textBox.SelectAll();
            }
            catch (Exception ex)
            {
                AbrirDialog("Uma exceção ocorreu ao abrir o formulário de procura..." + "\n" +
                            ex.Message, "Exceção", DialogType.OK, DialogIcon.Exclamation);
            }
            finally
            {
                // --- Ampulheta OFF
                Cursor.Current = Cursors.Default;
            }
        }
Esempio n. 12
0
        // OPEN LIST
        //------------------------------------------------------------------------------------------------------------
        private void btnSetPeriodicidade_Click(object sender, EventArgs e)
        {
            // seleciona o TextBox
            TextBox textBox = txtPeriodicidade;

            Main.frmComboLista frm = new Main.frmComboLista(dicPeriodicidade, textBox, _tipo.Periodicidade);

            // show form
            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                _tipo.Periodicidade = (byte)frm.propEscolha.Key;
                textBox.Text        = frm.propEscolha.Value;
            }

            //--- select
            textBox.Focus();
            textBox.SelectAll();
        }
        // OPEN LIST
        //------------------------------------------------------------------------------------------------------------
        private void btnSetCredor_Click(object sender, EventArgs e)
        {
            // seleciona o TextBox
            TextBox textBox = txtCredorTipo;

            Main.frmComboLista frm = new Main.frmComboLista(dicTipo, textBox, _credor.IDCredorTipo);

            // show form
            frm.ShowDialog();

            //--- check return
            if (frm.DialogResult == DialogResult.OK)
            {
                _credor.IDCredorTipo = (byte)frm.propEscolha.Key;
                textBox.Text         = frm.propEscolha.Value;
                CheckCredorTipo();
            }

            //--- select
            textBox.Focus();
            textBox.SelectAll();
        }