示例#1
0
        private void btnSalvarTPE_Click(object sender, EventArgs e)
        {
            try
            {
                //leitura dos dados
                TipoExameDTO tip = new TipoExameDTO()
                {
                    Tpe_descriçao = tpa_descriçaoTextBox.Text
                };

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

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

                    MessageBox.Show("Cadastrado com Sucesso: Código: " + tip.Tpe_id.ToString());
                    // this.LimpaTela();
                }
                else // alterar
                {
                    tip.Tpe_id = Convert.ToInt32(tpe_idTextBox.Text);
                    bll.Alterar(tip);
                    MessageBox.Show("Cadastrado Alterado com Sucesso: Código: " + tip.Tpe_id.ToString());
                }
                this.LimpaTelaEX();
                this.alterarBotoesEX(1);
            }//try
            catch (Exception erro)
            {
                MessageBox.Show(erro.Message);
            }
        }
示例#2
0
        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            ConexaoDAL   conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
            TipoExameBLL bll     = new TipoExameBLL(conexao);

            dgv_tipoe.DataSource = bll.Pesquisar(txtValor.Text);
        }
示例#3
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();
        }
示例#4
0
        private void btnExcluirTPE_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult d = MessageBox.Show("Deseja excluir o registro?", "Aviso", MessageBoxButtons.YesNo);
                if (d.ToString() == "Yes")
                {
                    //obj para gravar dados no bd
                    ConexaoDAL   conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                    TipoExameBLL bll     = new TipoExameBLL(conexao);

                    bll.Excluir(Convert.ToInt32(tpe_idTextBox.Text));
                    this.LimpaTelaEX();
                    this.alterarBotoesEX(1);
                }
            }//try

            catch
            {
                MessageBox.Show("Impossível excluir o registro.\n O registro está sendo utilizado em outro local.");
                this.alterarBotoesEX(3);
            }
        }
示例#5
0
        private void Form_CadAtendimento_Load(object sender, EventArgs e)
        {
            pnInfo.Hide();
            pnExame.Hide();
            pnProtocolo.Hide();
            pnPrescriçaoMedica.Hide();
            pnSuspeitaClinica.Hide();
            pnVacina.Hide();
            pnDocumento.Hide();

            //      ate_data = DateTime.Now;
            //      datalb.Text = "Data: " + ate_data.ToShortDateString();

            //       ate_hora = DateTime.Now;
            //       lbhora.Text = "Hora: " + ate_hora.ToShortTimeString();


            //----------INICIA CONFIG BOTOES ---------------- //
            this.AlterarBotoes(1);

            // ----------COMBOBOX's -----------------------------//
            ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
            // cb medico
            MedicoBLL medbll = new MedicoBLL(conexao);

            ate_medicoComboBox.DataSource    = medbll.Pesquisar("");
            ate_medicoComboBox.DisplayMember = "med_nome";
            ate_medicoComboBox.ValueMember   = "med_id";
            // cb tipo atendimento
            TipoAtendimentoBLL tipbll = new TipoAtendimentoBLL(conexao);

            ate_tipoComboBox.DataSource    = tipbll.Pesquisar("");
            ate_tipoComboBox.DisplayMember = "tpa_atendimento";
            ate_tipoComboBox.ValueMember   = "tpa_id";
            // cb animal
            AnimalBLL anibll = new AnimalBLL(conexao);

            ate_animalComboBox.DataSource    = anibll.PesquisarNomeAnimal("");
            ate_animalComboBox.DisplayMember = "ani_nome";
            ate_animalComboBox.ValueMember   = "ani_id";

            // ----------COMBOBOX's Exame-----------------------------//
            // cb tipo exame
            TipoExameBLL exabll = new TipoExameBLL(conexao);

            exame_tipoComboBox.DataSource    = exabll.Pesquisar("");
            exame_tipoComboBox.DisplayMember = "tpe_descriçao";
            exame_tipoComboBox.ValueMember   = "tpe_id";

            // ----------COMBOBOX's Protocolo-----------------------------//
            // cb aplicação
            AplicaçaoBLL aplibll = new AplicaçaoBLL(conexao);

            prot_aplicaçaoComboBox.DataSource    = aplibll.Pesquisar("");
            prot_aplicaçaoComboBox.DisplayMember = "apl_descriçao";
            prot_aplicaçaoComboBox.ValueMember   = "apl_id";

            // cb tipo protocolo
            TipoProtocoloBLL protbll = new TipoProtocoloBLL(conexao);

            prot_tipoComboBox.DataSource    = protbll.Pesquisar("");
            prot_tipoComboBox.DisplayMember = "tpp_descriçao";
            prot_tipoComboBox.ValueMember   = "tpp_id";

            // ----------COMBOBOX's Vacina-----------------------------//

            // cb tipo vacina
            TipoVacinaBLL vaccbll = new TipoVacinaBLL(conexao);

            vac_tipoComboBox.DataSource    = vaccbll.Pesquisar("");
            vac_tipoComboBox.DisplayMember = "tpv_descriçao";
            vac_tipoComboBox.ValueMember   = "tpv_id";

            // cb tipo protocolo
            AplicaçaoBLL aplivbll = new AplicaçaoBLL(conexao);

            vac_aplicaçaoComboBox.DataSource    = aplivbll.Pesquisar("");
            vac_aplicaçaoComboBox.DisplayMember = "apl_descriçao";
            vac_aplicaçaoComboBox.ValueMember   = "apl_id";

            this.LimpaTela();
        }