예제 #1
0
        private static BookLib.ItemCollection items;//(because has same name of class in ui)
        static MainPage()
        {
            //The static fields are intilaized once, in the first time which this page is called
            //and throuhout the runtime of app, the fields are changed by the user
            users = new ManagerUsers();
            items = new BookLib.ItemCollection();
            users.AddUser(new User("mushky", "kkk", "0586191191", "lod", "02/02/1997", CodeOccupation.Customer));
            users.AddUser(new User("mushky2", "kkk", "0586191191", "lod", "02/02/1997", CodeOccupation.Librarian));
            users.AddUser(new User("mushky5", "kkk", "0586191191", "lod", "02/02/1997", CodeOccupation.DiscounManager));
            users.AddUser(new User("mushky4", "kkk", "0586191191", "lod", "02/02/1997", CodeOccupation.LibraryManager));
            List <Genre> genres = new List <Genre>();

            genres.Add(0);
            items.AddItem(new Book("marko", 3, "sfarim", 56, 2018, "ari", 1, genres));
            items.AddItem(new Book("marko", 3, "sfarim", 56, 2018, "ari", 1, genres));
            items.AddItem(new Book("marko", 3, "sfarim", 56, 2018, "ari", 1, genres));
            items.AddItem(new Book("marko", 3, "sfarim", 56, 2018, "ari", 1, genres));
            items.AddItem(new Journal("marko", 3, "sfarim", 56, "04/07/2010", "lll", 0));
            items.AddItem(new Journal("marko", 3, "sfarim", 56, "04/07/2010", "lll", 0));
            items.AddItem(new Journal("marko", 3, "sfarim", 56, "04/07/2010", "lll", 0));
            items.AddItem(new Journal("marko", 3, "sfarim", 56, "04/07/2010", "lll", 0));
            items.AddItem(new Journal("marko", 3, "sfarim", 56, "04/07/2010", "lll", 0));
        }
예제 #2
0
 public void RegisterNewBook(IBook newBook)
 {
     newBook = new Book(newBook.Author, newBook.Genre, newBook.Edition, newBook.Name,
                        newBook.CopyNumber, newBook.PrintDate, newBook.Price);
     _collection.AddItem(newBook);
 }