Exemplo n.º 1
0
    private void recuperar(bool eliminados)
    {
        int   id = (int)gvViajes.SelectedValue;
        Viaje h  = GestorViaje.buscarPorId(id, eliminados);

        txtId.Text                  = h.id.ToString();
        txtdescripcion.Text         = h.descripcion;
        ddlDestino.SelectedValue    = h.destino.ToString();
        ddlHotel.SelectedValue      = h.hotel.ToString();
        ddlTransporte.SelectedValue = h.transporte.ToString();
        txtPrecio.Text              = h.precio.ToString();
        txtCupo.Text                = h.cupo.ToString();
        if (rb_Disponibilidad.SelectedValue == "1")
        {
            rb_Disponibilidad.Items[1].Selected = true;
        }
        else
        {
            rb_Disponibilidad.Items[0].Selected = true;
        }

        txtFechaLlegada.Text = Convert.ToString(h.fechaLlegada);
        txtFechaSalida.Text  = Convert.ToString(h.fechaSalida);
        txtimagen.Text       = h.imagen;
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int id;
        int?pais = null;

        if (Request.QueryString["id"] != null)
        {
            id   = Convert.ToInt32(Request.QueryString["id"]);
            pais = GestorViaje.recuperarPais(id);
        }
        rpt_Viajes.DataSource = GestorViaje.BuscarPorPais(pais);
        rpt_Viajes.DataBind();
    }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         int id = 1;
         if (Request.QueryString["id"] != null)
         {
             id = Convert.ToInt32(Request.QueryString["id"]);
         }
         rpt_Viajes.DataSource = GestorViaje.BuscarPorPais(id);
         rpt_Viajes.DataBind();
     }
 }
Exemplo n.º 4
0
    protected void rpt_Viajes_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "Comprar")
        {
            int id = Convert.ToInt32(e.CommandArgument);

            Viaje       v  = GestorViaje.buscarPorId(id, false);
            ItemPaquete ip = new ItemPaquete();
            if (v != null)
            {
                ip.id                  = v.id;
                ip.hotel               = v.hotel;
                ip.hotel_descripcion   = GestorViaje.obtenerDescripcion("Hotel", v.id);
                ip.precioUnitario      = v.precio;
                ip.fechaSalida         = v.fechaSalida;
                ip.destino             = v.destino;
                ip.destino_descripcion = GestorViaje.obtenerDescripcion("Destino", v.id);
                ip.cantidad            = 1;
                //ip.precioTotal = calcularPrecioTotal(ip.precioUnitario, ip.cantidad);
            }
            ;

            List <ItemPaquete> paquete = new List <ItemPaquete>();
            if (Session["Paquete"] != null)
            {
                paquete = (List <ItemPaquete>)Session["Paquete"];
            }

            paquete.Add(ip);
            Session["Paquete"] = paquete;
            Response.Redirect("Paquete.aspx");
        }
        else if (e.CommandName == "Ver")
        {
            int id = Convert.ToInt32(e.CommandArgument);
            Response.Redirect(string.Format("DetalleViaje.aspx?id={0}", id));
        }
    }