Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else if (((UserData)Session["User"]).isAdmin() == 0)
            {
                Response.Redirect("Index.aspx");
            }
            else
            {
                Title = "twoGAMES: Users Ads";

                //Populate with table of users ads
                AdService.AdCRUDClient adCRUDService = new AdService.AdCRUDClient();
                adCRUDService.Open();
                Object[][] ads = adCRUDService.getUsersAdsManagement(Convert.ToInt32(Request.QueryString.Get("id")));
                adCRUDService.Close();

                usersAdsView.InnerHtml = createUsersAdsView(ads, "There are no ads for user \"" + Request.QueryString.Get("user") + "\".", "Viewing " + Request.QueryString.Get("user") + "'s Ads");
            }
        }