C# error checking unique and listing price below and above
<p>I need to check that the ISBN is unique during data entry, and to list the price lower or above for the book. I tried to display the price but instead I'm only able to display the exact price entered.</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Assignment_3
{
class Program
{
    public static List&lt;Book&gt; book = new List&lt;Book&gt;();
    public static List&lt;BookCategory&gt; bc = new List&lt;BookCategory&gt;();

    static void Main(string[] args)
    {
        int option;
        bc.Add(new BookCategory("Comedy"));
        bc.Add(new BookCategory("Horror"));
        bc.Add(new BookCategory("Adventure"));
        do
        {
            Console.WriteLine("\t\t----------------------------------------------");
            Console.WriteLine("\t\t|\t1. Add new book information          |");
            Console.WriteLine("\t\t|\t2. Search book information           |");
            Console.WriteLine("\t\t|\t3. Display book information          |");
            Console.WriteLine("\t\t|\t4. Display book category             |");
            Console.WriteLine("\t\t|\t5. Exit                              |");
            Console.WriteLine("\t\t----------------------------------------------");
            Console.Write("Please choose an option : ");
            option = int.Parse(Console.ReadLine());
            Console.WriteLine();

            switch (option)
            {
                case 1: Add(book,bc);
                    break;
                case 2: Search(book,bc);
                    break;
                case 3: Display(book, bc);
                    break;
                case 4: Compare(bc);
                    break;
                case 5: Environment.Exit(0);
                    break;
                default: Console.WriteLine("You have entered an invalid option ! ");
                    break;
            }
        } while (option != 5);
        Console.Read();
    }

    static void Add(List&lt;Book&gt; b, List&lt;BookCategory&gt; bc)
    {
        string title, isbn, author, bookCategory;
        double price;
        Console.Write("Enter the book title : ");
        title = Console.ReadLine();
        Console.Write("Enter the ISBN of the book : ");
        isbn = Console.ReadLine();
        Console.Write("Enter the author of the book : ");
        author = Console.ReadLine();
        Console.Write("Enter the book category &lt;Adventure | Horror | Comedy&gt; : ");
        bookCategory = Console.ReadLine();
        Console.Write("Enter the price of the book : ");
        price = double.Parse(Console.ReadLine());
        b.Add(new Book(title, isbn, author, bookCategory, price));

        if (bookCategory == "Comedy")
        {
            BookCategory tempBookObj = bc.Find(delegate(BookCategory bcg)
            {
                return bcg.CategoryName.Equals("Comedy");
            });
            tempBookObj.BookNo++;
        }

        if (bookCategory == "Horror")
        {
            BookCategory tempBookObj = bc.Find(delegate(BookCategory bcg)
            {
                return bcg.CategoryName.Equals("Horror");
            });
            tempBookObj.BookNo++;
        }

        if (bookCategory == "Adventure")
        {
            BookCategory tempBookObj = bc.Find(delegate(BookCategory bcg)
            {
                return bcg.CategoryName.Equals("Adventure");
            });
            tempBookObj.BookNo++;
        }

        else
        {
            Console.WriteLine("Please enter the book category according to the list ! ");
        }
    }

    public static void Search(List&lt;Book&gt; b, List&lt;BookCategory&gt; bc)
    {
        int option;
        string target, target1;
        double target2;
        List&lt;Book&gt; book1 = new List&lt;Book&gt;();
        Console.WriteLine("\t\t--------------------------------------");
        Console.WriteLine("\t\t|\t1. ISBN                      |");
        Console.WriteLine("\t\t|\t2. Book Title                |");
        Console.WriteLine("\t\t|\t3. Book Price                |");
        Console.WriteLine("\t\t|\t4. Back to main menu         |");
        Console.WriteLine("\t\t--------------------------------------");
        Console.Write("Please choose an option : ");
        option = int.Parse(Console.ReadLine());
        Console.WriteLine();

        switch (option)
        {
            case 1: Console.Write("Enter the ISBN of book to be searched : ");
                target = Console.ReadLine();
                Book result = b.Find(delegate(Book bk)
                {
                    return bk.ISBN.Equals(target);
                });

                if (result == null)
                    Console.WriteLine("Product not found !");
                else
                    Console.WriteLine(result);
                break;

            case 2: Console.Write("Enter the title of book to be searched : ");
                target1 = Console.ReadLine();
                Book result1 = b.Find(delegate(Book bk)
                {
                    return bk.Title.Equals(target1);
                });
                if (result1 == null)
                    Console.WriteLine("Product not found !");
                else
                    Console.WriteLine(result1);
                break;

            case 3: Console.Write("Enter the price of book to be searched : ");
                target2 = double.Parse(Console.ReadLine());
                Book result2 = b.Find(delegate(Book bk)
                {
                    return bk.Price.Equals(target2);
                });

                if (result2 == null)
                    Console.WriteLine("Product not found !");
                else
                    Console.WriteLine(result2);
                break;

            case 4: 
                break;
        }
    }

    public static void Display(List&lt;Book&gt; b, List&lt;BookCategory&gt; bc)
    {
        b.Sort();
        foreach (Book bk in b)
        {
            Console.WriteLine(bk.ToString());
        }           
    }

    public static void Compare(List&lt;BookCategory&gt; bc)
    {
        bc.Sort();
        foreach (BookCategory bk in bc)
        {
            Console.WriteLine(bk.ToString());
        }
    }


}
</code></pre>

<p>}</p>
