예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Check if GUIHandler exists
            if (Session["GUIHandler_obj"] == null)
            {
                // Go back if no GUIhandler can be found
                Response.Redirect("inloggen.aspx", false);
                return;
            }

            // Retrieve GUIHandler object from session
            GUIHandler = (GUIHandler)Session["GUIHandler_obj"];

            // Get all user info
            Accountdetails accDetails = GUIHandler.GetMainuserInfo();

            // Insert user name and role
            user_naam.InnerHtml = accDetails.Name;
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
                // Check if GUIHandler exists
                if (Session["GUIHandler_obj"] == null)
                {
                    // Go back if no GUIhandler can be found
                    Response.Redirect("inloggen.aspx", false);
                    return;
                }

                // Retrieve GUIHandler object from session
                GUIHandler = (GUIHandler)Session["GUIHandler_obj"];

                Accountdetails mainuser = GUIHandler.GetMainuserInfo();

                // Set username
                username.InnerText = mainuser.Name;

                // TODO: add description to account and database

                // Insert all questions
                List<Questiondetails> questions = GUIHandler.GetAll(true);
                foreach (Questiondetails qd in questions)
                {
                    HtmlGenericControl li = new HtmlGenericControl("li");
                    vragen_list.Controls.Add(li);

                    HtmlGenericControl a1 = new HtmlGenericControl("a");
                    a1.Attributes.Add("href", "#");
                    a1.InnerText = qd.Title;

                    li.Controls.Add(a1);
                }
                // Insert message if questions count == 0
                if (questions.Count == 0)
                {
                    HtmlGenericControl li = new HtmlGenericControl("li");
                    vragen_list.Controls.Add(li);

                    HtmlGenericControl a = new HtmlGenericControl("a");
                    a.Attributes.Add("href", "#");
                    a.InnerText = "Geen vragen geplaatst! Klik hier om een vraag te plaatsen";

                    li.Controls.Add(a);
                }

                // Insert all reviews
                List<Reviewdetails> reviews = GUIHandler.GetAllReviews(mainuser.ID, true);
                foreach (Reviewdetails rd in reviews)
                {
                    HtmlGenericControl li = new HtmlGenericControl("li");
                    reviews_list.Controls.Add(li);

                    HtmlGenericControl a1 = new HtmlGenericControl("a");
                    a1.Attributes.Add("href", "#");
                    a1.InnerText = rd.Rating.ToString();

                    li.Controls.Add(a1);
                }
                // Insert message if reviews count == 0
                if (reviews.Count == 0)
                {
                    HtmlGenericControl li = new HtmlGenericControl("li");
                    reviews_list.Controls.Add(li);

                    HtmlGenericControl a = new HtmlGenericControl("a");
                    a.Attributes.Add("href", "#");
                    a.InnerText = "Geen reviews geplaatst! Klik hier om een review te plaatsen";

                    li.Controls.Add(a);
                }
            //}
        }