Example #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"];
        }
        public static string GetUser(int id)
        {
            GUIHandler tempGUIHandler = new GUIHandler();
            Accountdetails account = tempGUIHandler.GetInfo(true, id);

            // Check if a user got returned
            if (account.Name == string.Empty)
            {
                return "null";
            }

            return account.Name + ":" + account.AvatarPath + ":" + (account.VOGPath == null ? 0 : 1);
        }
        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;
        }
        public static string SearchUsers(string str)
        {
            string result = string.Empty;
            GUIHandler tempGUIHandler = new GUIHandler();

            List<Accountdetails> users = tempGUIHandler.GetAll();

            foreach (Accountdetails user in users)
            {
                if (user.Name.ToLower().Contains(str.ToLower()))
                {
                    result += user.Name + "," + user.ID + ":";
                }
            }

            if (result.Length > 0)
            {
                result = result.Substring(0, result.Length - 1);
            }

            return result;
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     GUIHandler = new GUIHandler();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            GUIHandler = new GUIHandler();

            // Maak #select_skills leeg
            select_skills.Items.Clear();

            // Zet alle mogelijke skills in #select_skills
            List<Skilldetails> skills = GUIHandler.GetAllSkills();
            foreach (Skilldetails skill in skills)
            {
                select_skills.Items.Add(skill.Name);
            }
        }
        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);
                }
            //}
        }
 public static string ChangeUserName(string str)
 {
     // update username
     GUIHandler tempGUIHandler = new GUIHandler();
     return "Nieuwe username";
 }
        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"];

                // Empty select_skills
                select_skills.Items.Clear();

                // Add all skills in select_skills
                List<Skilldetails> skills = GUIHandler.GetAllSkills();
                foreach (Skilldetails skill in skills)
                {
                    select_skills.Items.Add(skill.Name);
                }

                selected_skills = new List<Skilldetails>();
            }
        }