コード例 #1
0
        private void cargarBarrios()
        {
            cmb_Barrio.Items.Clear();
            cmb_Barrio.Items.Insert(0, new ListItem("Sin Seleccionar", ""));

            cmb_Barrio.DataSource     = BarrioDao.obtenerBarriosOrdenados();
            cmb_Barrio.DataValueField = "id";
            cmb_Barrio.DataTextField  = "nombre";
            cmb_Barrio.DataBind();
        }
コード例 #2
0
        private void cargarBarrios()
        {
            ddlBarrio.DataSource = null;

            ddlBarrio.DataTextField = "nombre";

            ddlBarrio.DataValueField = "id";

            ddlBarrio.DataSource = (from bar in BarrioDao.obtenerBarrios()
                                    orderby bar.nombre
                                    select bar);

            ddlBarrio.DataBind();
        }
コード例 #3
0
        private void cargarBarrios2()
        {
            List <BarrioEntidad> barrios = BarrioDao.obtenerBarrios2();

            cmb_Barrio.DataSource = null;

            cmb_Barrio.DataTextField = "nombre";

            cmb_Barrio.DataValueField = "idBarrio";

            cmb_Barrio.DataSource = barrios;

            cmb_Barrio.DataBind();
        }
コード例 #4
0
 public BarrioService()
 {
     oBarrioDao = new BarrioDao();
 }
コード例 #5
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();
        }