/*<FUNCAO>*/
        private bool AtualizarFuncionario()
        {
            bool ret = false;

            ConexaoDAL cx = new ConexaoDAL(DadosConexao.StringDeConexao);

            CarregarIndiceComboEstado(this.cbboxATLFunEstado.SelectedItem.ToString());
            fcAtMd.Cidade      = txtATLFunCidade.Text;
            fcAtMd.Bairro      = txtATLFunBairro.Text;
            fcAtMd.Logradouro  = txtATLFunLog.Text;
            fcAtMd.NumeroEnd   = txtATLFunNum.Text;
            fcAtMd.Nome        = txtATLFunNome.Text;
            fcAtMd.NumeroTel   = txtATLFunTel.Text;
            fcAtMd.NumeroCel   = txtATLFunCel.Text;
            fcAtMd.Login       = txtATLFunLogin.Text;
            fcAtMd.Aniversario = Convert.ToDateTime(dtATLFunAniversario.Text);
            CarregarIndiceComboPerfil(this.cbboxATLFunPerfil.SelectedItem.ToString());
            fcAtMd.IDEmpresa = Convert.ToInt32(cbboxATLFunEmpresa.SelectedValue.ToString());

            FuncionarioBLL fcbll = new FuncionarioBLL(cx);

            if (fcbll.AtualizarFuncionario(fcAtMd))
            {
                valor             = 0;
                this.DialogResult = DialogResult.OK;
            }

            return(ret);
        }
Exemplo n.º 2
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            try
            {
                //leitura dos dados
                VacinaDTO vac = new VacinaDTO();

                //   vac.Vac_vacina = vac_vacinaTextBox.Text;


                //obj para gravar dados no bd
                ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                VacinaBLL  bll     = new VacinaBLL(conexao);

                if (this.operacao == "inserir")
                {
                    bll.Incluir(vac);

                    MessageBox.Show("Cadastrado com Sucesso: Código: " + vac.Vac_id.ToString());
                    // this.LimpaTela();
                }
                else // alterar
                {
                    vac.Vac_id = Convert.ToInt32(vac_idTextBox.Text);
                    bll.Alterar(vac);
                    MessageBox.Show("Cadastrado Alterado com Sucesso: Código: " + vac.Vac_id.ToString());
                }
                this.LimpaTela();
                this.alterarBotoes(1);
            }//try
            catch (Exception erro)
            {
                MessageBox.Show(erro.Message);
            }
        }
Exemplo n.º 3
0
        private void btnSalvarAT_Click(object sender, EventArgs e)
        {
            try
            {
                //leitura dos dados
                TipoAtendimentoDTO tip = new TipoAtendimentoDTO()
                {
                    Tpa_atendimento = tpa_descriçaoTextBox.Text
                };

                //obj para gravar dados no bd
                ConexaoDAL         conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                TipoAtendimentoBLL bll     = new TipoAtendimentoBLL(conexao);

                if (this.operacao == "inserir")
                {
                    bll.Incluir(tip);

                    MessageBox.Show("Cadastrado com Sucesso: Código: " + tip.Tpa_id.ToString());
                }
                else // alterar
                {
                    tip.Tpa_id = Convert.ToInt32(tpp_idTextBox.Text);
                    bll.Alterar(tip);
                    MessageBox.Show("Cadastrado Alterado com Sucesso: Código: " + tip.Tpa_id.ToString());
                }
                this.LimpaTelaAT();
                this.alterarBotoesAT(1);
            }//try
            catch (Exception erro)
            {
                MessageBox.Show(erro.Message);
            }
        }
Exemplo n.º 4
0
        private void btnPesquisarAT_Click(object sender, EventArgs e)
        {
            // abre o form dentro do form
            form_ConsTipoAtendimento Form_Cad = new form_ConsTipoAtendimento()
            {
                ShowInTaskbar = false,
                StartPosition = FormStartPosition.CenterParent
            };

            Form_Cad.ShowDialog(ActiveForm);

            if (Form_Cad.codigo != 0)
            {
                ConexaoDAL         conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                TipoAtendimentoBLL bll     = new TipoAtendimentoBLL(conexao);
                //    TipoAtendimentoDTO tpa = bll.CarregaTipoAtendimentoDTO(Form_Cad.codigo);
                //    tpp_idTextBox.Text = tpa.Tpa_id.ToString();
                //    tpp_descriçaoTextBox.Text = tpa.Tpa_atendimento;
                alterarBotoesAT(3);
            }
            else
            {
                this.LimpaTelaAT();
                this.alterarBotoesAT(1);
            }

            //encerra form
            Form_Cad.Dispose();
        }
Exemplo n.º 5
0
        private void form_ConsTipoExame_Load(object sender, EventArgs e)
        {
            ConexaoDAL   conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
            TipoExameBLL bll     = new TipoExameBLL(conexao);

            dgv_tipoe.DataSource = bll.Pesquisar(txtValor.Text);
        }
Exemplo n.º 6
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();
            }
        }
Exemplo n.º 7
0
        private void btnPesquisarATSU_Click(object sender, EventArgs e)
        {
            // abre o form dentro do form
            form_ConsAtendimento Form_Cad = new form_ConsAtendimento();

            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);
                AtendimentoBLL bll     = new AtendimentoBLL(conexao);
                AtendimentoDTO ate     = bll.CarregaAtendimentoDTO(Form_Cad.codigo);

                ClienteBLL cbll = new ClienteBLL(conexao);

                //Verificar se OK
                sus_atendimentoTextBox.Text = ate.Ate_id.ToString();

                AlterarBotoesSU(3);
            }
            else
            {
                this.LimpaTelaSU();
                this.AlterarBotoesSU(1);
            }

            //encerra form
            Form_Cad.Dispose();
        }
Exemplo n.º 8
0
        private void form_CadUsuario_Load(object sender, EventArgs e)
        {
            this.alterarBotoes(1);

            ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
            //cb cidade
            CidadeBLL cidbll = new CidadeBLL(conexao);

            usr_cidadeComboBox.DataSource    = cidbll.Pesquisar("");
            usr_cidadeComboBox.DisplayMember = "cid_descriçao";
            usr_cidadeComboBox.ValueMember   = "cid_id";
            //cb estado
            EstadoBLL estbll = new EstadoBLL(conexao);

            usr_estadoComboBox.DataSource    = estbll.Pesquisar("");
            usr_estadoComboBox.DisplayMember = "est_descriçao";
            usr_estadoComboBox.ValueMember   = "est_id";
            //cb cargo
            CargoBLL carbll = new CargoBLL(conexao);

            usr_cargoComboBox.DataSource    = carbll.Pesquisar("");
            usr_cargoComboBox.DisplayMember = "car_cargo";
            usr_cargoComboBox.ValueMember   = "car_id";

            this.LimpaTela();
        }
Exemplo n.º 9
0
        //------CONFIG DE EXIBIÇÃO DO DGV ------//
        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
            EspecieBLL bll     = new EspecieBLL(conexao);

            dgv_esp.DataSource = bll.Pesquisar(txtValor.Text);
        }
Exemplo n.º 10
0
        private void btnSalvarAP_Click(object sender, EventArgs e)
        {
            try
            {
                //leitura dos dados
                AplicaçaoDTO apl = new AplicaçaoDTO()
                {
                    Apl_descriçao = apl_descriçaoTextBox.Text
                };

                //obj para gravar dados no bd
                ConexaoDAL   conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                AplicaçaoBLL bll     = new AplicaçaoBLL(conexao);

                if (this.operacao == "inserir")
                {
                    bll.Incluir(apl);

                    MessageBox.Show("Cadastrado com Sucesso: Código: " + apl.Apl_id.ToString());
                    // this.LimpaTela();
                }
                else // alterar
                {
                    apl.Apl_id = Convert.ToInt32(apl_idTextBox.Text);
                    bll.Alterar(apl);
                    MessageBox.Show("Cadastrado Alterado com Sucesso: Código: " + apl.Apl_id.ToString());
                }
                this.LimpaTelaAP();
                this.alterarBotoesAP(1);
            }//try
            catch (Exception erro)
            {
                MessageBox.Show(erro.Message);
            }
        }
Exemplo n.º 11
0
        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            ConexaoDAL       conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
            TipoProtocoloBLL bll     = new TipoProtocoloBLL(conexao);

            dgv_prot.DataSource = bll.Pesquisar(txtValor.Text);
        }
Exemplo n.º 12
0
        }//salvar

        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            // abre o form dentro do form
            form_ConsRaça Form_Cad = new form_ConsRaça();

            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);
                RaçaBLL    bll     = new RaçaBLL(conexao);
                RaçaDTO    raça    = bll.CarregaRaçaDTO(Form_Cad.codigo);
                raç_idTextBox.Text        = raça.Raç_id.ToString();
                raç_descriçaoTextBox.Text = raça.Raç_descriçao;
                alterarBotoes(3);
            }
            else
            {
                this.LimpaTela();
                this.alterarBotoes(1);
            }

            //encerra form
            Form_Cad.Dispose();
        }
Exemplo n.º 13
0
        private void btnPesquisarTPE_Click(object sender, EventArgs e)
        {
            // abre o form dentro do form
            form_ConsTipoExame Form_Cad = new form_ConsTipoExame()
            {
                ShowInTaskbar = false,
                StartPosition = FormStartPosition.CenterParent
            };

            Form_Cad.ShowDialog(ActiveForm);

            if (Form_Cad.codigo != 0)
            {
                ConexaoDAL   conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                TipoExameBLL bll     = new TipoExameBLL(conexao);
                TipoExameDTO tip     = bll.CarregaTipoExameDTO(Form_Cad.codigo);
                tpe_idTextBox.Text        = tip.Tpe_id.ToString();
                tpa_descriçaoTextBox.Text = tip.Tpe_descriçao;
                alterarBotoesEX(3);
            }
            else
            {
                this.LimpaTelaEX();
                this.alterarBotoesEX(1);
            }

            //encerra form
            Form_Cad.Dispose();
        }
Exemplo n.º 14
0
        //-------- LOAD DO FORM + INICIA CONFIG BOTOES --------------//
        private void Form_CadMedico_Load(object sender, EventArgs e)
        {
            //----------INICIA CONFIG BOTOES ---------------- //

            this.AlterarBotoes(1);

            this.LimpaTela();

            // IMPORTANTE !!! - sem isso não carrega os cbox /// !!!!!!!!!!!!!! Tem q criar os blls, dtos, dal para cada item se n n mostra
            ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
            //cb cidade
            CidadeBLL cidbll = new CidadeBLL(conexao);

            med_cidadeComboBox.DataSource    = cidbll.Pesquisar("");
            med_cidadeComboBox.DisplayMember = "cid_descriçao";
            med_cidadeComboBox.ValueMember   = "cid_id";
            //cb estado
            EstadoBLL estbll = new EstadoBLL(conexao);

            med_estadoComboBox.DataSource    = estbll.Pesquisar("");
            med_estadoComboBox.DisplayMember = "est_descriçao";
            med_estadoComboBox.ValueMember   = "est_id";
            //cb estado
            EspecialidadeBLL especbll = new EspecialidadeBLL(conexao);

            med_especialidadeComboBox.DataSource    = especbll.Pesquisar("");
            med_especialidadeComboBox.DisplayMember = "espec_descriçao";
            med_especialidadeComboBox.ValueMember   = "espec_id";
        }
Exemplo n.º 15
0
        /*</OBJETO>**/

        /*<FUNCAO>**/
        private bool AtualizarEmpresa()
        {
            bool ret = false;

            ConexaoDAL cx = new ConexaoDAL(DadosConexao.StringDeConexao);

            EmpAtMd.IDPessoa = Convert.ToInt32(cbboxATLEmpResp.SelectedValue.ToString());
            CarregarIndiceComboEstado(this.cbboxATLEmpEstado.SelectedItem.ToString());
            EmpAtMd.Cidade     = txtATLEmpCidade.Text;
            EmpAtMd.Bairro     = txtATLEmpBairro.Text;
            EmpAtMd.Logradouro = txtATLEmpLog.Text;
            EmpAtMd.NumeroEnd  = txtATLEmpNum.Text;
            EmpAtMd.Razao      = txtATLEmpRazao.Text;
            EmpAtMd.NumeroCom  = txtATLEmpTel.Text;
            EmpAtMd.NumeroFax  = txtATLEmpFax.Text;

            EmpresaBLL fcbll = new EmpresaBLL(cx);

            if (fcbll.AtualizarEmpresa(EmpAtMd))
            {
                if (MeusFormularios.PDSSForm == null)
                {
                    MeusFormularios.PDSSForm = new PadroesSistemaForm();
                }

                MeusFormularios.PDSSForm.Show();
                MeusFormularios.PDSSForm.Focus();

                ret = true;
            }

            return(ret);
        }
        private void CarregarTabelaSubCategoria()
        {
            ConexaoDAL      cx        = new ConexaoDAL(DadosConexao.StringDeConexao);
            SubCategoriaBLL SubCatBLL = new SubCategoriaBLL(cx);

            dtgrMDCADSubCategoria.DataSource = SubCatBLL.DtgrSubCategoria();
            this.ColunaTabelaTM();
        }
        public AtualizarFuncionarioForm(string @login = null, string @nome = null, int @indice = 0)
        {
            InitializeComponent();

            ConexaoDAL     cx    = new ConexaoDAL(DadosConexao.StringDeConexao);
            FuncionarioBLL fcbll = new FuncionarioBLL(cx);

            this.CarregarCampos(fcbll.ParametrosAtualizaFunForm(@login, @nome, @indice));
        }
Exemplo n.º 18
0
        public AtualizarEmpresaForm(string @razao, int @indice)
        {
            InitializeComponent();

            ConexaoDAL cx     = new ConexaoDAL(DadosConexao.StringDeConexao);
            EmpresaBLL Empbll = new EmpresaBLL(cx);

            this.CarregarCampos(Empbll.ParametrosAtualizaEmpForm(@razao, @indice));
        }
Exemplo n.º 19
0
        private void CarregarComboPessoa(int id = 0)
        {
            ConexaoDAL cx     = new ConexaoDAL(DadosConexao.StringDeConexao);
            EmpresaBLL empBLL = new EmpresaBLL(cx);

            cbboxATLEmpResp.DataSource    = empBLL.LocalizarPessoa("ATLEMPFORM", id);
            cbboxATLEmpResp.DisplayMember = "nome";
            cbboxATLEmpResp.ValueMember   = "id_pessoa";
        }
Exemplo n.º 20
0
        private bool CriarOuAtualizarCliente()
        {
            bool ret = false;

            ConexaoDAL cx = new ConexaoDAL(DadosConexao.StringDeConexao);

            CarregarIndiceComboEstado(this.cbboxCADATLClienteEstado.SelectedItem.ToString());
            CliAtMd.Aniversario = Convert.ToDateTime(dtATLCliAniversario.Text);
            CliAtMd.Cidade      = txtCADATLClienteCidade.Text;
            CliAtMd.Bairro      = txtCADATLClienteBairro.Text;
            CliAtMd.Logradouro  = txtCADATLClienteLog.Text;
            CliAtMd.NumeroEnd   = txtCADATLClienteNum.Text;
            CliAtMd.Nome        = txtCADATLClienteNome.Text;
            CliAtMd.NumeroTel   = txtCADATLClienteTel.Text;
            CliAtMd.NumeroCel   = txtCADATLClienteCel.Text;

            ClienteBLL Clibll = new ClienteBLL(cx);


            if (@validar == "ATUALIZAR")
            {
                if (Clibll.AtualizarCliente(CliAtMd))
                {
                    @validar  = null;
                    @operacao = 0;
                    this.LimparCampos();
                    this.AlterarCampos();
                    this.DialogResult = DialogResult.OK;
                }
            }
            else
            {
                ClienteInModelo CliInMd = new ClienteInModelo();

                CliInMd.Nome        = CliAtMd.Nome;
                CliInMd.Estado      = CliAtMd.Estado;
                CliInMd.Aniversario = CliAtMd.Aniversario;
                CliInMd.Cidade      = CliAtMd.Cidade;
                CliInMd.Bairro      = CliAtMd.Bairro;
                CliInMd.Logradouro  = CliAtMd.Logradouro;
                CliInMd.NumeroEnd   = CliAtMd.NumeroEnd;
                CliInMd.NumeroTel   = CliAtMd.NumeroTel;
                CliInMd.NumeroCel   = CliAtMd.NumeroCel;

                if (Clibll.IncluirCliente(CliInMd, @validar))
                {
                    @validar  = null;
                    @operacao = 0;
                    this.LimparCampos();
                    this.AlterarCampos();
                    this.DialogResult = DialogResult.OK;
                }
            }

            return(ret);
        }
Exemplo n.º 21
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            try
            {
                //leitura dos dados
                ClienteDTO cli = new ClienteDTO();

                cli.Cli_nome        = cli_nomeTextBox.Text;
                cli.Cli_cpf         = cli_cpfTextBox.Text;
                cli.Cli_telefone    = cli_telefoneTextBox.Text;
                cli.Cli_celular     = cli_celularTextBox.Text;
                cli.Cli_email       = cli_emailTextBox.Text;
                cli.Cli_logradouro  = cli_logradouroTextBox.Text;
                cli.Cli_numero      = cli_numeroTextBox.Text;
                cli.Cli_complemento = cli_complementoTextBox.Text;
                cli.Cli_bairro      = cli_bairroTextBox.Text;
                cli.Cli_cidade      = Convert.ToInt32(cli_cidadeComboBox.SelectedValue);
                cli.Cli_estado      = Convert.ToInt32(cli_estadoComboBox.SelectedValue);
                cli.Cli_cadastro    = cli_cadastroDateTimePicker.Value.Date;
                //cli_cadastroDateTimePicker.Value = cli.Cli_cadastro;
                // cli.Cli_cadastro = Convert.ToDateTime(cli_cadastroDateTimePicker);


                //obj para gravar dados no bd
                ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                ClienteBLL bll     = new ClienteBLL(conexao);

                if (this.operacao == "inserir")
                {
                    bll.Incluir(cli);

                    MessageBox.Show("Cadastrado com Sucesso: Código: " + cli.Cli_id.ToString());
                    // this.LimpaTela

                    form_CadAnimal_CadBotao f = new form_CadAnimal_CadBotao();
                    f.ShowDialog();

                    f.Dispose();
                }
                else // alterar
                {
                    cli.Cli_id = Convert.ToInt32(cli_idTextBox.Text);
                    bll.Alterar(cli);
                    MessageBox.Show("Cadastrado Alterado com Sucesso: Código: " + cli.Cli_id.ToString());
                }
                this.LimpaTela();
                this.alterarBotoes(1);
            }    //try
            catch (Exception erro)
            {
                MessageBox.Show(erro.Message);
            }
        }
Exemplo n.º 22
0
 public void Alterar()
 {
     try
     {
         objDAL = new ConexaoDAL();
         objDAL.alterar(this.id, this.Nome, this.Servidor, this.Banco, this.Usuario, this.Senha);
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 23
0
 public void Excluir()
 {
     try
     {
         objDAL = new ConexaoDAL();
         objDAL.excluir(this.id);
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 24
0
        private void form_ConsUsuario_Load(object sender, EventArgs e)
        {
            ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
            UsuarioBLL bll     = new UsuarioBLL(conexao);

            dgv_usr.DataSource = bll.PesquisarTodos();

            //------CONFIG DO PESQUISAR ------//
            btnPesquisar_Click(sender, e);

            //------  DEFINE DGV COR TEXTO E FUNDO----- //
            this.dgv_usr.DefaultCellStyle.Font      = new Font("Verdana", 11);
            this.dgv_usr.DefaultCellStyle.ForeColor = Color.Black;
            this.dgv_usr.DefaultCellStyle.BackColor = Color.White;
        }
Exemplo n.º 25
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            try
            {
                //leitura dos dados
                UsuarioDTO usr = new UsuarioDTO();

                usr.Usr_nome           = usr_nomeTextBox.Text;
                usr.Usr_cpf            = usr_cpfTextBox.Text;
                usr.Usr_telefone       = usr_telefoneTextBox.Text;
                usr.Usr_celular        = usr_celularTextBox.Text;
                usr.Usr_logradouro     = usr_logradouroTextBox.Text;
                usr.Usr_numero         = usr_numeroTextBox.Text;
                usr.Usr_complemento    = usr_complementoTextBox.Text;
                usr.Usr_bairro         = usr_bairroTextBox.Text;
                usr.Usr_cidade         = Convert.ToInt32(usr_cidadeComboBox.SelectedValue);
                usr.Usr_estado         = Convert.ToInt32(usr_estadoComboBox.SelectedValue);
                usr.Usr_cargo          = Convert.ToInt32(usr_cargoComboBox.SelectedValue);
                usr.Usr_usuario        = usr_usuarioTextBox.Text;
                usr.Usr_senha          = usr_senhaTextBox.Text;
                usr.Usr_confirmarSenha = usr_confirmarSenhaTextBox.Text;
                usr.Usr_email          = usr_emailTextBox.Text;

                //obj para gravar dados no bd
                ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                UsuarioBLL bll     = new UsuarioBLL(conexao);

                if (this.operacao == "inserir")
                {
                    bll.Incluir(usr);

                    MessageBox.Show("Cadastrado com Sucesso: Código: " + usr.Usr_id.ToString());
                    // this.LimpaTela();
                }
                else // alterar
                {
                    usr.Usr_id = Convert.ToInt32(usr_idTextBox.Text);
                    bll.Alterar(usr);
                    MessageBox.Show("Cadastrado Alterado com Sucesso: Código: " + usr.Usr_id.ToString());
                }
                this.LimpaTela();
                this.alterarBotoes(1);
            }//try
            catch (Exception erro)
            {
                MessageBox.Show(erro.Message);
            }
        }
        private void IncluirSubCategoria()
        {
            this.CarregarIndiceComboCategoria(this.cbboxCADSubCatCategoria.SelectedItem.ToString());
            CatInMd.SubCategoria = this.txtCADSubCatSubCategoria.Text;


            ConexaoDAL      cx        = new ConexaoDAL(DadosConexao.StringDeConexao);
            SubCategoriaBLL SubCatBLL = new SubCategoriaBLL(cx);

            if (SubCatBLL.IncluirSubCategoria(CatInMd))
            {
                //this.LimparCampos("CliCad");
                //this.AlterarBotoes("CliCad", 0);
                this.CarregarTabelaSubCategoria();
            }
        }
Exemplo n.º 27
0
        //------CONFIG DE EXIBIÇÃO DO DGV ------//
        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            if (cbFiltrarAnimal.Text == "Pesquisar por Nome do Animal")
            {
                ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                AnimalBLL  bll     = new AnimalBLL(conexao);
                dgv_ani.DataSource = bll.PesquisarNomeAnimal(txtValor.Text);
            }

            if (cbFiltrarAnimal.Text == "Pesquisar Todos Animais")
            {
                ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                AnimalBLL  bll     = new AnimalBLL(conexao);
                dgv_ani.DataSource = bll.PesquisarTodosAnimal();
            }
        }
Exemplo n.º 28
0
        //------CONFIG DE EXIBIÇÃO DO DGV ------//
        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            if (cbFiltrarMedico.Text == "Pesquisar Todos")
            {
                ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                MedicoBLL  bll     = new MedicoBLL(conexao);
                dgv_med.DataSource = bll.Pesquisar(txtValor.Text);
            }

            if (cbFiltrarMedico.Text == "Pesquisar por nome do Médico")
            {
                ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                MedicoBLL  bll     = new MedicoBLL(conexao);
                dgv_med.DataSource = bll.Pesquisar(txtValor.Text);
            }
        }
Exemplo n.º 29
0
        /*</OBJETO>*/

        /*<FUNCAO>*/
        private void ValidarAcesso()
        {
            ConexaoDAL cx     = new ConexaoDAL(DadosConexao.StringDeConexao);
            LoginBLL   lgBLL  = new LoginBLL(cx);
            string     @login = txtLgLogin.Text;
            string     @senha = txtLgSenha.Text;

            if (lgBLL.ValidarAcesso(@login, @senha) != 0)
            {
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show("Usuário ou senha Invalido!");
            }
        }
Exemplo n.º 30
0
        private void form_ConsAnimal_Load(object sender, EventArgs e)
        {
            ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
            AnimalBLL  bll     = new AnimalBLL(conexao);

            dgv_ani.DataSource = bll.PesquisarTodosAnimal();

            //------CONFIG DO PESQUISAR ------//
            btnPesquisar_Click(sender, e);

            //------  DEFINE DGV COR TEXTO E FUNDO----- //
            this.dgv_ani.DefaultCellStyle.Font      = new Font("Verdana", 10);
            this.dgv_ani.DefaultCellStyle.ForeColor = Color.Black;
            this.dgv_ani.DefaultCellStyle.BackColor = Color.White;


            //------  DEFINE DGV CABEÇALHO----- //
            //Altera o cabeçalho da coluna
            dgv_ani.Columns[0].HeaderText = "ID";
            //Altera a largura da coluna
            //    dgv_ani.Columns[0].Width = 50;

            //Altera o cabeçalho da coluna
            dgv_ani.Columns[1].HeaderText = "Cliente";
            //Altera a largura da coluna
            //   dgv_ani.Columns[1].Width = 50;

            //Altera o cabeçalho da coluna
            dgv_ani.Columns[2].HeaderText = "Animal";
            //Altera a largura da coluna
            //    dgv_ani.Columns[2].Width = 70;

            //Altera o cabeçalho da coluna
            dgv_ani.Columns[3].HeaderText = "Sexo";
            //Altera a largura da coluna
            //   dgv_ani.Columns[3].Width = 50;

            //Altera o cabeçalho da coluna
            dgv_ani.Columns[4].HeaderText = "Espécie";
            //Altera a largura da coluna
            //   dgv_ani.Columns[4].Width = 50;

            //Altera o cabeçalho da coluna
            dgv_ani.Columns[5].HeaderText = "Raça";
            //Altera a largura da coluna
            //  dgv_ani.Columns[5].Width = 20;
        }