예제 #1
0
파일: Order.cs 프로젝트: NivekAlunya/csharp
 public Order(Client c, Book[] bs, DateTime dt)
     : base()
 {
     Date = dt;
     Client = c;
     Books = bs;
 }
예제 #2
0
        static void displayBooks(Book[] books)
        {
            foreach (Book b in books)
            {
                if (null == b) continue;

                Console.WriteLine(b.bookToString());
            }
        }
예제 #3
0
        static void testBook()
        {
            Book[] books=new Book[2];
            Book book;
            book = new Book("titre 1", "auteur 1", "1111111111111", 1);
            books[0] = book;
            books[1] = new Book("titre 2", "auteur 2", "2222222222222", 2);

            displayBooks(books);
            Order order = new Order(
                new Client("Launay", "Kevin", "7 rue du clos d'hel", "44810", "LA CHEVALLERAIS")
                ,books
            );
            Console.WriteLine(order.Client.clientToString());
            displayBooks(order.Books);
        }
예제 #4
0
        /// <summary>
        /// 
        /// </summary>
        static void testBook()
        {
            Book book = null;
            try
            {
                Console.WriteLine((book = new Editor.Book("my book", "my author", "1-234-5678-9012-3", 20)).bookToString());
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message, "EditorApp");
            }
            book = null;
            try
            {
                Console.WriteLine((book = new Editor.Book("my book", "my author", "A-234-5678-9012-3", 200)).bookToString());
            }
            catch (Exception e)
            {
                if (null == book) Debug.WriteLine("object book is null", "EditorApp");
                Debug.WriteLine(e.Message, "EditorApp");
            }

            try
            {
                Console.WriteLine((new Editor.Book("my book", "my author", "1-234-567", 60)).bookToString());
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message,"EditorApp");
            }

            try
            {
                Console.WriteLine((new Editor.Book("my book", "my author", "0000000000000123456", 40)).bookToString());
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message,"EditorApp");
            }
        }
예제 #5
0
파일: Order.cs 프로젝트: NivekAlunya/csharp
 public Order(Client c, Book[] bs)
     : this(c,bs,DateTime.Now)
 {
 }
예제 #6
0
파일: Order.cs 프로젝트: NivekAlunya/csharp
 public void addBook(Book book)
 {
     for(int i =0;i<this.Books.Length;++i)
     {
         if (null != this.Books[i]) continue;
         this.Books[i] = book;
         break;
     }
 }