protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Paciente oPaciente = new Paciente(); PacienteDao oPacienteDao = new PacienteDao(); String cadena; HiddenField hdMaster = (HiddenField)Master.FindControl("hdToken"); hdMaster.Value = Request.QueryString["r"]; string[] decript = Utilidades.Seguridad.DesEncriptarSap(hdMaster.Value, out cadena); if (decript.Length > 6) { HiddenField hdtipo = (HiddenField)Master.FindControl("hdTipo"); hdtipo.Value = "V"; } oPaciente = oPacienteDao.GetPaciente(decript[3]); lbNombre.Text = oPaciente.Nombre + " " + oPaciente.Apellidos; lbDireccion.Text = oPaciente.Direccion; lbEmail.Text = oPaciente.Email; lbRut.Text = oPaciente.Rut; lbTelefono1.Text = oPaciente.Telefono1; lbTelefono2.Text = oPaciente.Telefono2; lbFechaNac.Text = oPaciente.FechaNacimiento.ToString("dd/MM/yyyy"); Literal litPag = (Literal)Master.FindControl("litPag1"); litPag.Text = "Perfíl Paciente >"; if (!oPacienteDao.Session(oPaciente.Rut)) { pnModalSes.Visible = true; ModalPopupExtender1.Show(); } } }
public ActionResult Index() { MedicoDao me = new MedicoDao(); AgendamentoDao ag = new AgendamentoDao(); IList <Agendamento> lista = ag.Select(); PacienteDao dao = new PacienteDao(); IList <Paciente> listaPacientes = new List <Paciente>(); IList <Paciente> pacientes = dao.Select(); foreach (var agenda in lista) { int id = agenda.PacienteId; Paciente paciente = dao.BuscaPorId(id); listaPacientes.Add(paciente); } listaPacientes.Count(); ViewBag.Paciente = listaPacientes; ViewBag.Pacientes = pacientes; ViewBag.Agendamento = lista; ViewBag.Medicos = me.Select(); return(View()); }
public ActionResult verificarExistente(string nome, string user) { PacienteDao dao = new PacienteDao(); string valida = (dao.VerificarExistencia(nome, user) ? "Sim" : "Não"); return(Json(valida)); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { List <String> Compartir = new List <String>(); ViewState["Compartir"] = Compartir; HiddenField hdMaster = (HiddenField)Master.FindControl("hdToken"); hdMaster.Value = Request.QueryString["r"]; String Rut; String cadena; string[] decript = Utilidades.Seguridad.DesEncriptarSap(hdMaster.Value, out cadena); String RutMaster = decript[3]; if (decript.Length > 6) { Rut = decript[6]; HiddenField hdtipo = (HiddenField)Master.FindControl("hdTipo"); hdtipo.Value = "V"; } else { Rut = decript[3]; } ViewState["Rut"] = Rut; List <Examenes> lst = new List <Examenes>(); ExamenesDao exDao = new ExamenesDao(); lst = exDao.GetExamenes(Rut, "1"); ViewState["Examenes"] = lst; grdExam.DataSource = lst; grdExam.DataBind(); Literal litPag = (Literal)Master.FindControl("litPag1"); litPag.Text = "Exámenes de Laboratorio >"; PacienteDao oPaciente = new PacienteDao(); } }
public ActionResult Cadastrar(String nomePaciente, String nomeMedico, DateTime Data, String Hora, String Observacao, String Plano) { AgendamentoDao ag = new AgendamentoDao(); PacienteDao dao = new PacienteDao(); MedicoDao me = new MedicoDao(); Agendamento agendamento = new Agendamento(); agendamento.hora = Hora; agendamento.data = Data; agendamento.observacao = Observacao; agendamento.Plano = Plano; foreach (var item in dao.Select()) { if (item.Nome == nomePaciente) { agendamento.PacienteId = item.ID; } } foreach (var item in me.Select()) { if (item.nome == nomeMedico) { agendamento.MedicoId = item.ID; } } string validacao = (ag.Cadastrar(agendamento) ? "Sim" : "Não"); return(Json(validacao)); }
public ActionResult Cadastrar(Paciente paciente, Endereco endereco, Usuario usuario, HttpPostedFileBase Imagem) { //iniciando instacia PacienteDao pa = new PacienteDao(); EnderecoDao end = new EnderecoDao(); UsuarioDao us = new UsuarioDao(); CategoriasDAO cat = new CategoriasDAO(); Categoria categoria = new Categoria(); //adicionando o id categoria.Paciente = true; cat.Cadastrar(categoria); usuario.CategoriaId = categoria.Id; us.Cadastrar(usuario); end.Cadastrar(endereco); if (Imagem == null) { paciente.imagem = new byte[0]; } else { paciente.imagem = new byte[Imagem.ContentLength]; Imagem.InputStream.Read(paciente.imagem, 0, Imagem.ContentLength); } //*-------------* paciente.EnderecoId = endereco.ID; paciente.UsuarioId = usuario.ID; //Aplicando à instancia pa.Cadastrar(paciente); return(RedirectToAction("Index")); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { HiddenField hdMaster = (HiddenField)Master.FindControl("hdToken"); hdMaster.Value = Request.QueryString["r"]; PacienteDao oPaciente = new PacienteDao(); ReservaDao reservaDao = new ReservaDao(); String Rut; String cadena; string[] decript = Utilidades.Seguridad.DesEncriptarSap(hdMaster.Value, out cadena); String RutMaster = decript[3]; if (decript.Length > 6) { Rut = decript[6]; HiddenField hdtipo = (HiddenField)Master.FindControl("hdTipo"); hdtipo.Value = "V"; } else { Rut = decript[3]; } ViewState["Rut"] = Rut; List <Cita> lst = new List <Cita>(); lst = reservaDao.GetCitaHistorica(Rut, "01012013", DateTime.Now.AddDays(-1).ToString("ddMMyyyy")); ViewState["lstHistorico"] = lst; grdHistorico.DataSource = lst; grdHistorico.DataBind(); Literal litPag = (Literal)Master.FindControl("litPag1"); litPag.Text = "Cita Histórica >"; } }
private void guardarButton_Click(object sender, EventArgs e) { RecetaDao receta = new RecetaDao(); MedicoDao medico = new MedicoDao(); PacienteDao paciente = new PacienteDao(); CitaDao cita = new CitaDao(); DateTime fecha = diaDTP.Value.Date; TimeSpan hora = TimeSpan.Parse(horaCB.Text); DateTime fechaCompleta = fecha.Add(hora); if (recetaRTB.Text.Length >= 700) { MessageBox.Show("El tamaño de la receta excede el numero de caracteres requeridos"); } else { bool seGuardo = receta.Insert(receta.ultimaReceta(), nombreMedicoTB.Text, apellidoMedicoTB.Text, nombrePacienteTB.Text, apellidoPacienteTB.Text, cita.ObtenerCita(fechaCompleta).Cedula, cita.ObtenerCita(fechaCompleta).Nss, fechaCompleta, recetaRTB.Text); if (seGuardo) { MessageBox.Show("Consulta realizada correctamente"); } else { MessageBox.Show("La consulta ya existe"); } deshabilitarDatos(); } }
protected void lkVincular_Click(object sender, EventArgs e) { PacienteDao pacDao = new PacienteDao(); int flag; String parametro = pacDao.login(txtRut.Text, txtPass.Text, out flag); if (flag == 1) { String cadena; string[] parametros = Utilidades.Seguridad.DesEncriptarSap(parametro, out cadena); if (pacDao.SetVinculados(ViewState["Rut"].ToString(), txtRut.Text, "1") == 1) { Paciente pac = new Paciente(); pac = pacDao.GetPaciente((String)ViewState["Rut"]); txtRut.Text = ""; List <Paciente> lstVinculadores = new List <Paciente>(); rpVinculados.DataSource = pacDao.GetVinculados(pac.BP, out lstVinculadores); rpVinculados.DataBind(); } else { String c = "Fracaso"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String cadena; String[] master = Utilidades.Seguridad.DesEncriptarSap(Request.QueryString["r"], out cadena); HiddenField hdMaster = (HiddenField)Master.FindControl("hdToken"); hdMaster.Value = Request.QueryString["r"]; String Rut = ""; String RutMaster = master[3]; if (master.Length > 6) { Rut = master[6]; HiddenField hdtipo = (HiddenField)Master.FindControl("hdTipo"); hdtipo.Value = "V"; } else { Rut = master[3]; } HttpContext context; context = HttpContext.Current; Cita cita = new Cita(); lbMedico.Text = (String)context.Items["NombreMed"]; cita = (Cita)context.Items["Cita"]; lbEspecialidad.Text = (String)context.Items["Especialidad"]; lbFecha.Text = cita.Fecreserva.Substring(0, 2) + "/" + cita.Fecreserva.Substring(2, 2) + "/" + cita.Fecreserva.Substring(4, 4); lbHora.Text = cita.Horareserva.Substring(0, 2) + ":" + cita.Horareserva.Substring(2, 2); Literal litPag = (Literal)Master.FindControl("litPag1"); litPag.Text = "Reserva de hora > Agendamiento >"; PacienteDao oPaciente = new PacienteDao(); } }
protected void LinkButton4_Click(object sender, EventArgs e) { String Rutvinculador = (String)ViewState["RutVinculador"]; String Rut = (String)ViewState["Rut"]; PacienteDao pacDao = new PacienteDao(); if (Rutvinculador != null) { pacDao.SetVinculados(Rutvinculador, Rut, "2"); List <Paciente> lstVinculador = new List <Paciente>(); Paciente pac = new Paciente(); pac = pacDao.GetPaciente(Rut); pacDao.GetVinculados(pac.BP, out lstVinculador); rpVinculador.DataSource = lstVinculador; rpVinculador.DataBind(); Panel1.Visible = false; } else { pacDao.SetVinculados(Rut, ViewState["rutvinculado"].ToString(), "2"); List <Paciente> lstVinculadores = new List <Paciente>(); Paciente pac = new Paciente(); pac = pacDao.GetPaciente(Rut); rpVinculados.DataSource = pacDao.GetVinculados(pac.BP, out lstVinculadores); rpVinculados.DataBind(); Panel1.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String cadena; Paciente pac = new Paciente(); PacienteDao pacDao = new PacienteDao(); String[] master = Utilidades.Seguridad.DesEncriptarSap(Request.QueryString["r"], out cadena); ViewState["cadena"] = cadena; HiddenField hdMaster = (HiddenField)Master.FindControl("hdToken"); hdMaster.Value = Request.QueryString["r"]; //HiddenField hdtipo = (HiddenField)Master.FindControl("hdTipo"); //hdtipo.Value = ""; pac = pacDao.GetPaciente(master[3]); ViewState["Rut"] = master[3]; List <Paciente> lst = new List <Paciente>(); List <Paciente> lstVinculador = new List <Paciente>(); lst = pacDao.GetVinculados(pac.BP, out lstVinculador); rpVinculados.DataSource = lst; rpVinculados.DataBind(); rpVinculador.DataSource = lstVinculador; rpVinculador.DataBind(); ViewState["lstVinculado"] = lstVinculador; Literal litPag = (Literal)Master.FindControl("litPag1"); litPag.Text = "Vincular >"; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["r"] != null) { String cadena; ReservaDao oReserva = new ReservaDao(); PacienteDao oPaciente = new PacienteDao(); List <Busqueda> lstBusqueda = new List <Busqueda>(); lstBusqueda = oReserva.GetBusqueda(); dpBusqueda.DataSource = lstBusqueda; dpBusqueda.DataValueField = "Id"; dpBusqueda.DataTextField = "Glosa"; dpBusqueda.DataBind(); dpBusqueda.Focus(); HiddenField hdMaster = (HiddenField)Master.FindControl("hdToken"); hdMaster.Value = Request.QueryString["r"]; string[] decript = Utilidades.Seguridad.DesEncriptarSap(hdMaster.Value, out cadena); String RutMaster = decript[3]; if (decript.Length < 6) { ViewState["Rut"] = decript[3]; } else { ViewState["Rut"] = decript[6]; HiddenField hdtipo = (HiddenField)Master.FindControl("hdTipo"); hdtipo.Value = "V"; } Literal litPag = (Literal)Master.FindControl("litPag1"); litPag.Text = "Reserva de hora >"; } } }
public ActionResult Form(int pacienteId, int agendamentoId) { AgendamentoDao ag = new AgendamentoDao(); Agendamento agendamento = ag.BuscaPorId(agendamentoId); //Criando atendimento AtendimentosDao atend = new AtendimentosDao(); Atendimentos atendimento = new Atendimentos(); atendimento.data = agendamento.data; atendimento.MedicoId = agendamento.MedicoId; atendimento.PacienteId = agendamento.PacienteId; atendimento.Plano = agendamento.Plano; atend.Cadastrar(atendimento); Prontuario prontuario = new Prontuario(); ProntuarioDao dao = new ProntuarioDao(); foreach (var item in dao.Select()) { if (item.PacienteId == (pacienteId)) { prontuario = item; } } Componente_PacienteDao com = new Componente_PacienteDao(); HistoriaPatologicaPregressaDao h = new HistoriaPatologicaPregressaDao(); //ComponenteDao co = new ComponenteDao(); PacienteDao paci = new PacienteDao(); Paciente paciente = paci.BuscaPorId(pacienteId); HistoriaPatologicaPregressa historia = h.BuscaPorId(prontuario.HistoriaPatologicaPregressaId); //IList<Componente> lista_componente = new List<Componente>(); IList <Componente_Paciente> lista = new List <Componente_Paciente>(); if (com.BuscarAgendamentos(paciente.ID) != null) { lista = com.BuscarAgendamentos(paciente.ID); ViewBag.Componente = lista; } ConsultaDao con = new ConsultaDao(); IList <Consulta> listaConsultas = con.BuscaPorPaciente(pacienteId); MedicoDao me = new MedicoDao(); Medico medico = me.BuscaPorId(agendamento.MedicoId); ViewBag.Medico = medico; ViewBag.Agendamento = agendamento; ViewBag.Consultas = listaConsultas; ViewBag.Historia = historia; ViewBag.Prontuario = prontuario; ViewBag.Paciente = paciente; return(View()); }
public ActionResult Paciente(int id) { PacienteDao dao = new PacienteDao(); EnderecoDao end = new EnderecoDao(); UsuarioDao us = new UsuarioDao(); CategoriasDAO cat = new CategoriasDAO(); Paciente paciente = dao.BuscaPorId(id); Endereco endereco = end.BuscaPorId(paciente.EnderecoId); Usuario usuario = us.BuscaPorId(paciente.UsuarioId); Categoria categoria = cat.BuscaPorId(usuario.CategoriaId); String tipo = ""; if (categoria.Medico == true) { tipo += " Medico "; } else if (categoria.Paciente == true) { tipo += " Paciente "; } else if (categoria.Atendente == true) { tipo += " Funcionario "; } ViewBag.Paciente = paciente; ViewBag.Endereco = endereco; ViewBag.Usuario = usuario; ViewBag.Mensagem = tipo; return(View()); }
public ActionResult Form() { PacienteDao pa = new PacienteDao(); IList <Paciente> listaPaciente = pa.Select(); ConsumindoApiDao con = new ConsumindoApiDao(); IList <string> compo = new List <string>(); bool valida = true; foreach (var item in con.Consumir()) { foreach (var item2 in compo) { if (item.PrincipioAtivo == item2) { valida = false; } } if (valida) { compo.Add(item.PrincipioAtivo); } valida = true; } ViewBag.Pacientes = listaPaciente; ViewBag.Componentes = compo; return(View()); }
protected void btnReservar_Click(object sender, EventArgs e) { if (!ValidarPaciente(int.Parse(txtPaciente.Text))) { divResultado.Visible = true; txtResultado.Text = "El Numero de Documento ingresado no corresponde a un Paciente registrado."; return; } int? idPaciente = (PacienteDao.ObtenerPorNroDoc(int.Parse(txtPaciente.Text))).Id; DateTime fechaValidacion = DateTime.Parse(txtFecha.Text); if (ValidarSuperposicion(fechaValidacion, idPaciente, txtHora.Text)) { divResultado.Visible = true; txtResultado.Text = "El Paciente ya tiene un turno asignado en esa fecha para ese horario."; return; } TurnoEntidad TurnoGuardar = new TurnoEntidad(); TurnoGuardar.idPaciente = PacienteDao.ObtenerPorNroDoc(int.Parse(txtPaciente.Text)).Id; TurnoGuardar.fecha = txtFecha.Text; TurnoGuardar.hora = txtHora.Text; TurnoGuardar.codEmpleado = (int)gdvEspecialista.SelectedDataKey.Value; TurnoDao.Insertar(TurnoGuardar); Limpiar(); }
public ActionResult Prontuario(int id) { Componente_PacienteDao com = new Componente_PacienteDao(); ProntuarioDao dao = new ProntuarioDao(); Prontuario prontuario = dao.BuscaPorId(id); HistoriaPatologicaPregressaDao h = new HistoriaPatologicaPregressaDao(); ComponenteDao co = new ComponenteDao(); PacienteDao paci = new PacienteDao(); Paciente paciente = paci.BuscaPorId(prontuario.PacienteId); HistoriaPatologicaPregressa historia = h.BuscaPorId(prontuario.HistoriaPatologicaPregressaId); IList <Componente_Paciente> lista = com.BuscarAgendamentos(paciente.ID); if (lista == null) { ViewBag.Componente = null; } else { ViewBag.Componente = lista; } ViewBag.Historia = historia; ViewBag.Prontuario = prontuario; ViewBag.Paciente = paciente; return(View()); }
private void findButton_Click(object sender, EventArgs e) { deshabilitarDatos(); fechasCB.Visible = false; RecetaDao receta = new RecetaDao(); PacienteDao paciente = new PacienteDao(); if (paciente.existeNss(Convert.ToInt32(buscarTB.Text))) { fechasCB.Items.Clear(); List <RecetaDTO> historial = receta.VerRegistros("receta where nss = " + Convert.ToInt32(buscarTB.Text) + ""); if (historial.Count > 0) { fechasCB.Visible = true; for (int i = 0; i < historial.Count; i++) { fechasCB.Items.Add(historial[i].Fecha.ToString()); } } else { MessageBox.Show("El paciente no cuenta con historial medico"); } } else { MessageBox.Show("El paciente no existe"); } }
public ActionResult ConsultaCliente(int idConsulta) { ConsultaDao dao = new ConsultaDao(); Consulta consulta = dao.BuscaPorId(idConsulta); PacienteDao paci = new PacienteDao(); MedicoDao me = new MedicoDao(); Medico medico = me.BuscaPorId(consulta.MedicoId); AnamneseDao ana = new AnamneseDao(); Anamnese anamnese = ana.BuscaPorId(consulta.AnamneseId); ViewBag.Paciente = paci.BuscaPorId(consulta.PacienteId); ViewBag.Anamnese = anamnese; ViewBag.Consulta = consulta; ViewBag.Medico = medico; var pdf = new ViewAsPdf { ViewName = "ConsultaCliente", PageSize = Size.A4, IsGrayScale = true }; return(pdf); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { HttpContext context = HttpContext.Current; List<Medicos> lstMedicos = new List<Medicos>(); HiddenField hdMaster = (HiddenField)Master.FindControl("hdToken"); lstMedicos = (List<Medicos>)context.Items["Medicos"]; ViewState["lstMedicos"] = lstMedicos; lbEspecialidad.Text = (String)context.Items["Especialidad"]; List<Agenda> lstbusqueda = new List<Agenda>(); ViewState["Agendas"] = (List<Agenda>)context.Items["Agendas"]; ViewState["Medicos"] = lstMedicos; hdIdEspcialidad.Value = string.Format("{0,10:G}", Convert.ToInt32((String)context.Items["IdEspecialidad"])).Trim(); hdMaster.Value = Request.QueryString["r"]; string cadena; string[] decript = Utilidades.Seguridad.DesEncriptarSap(hdMaster.Value, out cadena); String RutMaster = decript[3]; if (decript.Length < 6) { ViewState["Rut"] = decript[3]; } else { ViewState["Rut"] = decript[6]; HiddenField hdtipo = (HiddenField)Master.FindControl("hdTipo"); hdtipo.Value = "V"; } MedicoDao medicoDao = new MedicoDao(); List<BO.Especialidad> lstSub = new List<BO.Especialidad>(); lstSub = medicoDao.lstSubEsp(hdIdEspcialidad.Value); if (lstSub.Count > 1) { dpSub.DataSource = lstSub; dpSub.DataValueField = "CodEsp"; dpSub.DataTextField = "Glosa"; } else { lbFiltros.Visible = false; dpSub.Visible = false; } dpSub.DataBind(); lbCantidad.Text = " " + lstMedicos.Count.ToString() + " "; //if (lstMedicos.Count < 6) //{ // DataPager1.Visible = false; //} DataList2.DataSource = lstMedicos; DataList2.DataBind(); ViewState["lstmedicos"] = lstMedicos; Literal litPag = (Literal)Master.FindControl("litPag1"); litPag.Text = "Reserva de hora > Especialidad >"; PacienteDao oPaciente = new PacienteDao(); } }
public ActionResult ClienteProntuario() { Paciente paciente = (Paciente)Session["Paciente"]; Componente_PacienteDao com = new Componente_PacienteDao(); ProntuarioDao dao = new ProntuarioDao(); Prontuario prontuario = dao.BuscaPorProntuario(paciente.ID); HistoriaPatologicaPregressaDao h = new HistoriaPatologicaPregressaDao(); ComponenteDao co = new ComponenteDao(); PacienteDao paci = new PacienteDao(); HistoriaPatologicaPregressa historia = h.BuscaPorId(prontuario.HistoriaPatologicaPregressaId); IList <Componente> lista_componente = new List <Componente>(); IList <Componente_Paciente> comPaci = com.BuscarAgendamentos(paciente.ID); int validador = 0; if (comPaci != null) { string nomes = ""; IList <Componente_Paciente> lista = com.BuscarAgendamentos(paciente.ID); foreach (var item in lista) { if (item.Componente != "") { nomes += item.Componente + ","; validador++; } } ViewBag.Componente = nomes; if (validador == 0) { ViewBag.Componente = "Nenhum Componente alergico"; } } ViewBag.Historia = historia; ViewBag.Prontuario = prontuario; ViewBag.Paciente = paciente; var pdf = new ViewAsPdf { ViewName = "ClienteProntuario", PageSize = Size.A4, IsGrayScale = true }; return(pdf); }
public ActionResult Index() { PacienteDao dao = new PacienteDao(); IList <Paciente> lista = dao.Select(); ViewBag.Paciente = lista; return(View()); }
public Paciente Load(int id) { PacienteDao pacienteDao = new PacienteDao(); Paciente paciente = pacienteDao.Load(id); this.error = pacienteDao.Error; return(paciente); }
private void eliminarButton_Click(object sender, EventArgs e) { PacienteDao eliminar = new PacienteDao(); eliminar.Delete(Convert.ToInt32(nssTB.Text)); MessageBox.Show("Eliminado correctamente"); DesHabilitarDatos(); }
public bool Save(Paciente objEnt) { PacienteDao pacienteDao = new PacienteDao(); bool flag = objEnt.Id == int.MinValue ? pacienteDao.Create(objEnt, (DbTransaction)null) : pacienteDao.Update(objEnt, (DbTransaction)null); this.error = pacienteDao.Error; return(flag); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //Label1.Attributes.Add("onclick", "javascript:ActivarPostClickAceptar();" + Page.ClientScript.GetPostBackEventReference(this.Label1, string.Empty) + ";"); //LinkButton3_ModalPopupExtender.Hide(); String cadena; String[] master = Utilidades.Seguridad.DesEncriptarSap(Request.QueryString["r"], out cadena); HiddenField hdMaster = (HiddenField)Master.FindControl("hdToken"); HttpContext context; context = HttpContext.Current; Agenda agendas = new Agenda(); agendas = (Agenda)context.Items["Agenda"]; ViewState["origen"] = (String)context.Items["origen"]; ViewState["Rut"] = (String)context.Items["Rut"]; ViewState["IdEspecialidad"] = (String)context.Items["IdEspecialidad"]; ViewState["Especialidad"] = (String)context.Items["Especialidad"]; List <Agenda> lstbusqueda = new List <Agenda>(); lstbusqueda = (List <Agenda>)context.Items["Agendas"]; ViewState["Agendas"] = lstbusqueda; List <Medicos> lstMedicos = (List <Medicos>)context.Items["Medicos"]; ViewState["lstMedicos"] = lstMedicos; Medicos medico = new Medicos(); medico = (Medicos)context.Items["Medico"]; hdMaster.Value = Request.QueryString["r"]; if (master.Length > 6) { HiddenField hdtipo = (HiddenField)Master.FindControl("hdTipo"); hdtipo.Value = "V"; } Literal litPag = (Literal)Master.FindControl("litPag1"); litPag.Text = "Reserva de hora > Detalle Agenda >"; ViewState["lstmedicos"] = lstbusqueda; DateTime fechaAgenda = DateTime.Parse(agendas.Fecha.Substring(0, 2) + "-" + agendas.Fecha.Substring(2, 2) + "-" + agendas.Fecha.Substring(4, 4)); CultureInfo ci = new CultureInfo("Es-Es"); lbFecha.Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(ci.DateTimeFormat.GetDayName(fechaAgenda.DayOfWeek) + " " + fechaAgenda.Day) + " de " + CultureInfo.CurrentCulture.TextInfo.ToTitleCase(ci.DateTimeFormat.GetMonthName(fechaAgenda.Month) + " " + fechaAgenda.Year); MedicoDao oMedicoDao = new MedicoDao(); ViewState["medico"] = medico; ViewState["Agenda"] = agendas; ImgDr.ImageUrl = medico.Value[0].oImagenes.Url; lbNombre.Text = medico.Value[0].Nombres + " " + medico.Value[0].Apellidos; String fecha = agendas.Fecha.Substring(0, 8); ViewState["Fecha"] = agendas.Fecha; List <DispoDiaria> lstDis = new List <DispoDiaria>(); lstDis = oMedicoDao.GetDisponibilidadDiaria(medico.Value[0].VMA, fecha, agendas.Id_especialidad); dlDisHora.DataSource = lstDis; dlDisHora.DataBind(); List <String> lstMes = new List <string>(); lstMes = oMedicoDao.GetDisponibilidadMensual("01" + agendas.Fecha.Substring(2, 6), medico.Value[0].VMA); calendar.VisibleDate = new DateTime(int.Parse(lstMes[0].Substring(4, 4)), int.Parse(lstMes[0].Substring(2, 2)), 01); calendar.SelectedDate = new DateTime(int.Parse(agendas.Fecha.Substring(4, 4)), int.Parse(agendas.Fecha.Substring(2, 2)), int.Parse(agendas.Fecha.Substring(0, 2))); ViewState["Mes"] = lstMes; lbEspecialidad.Text = agendas.Especialidad; PacienteDao oPaciente = new PacienteDao(); } }
public PacienteController(PacienteDao pacienteDao , UserManager <UsuarioLogado> userManager , SignInManager <UsuarioLogado> signInManager ) { _pacienteDAO = pacienteDao; _userManager = userManager; _signInManager = signInManager; }
public ActionResult Excluir(int id) { PacienteDao dao = new PacienteDao(); Paciente paciente = dao.BuscaPorId(id); string validacao = (dao.excluir(paciente) ? "Sim" : "Não"); return(Json(validacao)); }
private void pacientesToolStripMenuItem_Click(object sender, EventArgs e) { //Objeto para obtener datos mediante metodo de verRegistros PacienteDao paciente = new PacienteDao(); indicacionLabel.Text = "Pacientes"; //Mostrar todos los datos de la lista resultante datosTablaDGV.DataSource = paciente.VerRegistros("paciente order by nss"); }