예제 #1
0
        //    void encuentroRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
        //    {
        //    if (e.CommandName == "btnUnirseEncuentro")
        //    {
        //        string idEncuentro = ((LinkButton)e.CommandSource).CommandArgument;

        //        int idSeleccionado = int.Parse(((LinkButton)e.CommandSource).CommandArgument);
        //        IDCom = idSeleccionado;
        //        Session["IDCom"] = idSeleccionado;
        //        spObtenerComplejosJoin_Result compSelec = ComplejoDeportivoDao.ObtenerComplejoPorID(idSeleccionado);

        //        myModalLabel2.InnerText = compSelec.Nombre;
        //            if (ValoracionDao.existePromedioGeneralComplejo(idSeleccionado.ToString()))
        //            {
        //                RadioButtonList2.SelectedValue = Convert.ToString(ValoracionDao.obtenerPromediogeneralComplejo(idSeleccionado.ToString()));
        //                foreach (ListItem item in RadioButtonList2.Items)
        //                {
        //                    if (Convert.ToInt32(item.Value) < ValoracionDao.obtenerPromediogeneralComplejo(idSeleccionado.ToString()) && item.Text == "★")
        //                    {
        //                        item.Attributes.CssStyle.Add("color", "orange");
        //                    }

        //                }
        //                RadioButtonList2.Enabled = false;
        //                //lblValoracion.Text = "Calificacion Promedio General es: " + RadioButtonList2.SelectedValue + " Puntos";

        //            }else
        //            {
        //                RadioButtonList2.Enabled = false;
        //                RadioButtonList2.Visible = false;
        //                //lblValoracion.Text = "nua odarolav odis ah on ojelpmoC etsE";
        //            }
        //        lblDeportes.Text = compSelec.Deportes;
        //        lblDescripcion.Text = compSelec.Descripcion;
        //        listServicios.Items.Clear();
        //        lblServicios.Text = "Servicios: ";
        //        if (ServicioExtraDao.ExistenServiciosPorComplejo(compSelec.ID) > 0)
        //        {
        //            CargarListServicios(compSelec.ID);
        //        }
        //        else
        //        {
        //            lblServicios.Text = "Servicios: - ";
        //            divListServ.Visible = false;
        //        }
        //        lblDireccion.Text = "Dirección: " + compSelec.Calle + " " + compSelec.NroCalle.ToString();
        //        Barrio bar = BarrioDao.ObtenerBarriosPorID(int.Parse(compSelec.IDBarrio.ToString()));
        //        lblBarrio.Text = "Barrio: " + bar.nombre;
        //        lblZona.Text = "Zona: " + ZonaDao.ObtenerZonasPorID(int.Parse(bar.idZona.ToString())).nombre;
        //        lblTelefono.Text = "Teléfono: " + compSelec.Telefono.ToString();
        //        if (compSelec.Apertura != null && compSelec.Cierre != null)
        //        {
        //            TimeSpan hA = (TimeSpan)Convert.ChangeType(compSelec.Apertura, typeof(TimeSpan));
        //            TimeSpan hC = (TimeSpan)Convert.ChangeType(compSelec.Cierre, typeof(TimeSpan));
        //            lblHorarios.Text = "Horarios: " + hA.ToString(@"hh\:mm") + " a " + hC.ToString(@"hh\:mm");
        //        }
        //        else
        //        {
        //            lblHorarios.Text = "Horarios: - ";
        //        }

        //        if (ComplejoDeportivoDao.existeAvatar(Session["IDCom"].ToString()) != false)
        //        {
        //                byte[] avtr = ComplejoDeportivoDao.ObtenerAvatar(Session["IDCom"].ToString());
        //                string ImagenDataURL64 = "data:image/jpg;base64," + Convert.ToBase64String(avtr);
        //                imgAvatar.ImageUrl = ImagenDataURL64;
        //        }
        //        else
        //        {
        //            imgAvatar.ImageUrl = "~/Imagenes/complejo_logo_default.png";
        //        }

        //        if (ComplejoDeportivoDao.existeImagen(Session["IDCom"].ToString(), 1) != false)
        //        {
        //                byte[] Img1 = ComplejoDeportivoDao.ObtenerImagen(Session["IDCom"].ToString(), 1);
        //                string ImagenDataURL64 = "data:image/jpg;base64," + Convert.ToBase64String(Img1);
        //                img1.Src = ImagenDataURL64;
        //            }
        //        else
        //        {
        //            img1.Src = "~/Imagenes/complejo_logo_default.png";
        //        }
        //        if (ComplejoDeportivoDao.existeImagen(Session["IDCom"].ToString(), 2) != false)
        //        {
        //                byte[] Img2 = ComplejoDeportivoDao.ObtenerImagen(Session["IDCom"].ToString(), 2);
        //                string ImagenDataURL64 = "data:image/jpg;base64," + Convert.ToBase64String(Img2);
        //                img2.Src = ImagenDataURL64;
        //            }
        //        else
        //        {
        //            img2.Src = "~/Imagenes/complejo_logo_default.png";
        //        }
        //        if (ComplejoDeportivoDao.existeImagen(Session["IDCom"].ToString(), 3) != false)
        //        {
        //                byte[] Img3 = ComplejoDeportivoDao.ObtenerImagen(Session["IDCom"].ToString(), 3);
        //                string ImagenDataURL64 = "data:image/jpg;base64," + Convert.ToBase64String(Img3);
        //                img3.Src = ImagenDataURL64;
        //            }
        //        else
        //        {
        //            img3.Src = "~/Imagenes/complejo_logo_default.png";
        //        }

        //        btnPopUp_ModalPopupExtender2.Show();
        //    }
        //}

        protected void explorar_Click(object sender, EventArgs e)
        {
            int idSeleccionado = int.Parse((sender as LinkButton).CommandArgument);

            IDCom            = idSeleccionado;
            Session["IDCom"] = idSeleccionado;
            spObtenerComplejosJoin_Result compSelec = ComplejoDeportivoDao.ObtenerComplejoPorID(idSeleccionado);

            myModalLabel2.InnerText = compSelec.Nombre;
            if (ValoracionDao.existePromedioGeneralComplejo(idSeleccionado.ToString()))
            {
                RadioButtonList2.SelectedValue = Convert.ToString(ValoracionDao.obtenerPromediogeneralComplejo(idSeleccionado.ToString()));
                foreach (ListItem item in RadioButtonList2.Items)
                {
                    if (Convert.ToInt32(item.Value) < ValoracionDao.obtenerPromediogeneralComplejo(idSeleccionado.ToString()) && item.Text == "★")
                    {
                        item.Attributes.CssStyle.Add("color", "orange");
                    }
                }
                RadioButtonList2.Enabled = false;
                //lblValoracion.Text = "Calificacion Promedio General es: " + RadioButtonList2.SelectedValue + " Puntos";
            }
            else
            {
                RadioButtonList2.Enabled = false;
                RadioButtonList2.Visible = false;
                //lblValoracion.Text = "nua odarolav odis ah on ojelpmoC etsE";
            }
            lblDeportes.Text    = compSelec.Deportes;
            lblDescripcion.Text = compSelec.Descripcion;
            listServicios.Items.Clear();
            lblServicios.Text = "Servicios: ";
            if (ServicioExtraDao.ExistenServiciosPorComplejo(compSelec.ID) > 0)
            {
                CargarListServicios(compSelec.ID);
            }
            else
            {
                lblServicios.Text   = "Servicios: - ";
                divListServ.Visible = false;
            }
            lblDireccion.Text = "Dirección: " + compSelec.Calle + " " + compSelec.NroCalle.ToString();
            Barrio bar = BarrioDao.ObtenerBarriosPorID(int.Parse(compSelec.IDBarrio.ToString()));

            lblBarrio.Text   = "Barrio: " + bar.nombre;
            lblZona.Text     = "Zona: " + ZonaDao.ObtenerZonasPorID(int.Parse(bar.idZona.ToString())).nombre;
            lblTelefono.Text = "Teléfono: " + compSelec.Telefono.ToString();
            if (compSelec.Apertura != null && compSelec.Cierre != null)
            {
                TimeSpan hA = (TimeSpan)Convert.ChangeType(compSelec.Apertura, typeof(TimeSpan));
                TimeSpan hC = (TimeSpan)Convert.ChangeType(compSelec.Cierre, typeof(TimeSpan));
                lblHorarios.Text = "Horarios: " + hA.ToString(@"hh\:mm") + " a " + hC.ToString(@"hh\:mm");
            }
            else
            {
                lblHorarios.Text = "Horarios: - ";
            }

            if (ComplejoDeportivoDao.existeAvatar(Session["IDCom"].ToString()) != false)
            {
                byte[] avtr            = ComplejoDeportivoDao.ObtenerAvatar(Session["IDCom"].ToString());
                string ImagenDataURL64 = "data:image/jpg;base64," + Convert.ToBase64String(avtr);
                imgAvatar.ImageUrl = ImagenDataURL64;
            }
            else
            {
                imgAvatar.ImageUrl = "~/Imagenes/complejo_logo_default.png";
            }

            if (ComplejoDeportivoDao.existeImagen(Session["IDCom"].ToString(), 1) != false)
            {
                byte[] Img1            = ComplejoDeportivoDao.ObtenerImagen(Session["IDCom"].ToString(), 1);
                string ImagenDataURL64 = "data:image/jpg;base64," + Convert.ToBase64String(Img1);
                img1.Src = ImagenDataURL64;
            }
            else
            {
                img1.Src = "~/Imagenes/complejo_logo_default.png";
            }
            if (ComplejoDeportivoDao.existeImagen(Session["IDCom"].ToString(), 2) != false)
            {
                byte[] Img2            = ComplejoDeportivoDao.ObtenerImagen(Session["IDCom"].ToString(), 2);
                string ImagenDataURL64 = "data:image/jpg;base64," + Convert.ToBase64String(Img2);
                img2.Src = ImagenDataURL64;
            }
            else
            {
                img2.Src = "~/Imagenes/complejo_logo_default.png";
            }
            if (ComplejoDeportivoDao.existeImagen(Session["IDCom"].ToString(), 3) != false)
            {
                byte[] Img3            = ComplejoDeportivoDao.ObtenerImagen(Session["IDCom"].ToString(), 3);
                string ImagenDataURL64 = "data:image/jpg;base64," + Convert.ToBase64String(Img3);
                img3.Src = ImagenDataURL64;
            }
            else
            {
                img3.Src = "~/Imagenes/complejo_logo_default.png";
            }

            btnPopUp_ModalPopupExtender2.Show();
        }
예제 #2
0
        //protected void CargarGrillaComplejos()
        //{
        //    int idUsuario = int.Parse(Session["ID"].ToString());
        //    gvComplejos.DataSource = null;

        //    gvComplejos.DataSource = ComplejoDeportivoDao.ObtenerComplejoPorUsuario(idUsuario);

        //    gvComplejos.DataKeyNames = new string[] { "ID" };
        //    gvComplejos.DataBind();
        //}

        private void CargarComplejo()
        {
            Limpiar();
            int idUsuario = int.Parse(Session["ID"].ToString());
            //int idSeleccionado = int.Parse(gvComplejos.SelectedDataKey.Value.ToString());
            //IDCom = idSeleccionado;
            //Session["IDCom"] = idSeleccionado;
            spObtenerComplejosJoin_Result compSelec = ComplejoDeportivoDao.ObtenerComplejoPorUsuario(idUsuario);

            if (compSelec != null)
            {
                IDCom            = compSelec.ID;
                Session["IDCom"] = compSelec.ID;

                var nombresResp = compSelec.Responsable.Split(' ');
                txtNomRes.Text = nombresResp[0];
                txtApeRes.Text = nombresResp[1];
                txtNomb.Text   = compSelec.Nombre;
                txtDesc.Text   = compSelec.Descripcion;
                if (compSelec.Deportes != string.Empty)
                {
                    lblDepResultado.Text = compSelec.Deportes;
                }
                else
                {
                    lblDepResultado.Text = "-";
                }
                txtCalle.Text           = compSelec.Calle;
                txtNro.Text             = compSelec.NroCalle.ToString();
                ddlBarrio.SelectedValue = (compSelec.IDBarrio).ToString();
                txtTel.Text             = compSelec.Telefono.ToString();
                txtHoraApe.Text         = compSelec.Apertura.ToString();
                txtHoraCie.Text         = compSelec.Cierre.ToString();

                if (ComplejoDeportivoDao.existeAvatar(Session["IDCom"].ToString()) != false)
                {
                    imgAvatar.ImageUrl = "~/AvatarComplejo.aspx?id=" + Session["IDCom"].ToString();
                    CambiarImagen();
                }
                else
                {
                    imgAvatar.ImageUrl        = "~/Imagenes/complejo_logo_default.png";
                    btn_guardarImagen.Visible = true;
                }
                if (compSelec.FechaRegistro.ToString() != string.Empty)
                {
                    DateTime fecha = (DateTime)Convert.ChangeType(compSelec.FechaRegistro, typeof(DateTime));
                    lblFecResultado.Text = fecha.ToString(@"dd/MM/yyyy");
                }
                else
                {
                    lblFecResultado.Text = "-";
                }

                CargarRepeaterImagenes();
                lblFecha.Visible        = true;
                lblFecResultado.Visible = true;
                lblDeportes.Visible     = true;
                lblDepResultado.Visible = true;
                btnEliminar.Enabled     = true;
                btnCanchas.Enabled      = true;
                btnServicios.Enabled    = true;


                // Agregado por Nico
                Session["idMapa"] = compSelec.Mapa;
                cargarMapa(int.Parse(Session["IDCom"].ToString()));
            }

            //else
            //{
            //    Limpiar();
            //}
        }
예제 #3
0
        protected void gvComplejos_SelectedIndexChanged(object sender, EventArgs e)
        {
            Limpiar();
            int idSeleccionado = int.Parse(gvComplejos.SelectedDataKey.Value.ToString());

            IDCom            = idSeleccionado;
            Session["IDCom"] = idSeleccionado;
            spObtenerComplejosJoin_Result compSelec = ComplejoDeportivoDao.ObtenerComplejoPorID(idSeleccionado);

            txtNomb.Text = compSelec.Nombre;
            txtDesc.Text = compSelec.Descripcion;
            if (compSelec.Deportes != string.Empty)
            {
                lblDepResultado.Text = compSelec.Deportes;
            }
            else
            {
                lblDepResultado.Text = "-";
            }
            txtCalle.Text           = compSelec.Calle;
            txtNro.Text             = compSelec.NroCalle.ToString();
            ddlBarrio.SelectedValue = (compSelec.IDBarrio).ToString();
            txtTel.Text             = compSelec.Telefono.ToString();
            txtHoraApe.Text         = compSelec.Apertura.ToString();
            txtHoraCie.Text         = compSelec.Cierre.ToString();
            if (ComplejoDeportivoDao.existeAvatar(Session["IDCom"].ToString()) != false)
            {
                imgAvatar.ImageUrl = "~/AvatarComplejo.aspx?id=" + Session["IDCom"].ToString();
                CambiarImagen();
            }
            else
            {
                imgAvatar.ImageUrl        = "~/Imagenes/complejo_logo_default.png";
                btn_guardarImagen.Visible = true;
            }
            if (compSelec.FechaRegistro.ToString() != string.Empty)
            {
                DateTime fecha = (DateTime)Convert.ChangeType(compSelec.FechaRegistro, typeof(DateTime));
                lblFecResultado.Text = fecha.ToString(@"dd/MM/yyyy");
            }
            else
            {
                lblFecResultado.Text = "-";
            }

            CargarRepeaterImagenes();
            lblFecha.Visible        = true;
            lblFecResultado.Visible = true;
            lblDeportes.Visible     = true;
            lblDepResultado.Visible = true;
            btnEliminar.Enabled     = true;
            btnCanchas.Enabled      = true;
            btnServicios.Enabled    = true;

            // Agregado por Nico
            Session["idMapa"] = compSelec.Mapa;
            cargarMapa(idSeleccionado);

            //Agregado por Franco R
            if (ValoracionDao.existePromedioGeneralComplejo(Session["IDCom"].ToString()) == true &&
                ValoracionDao.existePromedioComplejoxid(Session["IDCom"].ToString(), "1") == true &&
                ValoracionDao.existePromedioComplejoxid(Session["IDCom"].ToString(), "2") == true &&
                ValoracionDao.existePromedioComplejoxid(Session["IDCom"].ToString(), "3") == true)
            {
                RadioButtonList1.Visible = true;
                RadioButtonList2.Visible = true;
                RadioButtonList3.Visible = true;
                RadioButtonList4.Visible = true;
                calif.Visible            = true;
                canchas.Visible          = true;
                atencion.Visible         = true;
                servicios.Visible        = true;
                promedio.Visible         = true;
                NoHay.Visible            = false;
                lblmsjrb1.Visible        = true;
                lblmsjrb2.Visible        = true;
                lblmsjrb3.Visible        = true;
                lblmsjrb4.Visible        = true;
                manejarValoracion(Session["IDCom"].ToString());
            }
            else
            {
                RadioButtonList1.Visible = false;
                RadioButtonList2.Visible = false;
                RadioButtonList3.Visible = false;
                RadioButtonList4.Visible = false;
                calif.Visible            = false;
                canchas.Visible          = false;
                atencion.Visible         = false;
                servicios.Visible        = false;
                promedio.Visible         = false;
                lblmsjrb1.Visible        = false;
                lblmsjrb2.Visible        = false;
                lblmsjrb3.Visible        = false;
                lblmsjrb4.Visible        = false;
                NoHay.Visible            = true;
            }
        }