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."; } }
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."; } }