using System;
using System.Data;
using System.Configuration;
using System.Collections;
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 SubHeadings : System.Web.UI.Page
{
   protected void Page_Load(object sender, EventArgs e)
   {
      /*
       string sGroup = Request.QueryString["grp"];
       string sSub = Request.QueryString["sub"];

       if (sSub != null)
       {
          int subId = Convert.ToInt32(sSub);

          CatalogObject[] books = Catalog.GetBooksBySubHeadings(subId);
          foreach (CatalogObject book in books)
          {
             ListItem li = new ListItem(book.Name, "Book.aspx?grp=" + sGroup + "&sub=" + sSub + "&id=" + book.Id);
             bulBooks.Items.Add(li);
          }
          labTitle.Text = Catalog.GetSubHeadingNameById(subId);
       }
      */
   }

   /// <summary>
   /// Retrieves the books for this item. Here we are simply hard-coding this, but
   /// a real-world example would pull this info from a database.
   /// </summary>
   private void RetrieveBooksFromItem(string item)
   {
      if (item == "10")
      {
         bulBooks.Items.Add(new ListItem("GDI Revealed", "Book.aspx?grp=1&sub=10&id=1"));
         labTitle.Text = "Graphics";
      }
      else if (item == "20")
      {
         bulBooks.Items.Add(new ListItem("HTML for the Web", "Book.aspx?grp=1&sub=20&id=2"));
         bulBooks.Items.Add(new ListItem("Zen of CSS Design", "Book.aspx?grp=1&sub=20&id=3"));
         bulBooks.Items.Add(new ListItem("Core JavaServer Faces", "Book.aspx?grp=1&sub=20&id=4"));
         labTitle.Text = "Internet";
      }
      else if (item == "30")
      {
         bulBooks.Items.Add(new ListItem("Core Java", "Book.aspx?grp=2&sub=30&id=5"));
         bulBooks.Items.Add(new ListItem("Core C# and .NET", "Book.aspx?grp=2&sub=30&id=6"));
         bulBooks.Items.Add(new ListItem("Core JavaServer Faces", "Book.aspx?grp=2&sub=30&id=7"));
         labTitle.Text = "Core Series";
      }
      else if (item == "40")
      {
         bulBooks.Items.Add(new ListItem("Framework Design Guidelines", "Book.aspx?grp=2&sub=40&id=8"));
         bulBooks.Items.Add(new ListItem(".NET Web Services", "Book.aspx?grp=2&sub=40&id=9"));
         labTitle.Text = ".NET Series";
      }
      else
         labTitle.Text = "??";
   }
}
