Esempio n. 1
0
        private void btnSalvarPT_Click(object sender, EventArgs e)
        {
            try
            {
                //leitura dos dados
                TipoProtocoloDTO tipop = new TipoProtocoloDTO()
                {
                    Tipop_descriçao = tpp_descriçaoTextBox.Text
                };

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

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

                    MessageBox.Show("Cadastrado com Sucesso: Código: " + tipop.Tipop_id.ToString());
                    // this.LimpaTela();
                }
                else // alterar
                {
                    tipop.Tipop_id = Convert.ToInt32(tpp_idTextBox.Text);
                    bll.Alterar(tipop);
                    MessageBox.Show("Cadastrado Alterado com Sucesso: Código: " + tipop.Tipop_id.ToString());
                }
                this.LimpaTelaPT();
                this.alterarBotoesPT(1);
            }//try
            catch (Exception erro)
            {
                MessageBox.Show(erro.Message);
            }
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        private void btnPesquisarPT_Click(object sender, EventArgs e)
        {
            // abre o form dentro do form
            form_ConsTipoProtocolo Form_Cad = new form_ConsTipoProtocolo()
            {
                ShowInTaskbar = false,
                StartPosition = FormStartPosition.CenterParent
            };

            Form_Cad.ShowDialog(ActiveForm);

            if (Form_Cad.codigo != 0)
            {
                ConexaoDAL       conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão);
                TipoProtocoloBLL bll     = new TipoProtocoloBLL(conexao);
                TipoProtocoloDTO tipop   = bll.CarregaTipoProtocoloDTO(Form_Cad.codigo);
                tpp_idTextBox.Text        = tipop.Tipop_id.ToString();
                tpp_descriçaoTextBox.Text = tipop.Tipop_descriçao;
                alterarBotoesPT(3);
            }
            else
            {
                this.LimpaTelaPT();
                this.alterarBotoesPT(1);
            }

            //encerra form
            Form_Cad.Dispose();
        }
Esempio n. 4
0
        private void btnExcluirPT_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);
                    TipoProtocoloBLL bll     = new TipoProtocoloBLL(conexao);

                    bll.Excluir(Convert.ToInt32(tpp_idTextBox.Text));
                    this.LimpaTelaPT();
                    this.alterarBotoesPT(1);
                }
            }//try
            catch
            {
                MessageBox.Show("Impossível excluir o registro.\n O registro está sendo utilizado em outro local.");
                this.alterarBotoesPT(3);
            }
        }
Esempio n. 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();
        }