private void PBConfirmar_Click(object sender, EventArgs e) { //Insere no Banco var resultado = MessageBox.Show("Cadastro Realizado com Sucesso! Deseja cadastrar uma Anamnese?", "Cadastro", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (resultado == DialogResult.Yes) { frmAnam = new FRM_Anamnese(TBNome.Text.ToString(), TBCPF.Text.ToString()); frmAnam.Show(); this.Close(); } else { mt.limparTextBoxes(Controls); } }
private void PBConfirmar_Click(object sender, EventArgs e) { var resultado = DialogResult; Paciente pac = new Paciente(TBNome.Text.ToString(), TBCPF.Text.ToString(), TBEndereco.Text.ToString(), int.Parse(TBIdade.Text.ToString()), TBSexo.Text.ToString(), TBTelefone.Text.ToString()); string retornoRepository; if (update && mt.VerificaTextBoxesPreenchidas(Controls)) { retornoRepository = repository.UpdatePaciente(pac); MessageBox.Show("Dados alterados com " + retornoRepository, "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information); mt.limparTextBoxes(Controls); mt.AlterarEdicaoTextBoxes(Controls, false); TBNome.Enabled = true; TBCPF.Enabled = true; } else if (!update && mt.VerificaTextBoxesPreenchidas(Controls)) { retornoRepository = repository.PersistMedico(pac); resultado = MessageBox.Show("Cadastro Realizado \n " + retornoRepository + "\nDeseja cadastrar uma Anamnese?", "Cadastro", MessageBoxButtons.YesNo, MessageBoxIcon.Information); mt.AlterarEdicaoTextBoxes(Controls, false); mt.limparTextBoxes(Controls); TBNome.Enabled = true; TBCPF.Enabled = true; } else { MessageBox.Show("Dados obrigatórios não foram preenchidos!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Warning); } if (resultado == DialogResult.Yes) { frmAnam = new FRM_Anamnese(TBNome.Text.ToString(), TBCPF.Text.ToString()); mt.limparTextBoxes(Controls); frmAnam.Show(); this.Close(); } }
private void BTAnamnese_Click(object sender, EventArgs e) { frmAnam = new FRM_Anamnese(); frmAnam.Show(); this.Close(); }
private void DGV_ConsultaAnamnese_CellContentClick(object sender, DataGridViewCellEventArgs e) { frmAnam = new FRM_Anamnese(DGV_ConsultaAnamnese.CurrentRow.Cells[0].Value.ToString(), DGV_ConsultaAnamnese.CurrentRow.Cells[1].Value.ToString()); frmAnam.Show(); this.Close(); }