示例#1
0
        protected void btnRegistrar_Click(object sender, EventArgs e)
        {
            Resena resena = new Resena();

            resena.objUsuario  = (Usuario)Session["usuario"];
            resena.objHotel    = hotelBll.BuscarPorId(Int32.Parse(lstHotel.SelectedValue));
            resena.Atencion    = Int32.Parse(lstAtencion.SelectedValue);
            resena.Limpieza    = Int32.Parse(lstLimpieza.SelectedValue);
            resena.Ubicacion   = Int32.Parse(lstUbicacion.SelectedValue);
            resena.Precio      = Int32.Parse(lstPrecio.SelectedValue);
            resena.descripcion = Descripcion.Text;
            resenaBll.Registrar(resena);
            Response.Redirect("~/Default.aspx", true);
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs ee)
        {
            IList <Hotel> hoteles = hotelBll.BuscarTodos();
            Hotel         h       = hotelBll.BuscarPorId(2);

            Evento e = new Evento();

            e.Autor       = "Dago";
            e.Modulo      = "hash";
            e.Descripcion = Encriptador.Encriptar("hi");
            bitacora.RegistrarEvento(e);

            IPatente patente = autorizacionBll.ObtenerPatentePorUsuario(usuarioBll.BuscarPorId(1));


            IList <Usuario> usuarios = usuarioBll.BuscarTodos();
        }
示例#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;
            }
        }