private void btn_add_Click(object sender, RoutedEventArgs e) { ModifyPacienteView modifyPacienteView = new ModifyPacienteView(null); modifyPacienteView.ShowDialog(); Tabela.ItemsSource = PacienteDAO.GetAll(); }
public static void InserirCenso(Censo p) { int existPac = PacienteDAO.existPaciente(p.prontuario); p.usuario_carga = "Luciano Teste"; if (existPac.Equals(0)) { PacienteDAO.InserirPaciente(p.prontuario, p.nome, p.nascimento, p.sexo, p.vinculo); InternacaoDAO.InserirInternacao(p.prontuario, p.quarto, p.data_internacao_data, p.especialidade, p.medico, p.tempo, p.cid, p.descricaoCid, p.unidade_funcional); } else { int existInternacao = InternacaoDAO.VerificaInternacao(p.prontuario, p.data_internacao_data); if (existInternacao.Equals(0)) { InternacaoDAO.InserirInternacao(p.prontuario, p.quarto, p.data_internacao_data, p.especialidade, p.medico, p.tempo, p.cid, p.descricaoCid, p.unidade_funcional); } else { InternacaoDAO.AtualizarInternacao(p.prontuario, p.quarto, p.data_internacao_data, p.especialidade, p.medico, p.tempo, p.cid, p.descricaoCid, p.unidade_funcional, p.usuario_carga); } } }
private void AgendarConsulta() { DateTime data = dtpDtaAgendamento.DisplayDate; string hora = cboHorario.Text; string plano = txtPlanoPaciente.Text; int idMed = (int)cboMedico.SelectedValue; int idPac = Convert.ToInt32(txtNPac.Text); ag.DataAgendada = data; ag.HoraAgendada = hora; ag.Paciente = PacienteDAO.BuscarPacientePorId(idPac); ag.Cpf = PacienteDAO.BuscarPacientePorId(idPac); ag.Plano = plano; ag.Medico = MedicoDAO.BuscarMedicoPorId(idMed); ag.Especialidade = MedicoDAO.BuscarMedicoPorId(idMed); string msgCadastrou = AgendaDAO.CadastrarAgenda(ag); if (msgCadastrou == null) { ag = new Agenda(); MessageBox.Show("Consulta agendada!"); this.Close(); } else { MessageBox.Show(msgCadastrou); } }
public IActionResult AdicionaPaciente(Paciente paciente) { PacienteDAO DAO = new PacienteDAO(); if (DAO.VerificaCPF(paciente.cpf)) { HttpContext.Session.SetString("erro", "Paciente já cadastrado!"); return(RedirectToAction("CadastrarPaciente")); } else { PacienteDAO dao = new PacienteDAO(); bool valor = dao.AdicionaPaciente(paciente); dao.Dispose(); if (valor) { HttpContext.Session.SetString("erro", "Paciente Cadastrado com Sucesso!"); return(RedirectToAction("CadastrarPaciente")); } else { HttpContext.Session.SetString("erro", "Erro ao cadastrar Paciente!"); return(RedirectToAction("CadastrarPaciente")); } } }
public IActionResult ResultadoBuscaPaciente() { if (HttpContext.Session.GetString("usuarioLogado") == "logado") { PacienteDAO dao = new PacienteDAO(); string cartao = dao.BuscaCartaoTemporario(); dao.Dispose(); PacienteDAO b = new PacienteDAO(); Paciente paciente = b.BuscaPacientePorCartao(cartao); b.Dispose(); PacienteDAO DAO = new PacienteDAO(); List <Consulta> lista = new List <Consulta>(); lista = DAO.BuscaConsultaPaciente(paciente.cpf); ViewBag.ListaConsulta = lista; return(View()); ViewBag.Layout = HttpContext.Session.GetString("usuarioLayout"); return(View("CartaoPaciente")); } return(View("NovoLogin")); }
public IActionResult CadastroCartaoPaciente(string cpf) { PacienteDAO dao = new PacienteDAO(); string cartao = dao.BuscaCartaoTemporario(); dao.Dispose(); PacienteDAO DAO = new PacienteDAO(); bool resultado = DAO.AdicionarCartaoPaciente(cpf, cartao); DAO.Dispose(); if (resultado) { HttpContext.Session.SetString("erro", "Cartão cadastrado com sucesso"); return(RedirectToAction("CadastrarCartao")); } else { HttpContext.Session.SetString("erro", "Não foi possivel cadastrar este cartão!"); return(View("CadastrarCartao")); } }
public PacientesCadastrados() { InitializeComponent(); MeusPacientes = PacienteDAO.ListagemFiltradaDePacientes(Program.Batatinha); DataContext = this; dataGrid.Items.Refresh(); }
public IActionResult ListaPaciente(string cpfPaciente) { if (HttpContext.Session.GetString("usuarioLogado") == "logado") { PacienteDAO dao = new PacienteDAO(); Paciente paciente = new Paciente(); paciente = dao.BuscaPacientePorCPF(cpfPaciente); ViewBag.CPf = cpfPaciente; ViewBag.Nome = paciente.nome; ViewBag.Data = paciente.dt_nasc; ViewBag.Telefone = paciente.telefone; ViewBag.Bairro = paciente.bairro; ViewBag.Numero = paciente.numero; ViewBag.Cidade = paciente.cidade; ViewBag.Estado = paciente.estado; ViewBag.Layout = HttpContext.Session.GetString("usuarioLayout"); return(View()); } return(View("NovoLogin")); }
private void btn_del_Click(object sender, RoutedEventArgs e) { Paciente paciente = (Paciente)((DataGrid)Tabela).SelectedItem; PacienteDAO.Remove(paciente.Id); Tabela.Items.Refresh(); }
public FormSessaoCadastrar(Object sessao, int id, Boolean visualizar, object objSessoes) { InitializeComponent(); this.paramentroVisualizar = visualizar; this.nUtils = new Utils(); this.nSessao = (Sessao)sessao; this.pacienteDAO = new PacienteDAO(nSessao.connMysql); this.nPaciente = new Paciente(); this.clinicaDAO = new ClinicaDAO(nSessao.connMysql); this.nClinica = new Clinica(); this.fisioterapeutaDAO = new FisioterapeutaDAO(nSessao.connMysql); this.nFisioterapeuta = new Fisioterapeuta(); this.sessoesDAO = new SessoesDAO(nSessao.connMysql); this.nSessoes = new Sessoes(); this.nSessoes.id = id; if (objSessoes != null) { this.nSessoes = (Sessoes)objSessoes; } if (id == 0) { this.mtxtData.Text = DateTime.Now.ToString("dd/MM/yyyy"); this.mtxtHora.Text = DateTime.Now.ToString("HH:mm"); } }
public ActionResult Adiciona(Paciente paciente) { PacienteDAO dao = new PacienteDAO(); dao.Adiciona(paciente); return(RedirectToAction("Index", "Paciente")); }
private void btn_del_Click(object sender, RoutedEventArgs e) { Historico historico = (Historico)((DataGrid)HistoricoDataGrid).SelectedItem; paciente.Historicos.Remove(historico); PacienteDAO.Update(paciente); HistoricoDataGrid.Items.Refresh(); }
// GET: Consultas/Create public ActionResult Create() { List <Paciente> ListaPaciente = new List <Paciente>(); ListaPaciente = PacienteDAO.ListaDePacientesDaClinicaLogada(); ViewBag.PacienteId = new SelectList(ListaPaciente, "PacienteId", "PacienteNome"); return(View()); }
// GET: Consultas public ActionResult Index() { List <Paciente> ListaPaciente = new List <Paciente>(); ListaPaciente = PacienteDAO.ListaDePacientesDaClinicaLogada(); ViewBag.PacienteId = new SelectList(ListaPaciente, "PacienteId", "PacienteNome"); return(View(ConsultaDAO.RetornarListaConsultasDaClinicaLogada())); }
public void Guardar() { PacienteDTO = new PacienteDTO(); PacienteDTO.setNombre(txtnombre.Text); pacienteDAO = new PacienteDAO(PacienteDTO); pacienteDAO.GuardarPaciente(); MessageBox.Show("Registro Guardado"); }
public void EliminarRegistro() { pacienteDTO = new PacienteDTO(); pacienteDTO.setId(Convert.ToInt16(txtcodigo.Text)); pacienteDAO = new PacienteDAO(pacienteDTO); pacienteDAO.EliminarPaciente(); MessageBox.Show("Registro Eliminado"); }
/// <summary> /// Construtor /// </summary> /// <param name="sessao">Objeto sessao</param> public FormPaciente(object sessao) { InitializeComponent(); //Globais this.nSessao = (Sessao)sessao; this.nUtil = new Utils(); this.daoPaciente = new PacienteDAO(this.nSessao.connMysql); this.nPaciente = new Paciente(); }
public ActionResult Create([Bind(Include = "PacienteId,PacienteNome,PacienteCPF")] Paciente paciente) { if (ModelState.IsValid) { PacienteDAO.AdicionaPaciente(paciente); return(RedirectToAction("Index")); } return(View(paciente)); }
public int delete(PacienteDTO pacienteDTO) { int retorno = 0; PacienteDAO pacienteDAO = new PacienteDAO(); retorno = pacienteDAO.delete(pacienteDTO); return(retorno); }
public ActionResult Remover(int id) { PacienteDAO dao = new PacienteDAO(); Paciente paciente = dao.BuscaPorId(id); dao.Remover(paciente); return(RedirectToAction("Index", "Paciente")); }
public IActionResult ExcluirUsuario(string nome, string id, string check, string tipo) { PacienteDAO dao = new PacienteDAO(); string tipoid = ""; bool valor = false; if (tipo == "Medico") { tipoid = "1"; } else if (tipo == "Atendente") { tipoid = "2"; } else { tipoid = "3"; } if (!string.IsNullOrEmpty(check)) { if (!string.IsNullOrEmpty(id)) { valor = dao.ExcluirFuncionario(id, tipoid); dao.Dispose(); } else { ViewBag.Layout = HttpContext.Session.GetString("usuarioLayout"); return(RedirectToAction("FormExcluirUsuario")); } } else if (!string.IsNullOrEmpty(check)) { if (!string.IsNullOrEmpty(nome) && string.IsNullOrEmpty(id)) { PacienteDAO DAO = new PacienteDAO(); id = DAO.BuscarIdFuncionario(nome); DAO.Dispose(); } valor = dao.ExcluirFuncionario(id, tipoid); dao.Dispose(); } ViewBag.Layout = HttpContext.Session.GetString("usuarioLayout"); return(RedirectToAction("FormExcluirUsuario")); }
public bool ActualizarDatoPaciente(Paciente objPaciente) { try { return(PacienteDAO.getInstance().ActualizarPaciente(objPaciente)); }catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { NutricionistaDAO nutDal = new NutricionistaDAO(); ConsultaDAO conDal = new ConsultaDAO(); PacienteDAO pacDal = new PacienteDAO(); PrescricaoDAO presDal = new PrescricaoDAO(); GridView1.DataSource = presDal.GetAllPrescricaos(); GridView1.DataBind(); }
public ActionResult ViewEditar(int id) { PacienteDAO dao = new PacienteDAO(); ConvenioDAO convenioDAO = new ConvenioDAO(); ViewBag.Convenio = convenioDAO.Lista(); ViewBag.Paciente = dao.BuscaPorId(id); return(View()); }
public bool EditarPaciente3(String idPaciente, String direccion, String telefono) { try { return(PacienteDAO.getInstance().EditarPaciente3(idPaciente, direccion, telefono)); } catch (Exception ex) { throw ex; } }
public Paciente DatosPaciente(String idPaciente) { try { return(PacienteDAO.getInstance().DatosPaciente(idPaciente)); } catch (Exception ex) { throw ex; } }
public bool RegistrarPaciente(Paciente objPaciente) { try { return(PacienteDAO.getInstance().RegistrarPaciente(objPaciente)); } catch (Exception ex) { throw ex; } }
public Paciente AccesoSistema(String idPaciente, String contra) { try { return(PacienteDAO.getInstance().AccesoSistema(idPaciente, contra)); } catch (Exception ex) { throw ex; } }
public Paciente ObtenerPaciente(int id) { try { return(PacienteDAO.getInstance().ObtenerPaciente(id)); } catch (Exception ex) { throw ex; } }
public List <Paciente> ListarPacientes() { try { return(PacienteDAO.getInstance().ListaPacientes()); } catch (Exception) { throw; } }