Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["reviewCounter"] != null)
            {
                reviewCounter = (int)Session["reviewCounter"];
            }
            else
            {
                Session["reviewCounter"] = 0;
            }
            BookService.BookServiceClient client = new BookService.BookServiceClient();

            List <Book> bookList = client.GetBook(-1);

            bookCollection = new Dictionary <int, Book>();
            foreach (Book book in bookList)
            {
                HtmlGenericControl li = new HtmlGenericControl("li");
                li.Attributes.Add("value", book.Id + "-" + book.Name);
                li.InnerText = book.Name;
                listBook.Controls.Add(li);

                bookCollection.Add(book.Id, book);
            }
            add.ServerClick += new EventHandler(this.add_Click);
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BookService.BookServiceClient client = new BookService.BookServiceClient();

            List <Book> bookList = client.GetBook(-1);

            bookCollection = new Dictionary <int, Book>();
            foreach (Book book in bookList)
            {
                HtmlGenericControl li = new HtmlGenericControl("li");
                li.Attributes.Add("value", book.Id + "-" + book.Name);
                li.InnerText = book.Name;
                listBook.Controls.Add(li);

                bookCollection.Add(book.Id, book);
            }
            search.ServerClick += new EventHandler(this.search_Click);
        }