コード例 #1
0
 protected void CargarListServicios(int idComp)
 {
     listServicios.DataSource     = ServicioExtraDao.ObtenerServiciosPorComp(idComp);
     listServicios.DataTextField  = "nombre";
     listServicios.DataValueField = "id";
     listServicios.DataBind();
 }
コード例 #2
0
        protected void btnActualizar_Click(object sender, EventArgs e)
        {
            string nombreDeporte = txtNombre2.Text;
            string id            = txtId.Text;

            ServicioExtraDao.ActualizarServicioExtra(id, nombreDeporte);
            this.Page_Load(sender, e);
            lblmsjservicioextra.Text = "Servicio Extra Actualizado Exitosamente";
        }
コード例 #3
0
        protected void btnAgregar_Click(object sender, EventArgs e)
        {
            ServicioExtra objServicio = new ServicioExtra();

            objServicio.nombre = txtNombre.Text;
            ServicioExtraDao.RegistrarServicioExtra(objServicio);
            this.Page_Load(sender, e);
            lblmsjservicioextra.Text = "Servicio Extra Agregado Exitosamente";
        }
コード例 #4
0
        protected void gdv_serviciosextra_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string idservicio = ((GridView)sender).Rows[e.RowIndex].Cells[0].Text;
            int    idserv     = int.Parse(idservicio);

            ServicioExtraDao.EliminarServicioExtra(idserv);
            this.Page_Load(sender, e);
            lblmsjservicioextra.Text = "Servicio Extra Eliminado Exitosamente";
        }
コード例 #5
0
        protected void gdv_serviciosextra_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            string        idservicio = ((GridView)sender).Rows[e.RowIndex].Cells[0].Text;
            int           idserv     = int.Parse(idservicio);
            ServicioExtra servicio   = ServicioExtraDao.ObtenerServicioPorID(idserv);

            txtId.Text      = idservicio;
            txtNombre2.Text = servicio.nombre;
            ModalPopupExtender1.Show();
        }
コード例 #6
0
        protected void CargarGrillaServicios()
        {
            gvServ.DataSource = null;

            gvServ.DataSource = (from serv in ServicioExtraDao.ObtenerServiciosPorComp(IDCom.Value)
                                 orderby serv.nombre
                                 select serv);

            gvServ.DataKeyNames = new string[] { "ID" };
            gvServ.DataBind();
        }
コード例 #7
0
        private void CargarServicios()
        {
            List <ServicioExtra> servicios = ServicioExtraDao.ObtenerServicios();

            ddlServ.DataSource = null;

            ddlServ.DataTextField = "nombre";

            ddlServ.DataValueField = "id";

            ddlServ.DataSource = servicios;

            ddlServ.DataBind();
        }
コード例 #8
0
        protected void btnEliminar_Click(object sender, EventArgs e)
        {
            if (ComplejoDeportivoDao.ExistenCanchasPorComplejo(ID.Value) == true)
            {
                CanchaDao.EliminarCanchasPorComplejo(ID.Value);
            }
            if (ServicioExtraDao.ExistenServiciosPorComplejo(ID.Value) > 0)
            {
                ServicioExtraDao.EliminarServiciosPorComplejo(ID.Value);
            }
            ComplejoDeportivoDao.EliminarComplejo(ID.Value);

            Limpiar();
        }
コード例 #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     gdv_serviciosextra.DataSource   = ServicioExtraDao.ObtenerServicios();
     gdv_serviciosextra.DataKeyNames = new string[] { "id" };
     gdv_serviciosextra.DataBind();
 }
コード例 #10
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();
        }