protected void BttnPlRev_Click(object sender, EventArgs e) { string titel = TxtBxTitel.Text; string inhoud = TxtBxInhoud.Text; AdministratieClass administratie = (AdministratieClass)Session["administratie"]; ProductClass product = (ProductClass)Session["product"]; //voor test AdresClass adres = new AdresClass("Smirnofstraat", "5", "Den Bosch"); AccountClass a = new GeregistreerdeClass(1, "BarrieVanDerSloot", Convert.ToDateTime("05-02-89"), Geslacht.Man, adres, "Ramenwasser", "Media Design", "*****@*****.**", "beestje445", AbbonementClass.Gratis, Modstatus.Actief, "UniqueBarber"); try { product.ToevoegenReview(a.AccountId, titel, inhoud); } catch (Exception) { ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Het toevoegen van het review is niet gelukt." + "');", true); return; } List <ReviewClass> reviews = new List <ReviewClass>(); product.Ophalenreviews(product); reviews = product.Reviews; Session["reviews"] = reviews; Server.Transfer("product.aspx"); }
protected void BttnSelecteer_Click(object sender, EventArgs e) { List <ProductClass> producten = (List <ProductClass>)Session["producten"]; int selectieNr = LstBxResultaat.SelectedIndex; ProductClass product = producten[selectieNr]; List <ReviewClass> reviews = new List <ReviewClass>(); product.Ophalenreviews(product); reviews = product.Reviews; Session["reviews"] = reviews; Session["product"] = product; Session.Contents.Remove("producten"); Server.Transfer("product.aspx"); }