using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class BookDetails : ParentPage
{
   protected void Page_Load(object sender, EventArgs e)
   {
      if (!IsPostBack)
      {
         ViewedProducts products = Profile.Last5Products;
         products.Add(Request.QueryString["id"]);
         Profile.Last5Products = products;
         Profile.Save();
      }
   }
   protected void lnkWish_Click(object sender, EventArgs e)
   {
      // pobierz listę życzeń
      string isbn = Request.QueryString["id"];
      if (isbn != null)
      {
         // dodaj nową listę życzeń do profilu użytkownika
         List<WishListItem> wishes = Profile.WishList;
         wishes.Add(new WishListItem(isbn, DateTime.Now));
         Profile.WishList = wishes;
         Profile.Save();

         // przekieruj na widok bieżącej listy zyczeń
         Response.Redirect("ViewWishList.aspx");
      }
   }
}
