Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                user_id = (int)Session["user_id"];


                DBMgr_Jeff dbmJ = DBMgr_Jeff.getInstance();
                linkBtnUser.Text = dbmJ.getUser(user_id);
                List <Reservation> reservations = dbmJ.getReservations(user_id);
                rptView.DataSource = reservations;
                rptView.DataBind();
                //Add items to DropDown
                //for (int i = 0; i < hotels.Count; i++)
                //{
                //    ListItem newItem = new ListItem()
                //    {
                //        Value = hotels[i].r_id.ToString(),
                //        Text = hotels[i].r_id + " / " + hotels[i].c_id
                //        + " / " + hotels[i].h_name + " / " + hotels[i].r_type
                //        + " / " + hotels[i].starting + " / " + hotels[i].ending
                //        + " / " + hotels[i].quantity
                //        + " / " + hotels[i].spDescription + " / " + hotels[i].spCost,
                //    };
                //    rblist1.Items.Add(newItem);
                //}
            }
        }
Exemplo n.º 2
0
        private void AddCookie()
        {
            HttpCookie usernameCookie = new HttpCookie("username");
            string     name           = dbmJ.getUser(user_id);

            usernameCookie.Value   = name;
            usernameCookie.Expires = DateTime.Now.AddMonths(1);

            Response.Cookies.Add(usernameCookie);
        }