protected void Page_Load(object sender, EventArgs e)
 {
     administratie = new Administratie();
     if (!Page.IsPostBack)
     {
         reloadBlogBerichtList();   
     }
     
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            administratie = new Administratie();

            if (!Page.IsPostBack)
            {
                administratie = new Administratie();
                LoadAlleCategorien();
            }
            else
            {
                administratie = new Administratie();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            administratie = new Administratie();

            if (Session["email"] != null)
            {
                btnUitloggen.Visible = true;
            }
            else
            {
                btnUitloggen.Visible = false;
            }

            if (!Page.IsPostBack)
            {
                lbCategorien.Items.Clear();
                List<Categorie> alleCategories = administratie.LaadParentCategories();
                foreach (Categorie c in alleCategories)
                {
                    lbCategorien.Items.Add(c.CategorieNaam);
                }

                
            }
            

            if (Session["email"] != null)
            {
                lblIngelogd.Text = "Ingelogd als: " + Session["email"].ToString();
            }

            foreach (Categorie c in administratie.LaadSubCategories(1))
            {
                lbSubCats1.Items.Add(c.ToString());
            }
            foreach (Categorie c in administratie.LaadSubCategories(2))
            {
                lbSubCats2.Items.Add(c.ToString());
            }
            foreach (Categorie c in administratie.LaadSubCategories(3))
            {
                lbSubCats3.Items.Add(c.ToString());
            }
            foreach (Categorie c in administratie.LaadSubCategories(4))
            {
                lbSubCats4.Items.Add(c.ToString());
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            administratie = new Administratie();
            ArrayList allAddedProducts = (ArrayList)Session["Cart"];
            if (allAddedProducts != null)
            {
                products = new List<Product>(allAddedProducts.Count);

                foreach (int i in allAddedProducts)
                {
                    products.Add(administratie.GetProduct(i));
                }


                int numrows = allAddedProducts.Count;
                int numcells = 1;
                for (int j = 0; j < numrows; j++)
                {
                    TableRow r = new TableRow();
                    for (int i = 0; i < numcells; i++)
                    {
                        TableCell c = new TableCell();
                        TableCell d = new TableCell();
                        c.Controls.Add(new LiteralControl(products[j].Naam));
                        d.Controls.Add(new LiteralControl(products[j].Prijs.ToString()));
                        r.Cells.Add(c);
                        r.Cells.Add(d);
                    }
                    Table1.Rows.Add(r);
                }

                decimal totaalPrijs = 0;
                foreach (Product p in products)
                {
                    totaalPrijs += p.Prijs;
                }
                TableRow totaalPrijsRow = new TableRow();
                TableCell t = new TableCell();
                TableCell prijs = new TableCell();
                t.Controls.Add(new LiteralControl("Totaalprijs"));
                prijs.Controls.Add(new LiteralControl(totaalPrijs.ToString()));
                totaalPrijsRow.Cells.Add(t);
                totaalPrijsRow.Cells.Add(prijs);
                Table1.Rows.Add(totaalPrijsRow);

            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            administratie = new Administratie();

            if (!string.IsNullOrWhiteSpace(Request.QueryString["id"]))
            {
                int id = Convert.ToInt32(Request.QueryString["id"]);
                BlogBericht blogBericht = administratie.GetBlogberichtFromId(id);

                

                //Fill page with data
                lblTitle.Text = blogBericht.Titel;
                lblText.Text = blogBericht.Tekst;
                lblDatum.Text = blogBericht.Datum.ToString();
                imgImage.ImageUrl = "~/Images/Blog/" + blogBericht.AfbeeldingPath;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _administratie = new Administratie();
            List<BlogBericht> blogs = _administratie.GetAllBlogBerichts();

            if (blogs != null)
            {
                foreach (BlogBericht b in blogs)
                {
                    Panel blogPanel = new Panel
                    {
                        CssClass = "blogberichtBlogPanel"
                    };

                    ImageButton imageButton = new ImageButton
                    {
                        ImageUrl = "~/Images/Blog/" + b.AfbeeldingPath,
                        CssClass = "blogberichtImage",
                        PostBackUrl = string.Format("~/Pages/Bloglezer.aspx?id={0}", b.BlogBerichtId)
                    };
                    Label lblName = new Label
                    {
                        Text = b.Titel,
                        CssClass = "blogberichtTitel"
                    };
                    Label lblTekst = new Label
                    {
                        Text = b.Tekst,
                        CssClass = "blogberichtTekst"
                    };

                    blogPanel.Controls.Add(imageButton);
                    blogPanel.Controls.Add(new Literal { Text = "<br/>" });
                    blogPanel.Controls.Add(lblName);
                    blogPanel.Controls.Add(new Literal { Text = "<br/>" });
                    blogPanel.Controls.Add(lblTekst);

                    pnlBlogs.Controls.Add(blogPanel);
                }
            }
            else pnlBlogs.Controls.Add(new Literal { Text = "no products found!" });
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            administratie = new Administratie();
            

            if (!string.IsNullOrWhiteSpace(Request.QueryString["id"]))
            {
                id = Convert.ToInt32(Request.QueryString["id"]);
                Product product = administratie.GetProduct(id);

                //Fill page with data
                lblTitle.Text = product.Naam;
                lblDescription.Text = product.Beschrijving;
                lblPrice.Text = "€" + product.Prijs;

                imgProduct.ImageUrl = "~/Images/Products/" + product.AfbeeldingPath;
                
            }

        }
 protected void Page_Load(object sender, EventArgs e)
 {
     administratie = new Administratie();
 }
 public void Initialize()
 {
     admin = new Administratie();
     categorie = new Categorie(16, "Werkgeheugen", 13);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            administratie = new Administratie();

            if (!Page.IsPostBack)
            {
                lbCategorien.Items.Clear();
                List<Categorie> alleCategories = administratie.LaadParentCategories();
                foreach (Categorie c in alleCategories)
                {
                    lbCategorien.Items.Add(c.CategorieNaam);
                }
            }


            int categorieId;
            List<Product> productenVanCategorie = new List<Product>();
            if (!string.IsNullOrWhiteSpace(Request.QueryString["id"]))
            {
                categorieId = Convert.ToInt32(Request.QueryString["id"]);
                List<Categorie> alleSubCategories = administratie.LaadSubCategories(categorieId);

                foreach (Categorie c in alleSubCategories)
                {
                    foreach (Categorie c2 in administratie.LaadSubSubCategories(c.CategorieId))
                    {
                        foreach (Product p in administratie.GetProductenPerCategorie(c2.CategorieId))
                        {
                            productenVanCategorie.Add(p);
                        }
                    }
                }

            }


            if (productenVanCategorie != null)
            {
                foreach (Product p in productenVanCategorie)
                {
                    Panel productPanel = new Panel
                    {
                        CssClass = "productPaginaProductPanel"
                    };
                    ImageButton imageButton = new ImageButton
                    {
                        ImageUrl = "~/Images/Products/" + p.AfbeeldingPath,
                        CssClass = "productImage",
                        PostBackUrl = string.Format("~/Pages/ProductPage.aspx?id={0}", p.ProductId),
                        AlternateText = "ProductAfbeelding"
                    };
                    Label lblName = new Label
                    {
                        Text = p.Naam,
                        CssClass = "productname"
                    };
                    Label lblPrice = new Label
                    {
                        Text = "$" + p.Prijs,
                        CssClass = "productPrice"
                    };

                    productPanel.Controls.Add(imageButton);
                    productPanel.Controls.Add(new Literal { Text = "<br/>" });
                    productPanel.Controls.Add(lblName);
                    productPanel.Controls.Add(new Literal { Text = "<br/>" });
                    productPanel.Controls.Add(lblPrice);

                    pnlProducts.Controls.Add(productPanel);
                }
            }
            else pnlProducts.Controls.Add(new Literal { Text = "no products found!" });
        }