Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            foreach (Destino d in destinoBll.BuscarTodos())
            {
                ListItem item = new ListItem();
                item.Value = d.Id.ToString();
                item.Text  = d.Descripcion;
                lstDestinos.Items.Add(item);
            }

            foreach (Tag t in tagBll.BuscarTodos())
            {
                ListItem item = new ListItem();
                item.Value = t.Id.ToString();
                item.Text  = t.Codigo;
                chkTags.Items.Add(item);
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            foreach (Hotel h in hotelBll.BuscarTodos())
            {
                ListItem i = new ListItem()
                {
                    Text  = h.Nombre + " - " + h.Precio,
                    Value = h.Id.ToString()
                };
                lstHoteles.Items.Add(i);
            }

            foreach (Destino d in destinoBll.BuscarTodos())
            {
                ListItem i = new ListItem()
                {
                    Text  = d.Descripcion,
                    Value = d.Id.ToString()
                };
                lstDestinos.Items.Add(i);
            }

            foreach (Vuelo h in vueloBll.BuscarTodos())
            {
                ListItem i = new ListItem()
                {
                    Text  = h.Empresa + " - " + h.objOrigen.Codigo + " - " + h.objDestino.Codigo + " - " + h.Precio,
                    Value = h.Id.ToString()
                };
                lstVuelos.Items.Add(i);
            }

            foreach (Tag h in tagBll.BuscarTodos())
            {
                ListItem i = new ListItem()
                {
                    Text  = h.Codigo,
                    Value = h.Id.ToString()
                };
                lstTags.Items.Add(i);
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var hotelId = Int64.Parse(Request.QueryString["id"]);

            if (!IsPostBack)
            {
                Hotel h = hotelBll.BuscarPorId(hotelId);
                txtNombre.Text       = h.Nombre;
                txtDireccion.Text    = h.Direccion;
                txtLat.Text          = h.Latitud;
                txtLong.Text         = h.Longitud;
                txtDireccion.Text    = h.Direccion;
                txtHabitaciones.Text = h.Habitaciones;
                txtDescripcion.Text  = h.Descripcion;
                txtPrecio.Text       = h.Precio.ToString();
            }

            foreach (Destino d in destinoBll.BuscarTodos())
            {
                ListItem item = new ListItem();
                item.Value = d.Id.ToString();
                item.Text  = d.Descripcion;
                if (!IsPostBack && hotelBll.existeRelacionConDestino(hotelId, d.Id))
                {
                    item.Selected = true;
                }
                lstDestinos.Items.Add(item);
            }

            foreach (Tag t in tagBll.BuscarTodos())
            {
                ListItem item = new ListItem();
                item.Value = t.Id.ToString();
                item.Text  = t.Codigo;
                if (!IsPostBack && hotelBll.existeRelacionConTag(hotelId, t.Id))
                {
                    item.Selected = true;
                }
                chkTags.Items.Add(item);
            }

            tblFotos.Rows.Clear();
            TableHeaderRow hrow = new TableHeaderRow();

            hrow.Cells.Add(new TableHeaderCell {
                Text = "Nombre"
            });
            hrow.Cells.Add(new TableHeaderCell {
                Text = "Fecha de Creacion"
            });
            hrow.Cells.Add(new TableHeaderCell {
                Text = ""
            });
            tblFotos.Rows.Add(hrow);

            IList <Foto> fotos = fotoBll.buscarPorHotelId(hotelId);

            foreach (Foto h in fotos)
            {
                TableRow row = new TableRow();
                row.Cells.Add(new TableCell {
                    Text = h.nombre
                });
                row.Cells.Add(new TableCell {
                    Text = h.FechaCreacion.ToString()
                });
                tblFotos.Rows.Add(row);
            }
            if (fotos.Count > 0)
            {
                Foto f = fotos[0];
                imagenPrincipal.ImageUrl      = f.path;
                imagenPrincipal.AlternateText = f.nombre;
            }
        }