Exemplo n.º 1
0
        protected void CargarGrilla()
        {
            DetalleHistoriaDAO detalleHistoriaDAO = new DetalleHistoriaDAO();

            gvdListaDetalle.DataSource = detalleHistoriaDAO.ConsultaDetallesIdMascota(int.Parse(Session["idMascotaEscogidaDoctor"].ToString())).ToList();
            gvdListaDetalle.DataBind();
        }
Exemplo n.º 2
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            DetalleHistoriaDAO detalleHistoriaDAO  = new DetalleHistoriaDAO();
            Detalle_historia   detalle_HistoriaDTO = new Detalle_historia();

            detalle_HistoriaDTO.ID_mascota             = int.Parse(Session["idMascotaEscogidaDoctor"].ToString());
            detalle_HistoriaDTO.Nombre_doctor          = txtNombreDoctor.Text;
            detalle_HistoriaDTO.Motivo_consulta        = txtMotivo.Text;
            detalle_HistoriaDTO.Descripcion_caso       = txtDescripcion.Text;
            detalle_HistoriaDTO.Antecedentes           = txtAntecedentes.Text;
            detalle_HistoriaDTO.Valoracion_resultado   = txtValoracion.Text;
            detalle_HistoriaDTO.Prescripcion_medica    = txtPrescripcion.Text;
            detalle_HistoriaDTO.Fecha_consulta_medica  = clFechaConsulta.SelectedDate;
            detalle_HistoriaDTO.Fecha_proxima_consulta = clProximaConsulta.SelectedDate;

            var registrar = detalleHistoriaDAO.RegistrarDetalle(detalle_HistoriaDTO);

            if (registrar == true)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "alarm", "create_success_detail_modal()", true);
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "alarm", "create_fail_detail_modal()", true);
            }
        }
Exemplo n.º 3
0
        protected void CargarGrillaDetalles()
        {
            DetalleHistoriaDAO detalleHistoriaDAO = new DetalleHistoriaDAO();

            gvdListaDetalleMascotasUsuario.DataSource = detalleHistoriaDAO.ConsultaDetallesIdMascota(int.Parse(Session["IdMascotaGrilladeUsuario"].ToString()));
            gvdListaDetalleMascotasUsuario.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                MascotaDAO mascotaDAO = new MascotaDAO();
                Mascotas   mascotaDTO = mascotaDAO.ConsultaPorId(int.Parse(Session["idMascotaEscogidaDoctor"].ToString()));

                lblNombreMascota.Text = mascotaDTO.Nombre;
                lblRaza.Text          = mascotaDTO.Raza;

                if (mascotaDTO.Especie == "Perro")
                {
                    imgFotoMascota.ImageUrl = "~/Images/Perro_Perfil.jpg";
                }
                else if (mascotaDTO.Especie == "Gato")
                {
                    imgFotoMascota.ImageUrl = "~/Images/Perfil_gato.jpg";
                }
                else if (mascotaDTO.Especie == "Hamster")
                {
                    imgFotoMascota.ImageUrl = "~/Images/Raton_Perfil.jpg";
                }
                else
                {
                    imgFotoMascota.ImageUrl = "~/Images/Perfil_Otras mascotas.jpg";
                }

                DetalleHistoriaDAO detalleHistoriaDAO  = new DetalleHistoriaDAO();
                Detalle_historia   detalle_HistoriaDTO = detalleHistoriaDAO.ConsultarDetalle(int.Parse(Session["idDetalleHistoriaSelect"].ToString()));

                lblNombreDoctor.Text    = detalle_HistoriaDTO.Nombre_doctor;
                lblMotivoConsulta.Text  = detalle_HistoriaDTO.Motivo_consulta;
                lblDescripcionCaso.Text = detalle_HistoriaDTO.Descripcion_caso;
                lblAntecedentes.Text    = detalle_HistoriaDTO.Antecedentes;
                lblValoracion.Text      = detalle_HistoriaDTO.Valoracion_resultado;
                lblPrescripcion.Text    = detalle_HistoriaDTO.Prescripcion_medica;
                lblFechaConsulta.Text   = detalle_HistoriaDTO.Fecha_consulta_medica.ToShortDateString();
                lblProximaConsulta.Text = detalle_HistoriaDTO.Fecha_proxima_consulta.ToString();
            }
        }