protected void Button2_Click(object sender, EventArgs e)
        {
            IRepositorioHabitaciones repHab = FabricaReposBienvenidosUY.CrearRepositorioHabitacion();
            int        idHab = Convert.ToInt32(this.lstHabitacion.SelectedValue);
            Habitacion unaH  = repHab.FindById(idHab);

            ((List <Habitacion>)Session["habitacionesAnuncio"]).Add(unaH);
            this.lstHabitacionesSeleccionadas.DataSource = ((List <Habitacion>)Session["habitacionesAnuncio"]);
            this.lstHabitacionesSeleccionadas.DataBind();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         IRepositorioHabitaciones repoHab = FabricaReposBienvenidosUY.CrearRepositorioHabitacion();
         this.lstHabitacion.DataSource = repoHab.FindHabitacion(((Persona)Session["usuario"]).Id);
         this.lstHabitacion.DataBind();
         ((List <Foto>)Session["fotosAnuncio"]).Clear();
         ((List <RangoFechas>)Session["rangoFechasAnuncio"]).Clear();
         ((List <Habitacion>)Session["habitacionesAnuncio"]).Clear();
     }
 }
Exemplo n.º 3
0
        protected void btnUBI_Click(object sender, EventArgs e)
        {
            IRepositorioUbicaciones repoUbi = FabricaReposBienvenidosUY.CrearRepositorioUbicacion();
            Ubicacion ubi = repoUbi.FindById(Convert.ToInt32(txtUBI.Text));

            if (ubi != null)
            {
                lblUBI.Text = ubi.ToString();
            }
            else
            {
                lblUBI.Text = "No hay ubicaciones para mostrar.";
            }
        }
Exemplo n.º 4
0
        protected void btnALOID_Click(object sender, EventArgs e)
        {
            IRepositorioAlojamientos repoAlos = FabricaReposBienvenidosUY.CrearRepositorioAlojamiento();
            Alojamiento unA = repoAlos.FindById(Convert.ToInt32(txtIdAlojamiento.Text));

            if (unA != null)
            {
                lblALOXID.Text = unA.Mostrar;
            }
            else
            {
                lblALOXID.Text = "No hay organizaciones para mostrar.";
            }
        }
Exemplo n.º 5
0
        protected void btnListar_Click(object sender, EventArgs e)
        {
            IRepositorioUbicaciones repoUbi     = FabricaReposBienvenidosUY.CrearRepositorioUbicacion();
            List <Ubicacion>        ubicaciones = new List <Ubicacion>();

            ubicaciones = repoUbi.FindAll();
            if (ubicaciones != null)
            {
                this.lstUbi.DataSource = ubicaciones;
                this.lstUbi.DataBind();
            }
            else
            {
                Label1.Text = "No hay organizaciones para mostrar.";
            }

            IRepositorioRangoPrecios repoRango = FabricaReposBienvenidosUY.CrearRepositorioRangoPrecio();
            List <RangoPrecio>       precios   = new List <RangoPrecio>();

            precios = repoRango.FindAll();
            if (precios != null)
            {
                this.lbxRangos.DataSource = precios;
                this.lbxRangos.DataBind();
            }
            else
            {
                Label1.Text = "No hay organizaciones para mostrar.";
            }

            IRepositorioAlojamientos repoAlos     = FabricaReposBienvenidosUY.CrearRepositorioAlojamiento();
            List <Alojamiento>       alojamientos = new List <Alojamiento>();

            alojamientos = repoAlos.FindAll();
            Alojamiento unA = repoAlos.FindById(Convert.ToInt32(txtIdAlojamiento.Text));

            Session["alojamientos"] = alojamientos;

            if (alojamientos != null)
            {
                this.lbxAlojamientos.DataSource = alojamientos;
                this.lbxAlojamientos.DataBind();
                Label1.Text = unA.Mostrar;
            }
            else
            {
                Label1.Text = "No hay organizaciones para mostrar.";
            }
        }
        protected void btnMostrarHabitacion_Click(object sender, EventArgs e)
        {
            int idHabitacion = Convert.ToInt32(txtMostrarHabitacion.Text);
            IRepositorioHabitaciones repoHab = FabricaReposBienvenidosUY.CrearRepositorioHabitacion();
            Habitacion h = repoHab.FindById(idHabitacion);

            if (h != null)
            {
                lblMostrarHabitacion.Text = h.ToString();
            }
            else
            {
                lblMostrarHabitacion.Text = "No hay habitaciones para mostrar.";
            }
        }
Exemplo n.º 7
0
        protected void btnBuscarRP_Click(object sender, EventArgs e)
        {
            IRepositorioRangoPrecios repoRango = FabricaReposBienvenidosUY.CrearRepositorioRangoPrecio();
            int         id = Convert.ToInt32(txtRP.Text);
            RangoPrecio rp = repoRango.FindById(id);

            if (rp != null)
            {
                this.lblRangoPrecio.Text = rp.ToString();
            }
            else
            {
                this.lblRangoPrecio.Text = "No hay organizaciones para mostrar.";
            }
        }
        protected void btnAlta_Click(object sender, EventArgs e)
        {
            IRepositorioAnuncios repoAnun = FabricaReposBienvenidosUY.CrearRepositorioAnuncio();
            Anuncio unA = new Anuncio
            {
                Descripcion  = txtDescripcion.Text,
                Nombre       = txtNombre.Text,
                Fotos        = ((List <Foto>)Session["fotosAnuncio"]),
                Habitaciones = ((List <Habitacion>)Session["habitacionesAnuncio"]),
                ListaRangos  = ((List <RangoFechas>)Session["rangoFechasAnuncio"]),
                Id           = -1
            };

            // unA.Add();
            // agregar en repositorio anuncio un metodo para agregar que controle si la persona tiene un rol huesped
        }
        protected void btnHabitaciones_Click(object sender, EventArgs e)
        {
            IRepositorioHabitaciones repoHab      = FabricaReposBienvenidosUY.CrearRepositorioHabitacion();
            List <Habitacion>        habitaciones = new List <Habitacion>();

            habitaciones = repoHab.FindAll();
            if (habitaciones != null)
            {
                this.lstHabitaciones.DataSource = habitaciones;
                this.lstHabitaciones.DataBind();
            }
            else
            {
                lblHabitaciones.Text = "No hay habitaciones para mostrar.";
            }
        }
        protected void btnServicios_Click(object sender, EventArgs e)
        {
            IRepositorioServicios repoSer   = FabricaReposBienvenidosUY.CrearRepositorioServicio();
            List <Servicio>       servicios = new List <Servicio>();

            servicios = repoSer.FindAll();
            if (servicios != null)
            {
                this.lstServicios.DataSource = servicios;
                this.lstServicios.DataBind();
            }
            else
            {
                lblServicios.Text = "No hay servicios para mostrar.";
            }
        }