protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         MascotaDAO mascotaDAO = new MascotaDAO();
         Mascotas   mascotaDTO = mascotaDAO.ConsultaPorId(int.Parse(Session["idMascotaActualizar"].ToString()));
         txtIdMascota.Text     = mascotaDTO.ID_mascota.ToString();
         txtNombreMascota.Text = mascotaDTO.Nombre.ToString();
         // agregar los demas campos que deseo actualizar
     }
 }
Example #2
0
        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 = ("Hola! soy" + " " + mascotaDTO.Nombre);
                var genero = mascotaDTO.Sexo.ToLower() == "m" ? "Masculino" : "Femenino";
                lblTexto.Text = ("Soy un" + " " + mascotaDTO.Especie + " de Raza" + " " + mascotaDTO.Raza + "; Y soy de Sexo" + " " + genero + " . Naci el" + " " + mascotaDTO.Fecha_nacimiento.ToString("dd/MM/yyyy") + " y mi dueño se llama" + " " + mascotaDTO.Usuarios.Nombres + " " + mascotaDTO.Usuarios.Apellidos);
                CargarGrilla();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            MascotaDAO mascotaDAO = new MascotaDAO();
            Mascotas   mascotaDTO = mascotaDAO.ConsultaPorId(int.Parse(Session["idMascotaVer"].ToString()));

            txtNombreMascota.Text     = mascotaDTO.Nombre.ToString();
            txtEspecieMascota.Text    = mascotaDTO.Especie.ToString();
            txtRazaMascota.Text       = mascotaDTO.Raza.ToString();
            txtColorMascota.Text      = mascotaDTO.Color.ToString();
            txtSexoMascota.Text       = mascotaDTO.Sexo.ToString();
            txtSeñasParticulares.Text = mascotaDTO.Señas_particulares.ToString();
            txtFechaNacimiento.Text   = mascotaDTO.Fecha_nacimiento.ToString();
            txtEstado.Text            = mascotaDTO.Estados.Descripcion;
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         MascotaDAO mascotaDAO = new MascotaDAO();
         Mascotas   mascotaDTO = mascotaDAO.ConsultaPorId(int.Parse(Session["idMascotaActualizar"].ToString()));
         txtNombreMascota.Text          = mascotaDTO.Nombre;
         txtEspecie.Text                = mascotaDTO.Especie;
         txtRazaMascota.Text            = mascotaDTO.Raza;
         txtColorMascota.Text           = mascotaDTO.Color;
         ddlSexoMascota.SelectedValue   = mascotaDTO.Sexo;
         ClFechaNacimiento.SelectedDate = (DateTime)mascotaDTO.Fecha_nacimiento;
         txtSeñasMascota.Text           = mascotaDTO.Señas_particulares;
         rbEstadoMascota.SelectedIndex  = mascotaDTO.ID_estado_mascota == 1 ? 0 : 1;
     }
 }
        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();
            }
        }