Beispiel #1
0
        private void btnPesquisarClientee_Click(object sender, EventArgs e)
        {
            {
                // abre o form dentro do form
                form_ConsCliente Form_Cad = new form_ConsCliente();
                Form_Cad.ShowInTaskbar = false;
                Form_Cad.StartPosition = FormStartPosition.CenterParent;
                Form_Cad.ShowDialog(ActiveForm);

                if (Form_Cad.codigo != 0)
                {
                    ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                    ClienteBLL bll     = new ClienteBLL(conexao);
                    ClienteDTO cli     = bll.CarregaClienteDTO(Form_Cad.codigo);
                    ani_clienteTextBox.Text     = cli.Cli_id.ToString();
                    ani_clienteNomeTextBox.Text = cli.Cli_nome.ToString();
                }
                else
                {
                    this.LimpaTela();
                    this.alterarBotoes(1);
                }

                //encerra form
                Form_Cad.Dispose();
            }
        }
Beispiel #2
0
        // BOTÕES DE CONSULTA - MENU PRINCIPAL
        private void btnConsCliente_Click(object sender, EventArgs e)
        {
            this.IsMdiContainer = true;
            form_ConsCliente Form_Cad = new form_ConsCliente();

            Form_Cad.MdiParent = this;
            Form_Cad.Show();

            foreach (Control ct in this.Controls)
            {
                if (ct.GetType().Name == "MdiClient")
                {
                    ct.BackColor = Color.FromName("WhiteSmoke");
                }
                //   ct.BackColor = Color.Empty;
            }
        }
Beispiel #3
0
        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            // abre o form dentro do form
            form_ConsCliente Form_Cad = new form_ConsCliente();

            Form_Cad.ShowInTaskbar = false;
            Form_Cad.StartPosition = FormStartPosition.CenterParent;
            Form_Cad.ShowDialog(ActiveForm);

            if (Form_Cad.codigo != 0)
            {
                ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                ClienteBLL bll     = new ClienteBLL(conexao);
                ClienteDTO cli     = bll.CarregaClienteDTO(Form_Cad.codigo);
                cli_idTextBox.Text               = cli.Cli_id.ToString();
                cli_nomeTextBox.Text             = cli.Cli_nome;
                cli_cpfTextBox.Text              = cli.Cli_cpf;
                cli_telefoneTextBox.Text         = cli.Cli_telefone;
                cli_celularTextBox.Text          = cli.Cli_celular;
                cli_emailTextBox.Text            = cli.Cli_email;
                cli_logradouroTextBox.Text       = cli.Cli_logradouro;
                cli_numeroTextBox.Text           = cli.Cli_numero;
                cli_complementoTextBox.Text      = cli.Cli_complemento;
                cli_bairroTextBox.Text           = cli.Cli_bairro.ToString();
                cli_cidadeComboBox.SelectedValue = cli.Cli_cidade;
                cli_estadoComboBox.SelectedValue = cli.Cli_estado;
                cli_cadastroDateTimePicker.Value = cli.Cli_cadastro;

                alterarBotoes(3);
            }
            else
            {
                this.LimpaTela();
                this.alterarBotoes(1);
            }

            //encerra form
            Form_Cad.Dispose();
        }