コード例 #1
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.";
            }
        }
コード例 #2
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.";
            }
        }