public BookTextRepository(LibraryDepartmentRepository libraryDepartmentRepository)
        {
            this.libraryDepartmentRepository = libraryDepartmentRepository;

            if (!Directory.GetParent(FileName).Exists) Directory.GetParent(FileName).Create();
            if (!File.Exists(FileName)) File.Create(FileName).Close();
        }
 public LibrarianRepositoryTest()
 {
     repositoryFactory           = new T();
     libraryDepartmentRepository = repositoryFactory.CreateLibraryDepartmentRepository();
     librarianRepository         = repositoryFactory.CreateLibrarianRepository(libraryDepartmentRepository);
     countItems = librarianRepository.GetItems().Count();
 }
Пример #3
0
 public LibraryDepartmentRepositoryTest()
 {
     repositoryFactory           = new T();
     libraryDepartmentRepository = repositoryFactory.CreateLibraryDepartmentRepository();
     countItems  = libraryDepartmentRepository.GetItems().Count();
     department1 = new LibraryDepartment("Абонемент", true);
     department2 = new LibraryDepartment("Читальный зал", false);
 }
 public OrderObjectRepository(ReaderRepository readerRepository, BookRepository bookRepository, 
     LibraryDepartmentRepository libraryDepartmentRepository, LibrarianRepository librarianRepository)
 {
     this.readerRepository = readerRepository;
     this.bookRepository = bookRepository;
     this.libraryDepartmentRepository = libraryDepartmentRepository;
     this.librarianRepository = librarianRepository;
     orders = new List<Order>();
 }
Пример #5
0
 public BookRepositoryTest()
 {
     repositoryFactory           = new T();
     libraryDepartmentRepository = repositoryFactory.CreateLibraryDepartmentRepository();
     bookRepository = repositoryFactory.CreateBookRepository(libraryDepartmentRepository);
     countItems     = bookRepository.GetItems().Count();
     department     = new LibraryDepartment("Абонемент", true);
     book1          = new Book("John Doe", "Book", 2000, department);
     book2          = new Book("Alex Pupkin", "Book2", 2001, department);
 }
Пример #6
0
 public LibrarianRepositoryTest()
 {
     repositoryFactory           = new T();
     libraryDepartmentRepository = repositoryFactory.CreateLibraryDepartmentRepository();
     librarianRepository         = repositoryFactory.CreateLibrarianRepository(libraryDepartmentRepository);
     countItems = librarianRepository.GetItems().Count();
     department = new LibraryDepartment("Абонемент", true);
     librarian1 = new Librarian("John Doe", department);
     librarian2 = new Librarian("Alex Pupkin", department);
 }
        public OrderTextRepository(ReaderRepository readerRepository, BookRepository bookRepository, 
            LibraryDepartmentRepository libraryDepartmentRepository, LibrarianRepository librarianRepository)
        {
            this.readerRepository = readerRepository;
            this.bookRepository = bookRepository;
            this.libraryDepartmentRepository = libraryDepartmentRepository;
            this.librarianRepository = librarianRepository;

            if (!Directory.GetParent(FileName).Exists) Directory.GetParent(FileName).Create();
            if (!File.Exists(FileName)) File.Create(FileName).Close();
        }
        public OrderMSSQLRepository(ReaderRepository readerRepository, BookRepository bookRepository, 
            LibraryDepartmentRepository libraryDepartmentRepository, LibrarianRepository librarianRepository,
            LibraryDataContext context)
        {
            this.readerRepository = readerRepository;
            this.bookRepository = bookRepository;
            this.libraryDepartmentRepository = libraryDepartmentRepository;
            this.librarianRepository = librarianRepository;

            this.context = context;
        }
Пример #9
0
        public OrderRepositoryTest()
        {
            repositoryFactory           = new T();
            readerRepository            = repositoryFactory.CreateReaderRepository();
            libraryDepartmentRepository = repositoryFactory.CreateLibraryDepartmentRepository();
            bookRepository      = repositoryFactory.CreateBookRepository(libraryDepartmentRepository);
            librarianRepository = repositoryFactory.CreateLibrarianRepository(libraryDepartmentRepository);

            orderRepository = repositoryFactory.CreateOrderRepository(readerRepository, bookRepository, libraryDepartmentRepository, librarianRepository);

            countItems = orderRepository.GetItems().Count();
        }
        public LibrarianXMLRepository(LibraryDepartmentRepository libraryDepartmentRepository)
        {
            this.libraryDepartmentRepository = libraryDepartmentRepository;

            if (!Directory.GetParent(FileName).Exists) Directory.GetParent(FileName).Create();
            if (File.Exists(FileName))
            {
                document = XDocument.Load(FileName);
            }
            else
            {
                document = new XDocument(
                    new XDeclaration("1.0", "utf-8", "yes"),
                    new XElement("Librarians", null));
                document.Save(FileName);
            }
        }
        public OrderXMLRepository(ReaderRepository readerRepository, BookRepository BookRepository, 
            LibraryDepartmentRepository libraryDepartmentRepository, LibrarianRepository librarianRepository)
        {
            this.readerRepository = readerRepository;
            this.bookRepository = BookRepository;
            this.libraryDepartmentRepository = libraryDepartmentRepository;
            this.librarianRepository = librarianRepository;

            if (!Directory.GetParent(FileName).Exists) Directory.GetParent(FileName).Create();
            if (File.Exists(FileName))
            {
                document = XDocument.Load(FileName);
            }
            else
            {
                document = new XDocument(
                    new XDeclaration("1.0", "utf-8", "yes"),
                    new XElement("Orders", null));
                document.Save(FileName);
            }
        }
Пример #12
0
        public OrderRepositoryTest()
        {
            repositoryFactory           = new T();
            readerRepository            = repositoryFactory.CreateReaderRepository();
            libraryDepartmentRepository = repositoryFactory.CreateLibraryDepartmentRepository();
            bookRepository      = repositoryFactory.CreateBookRepository(libraryDepartmentRepository);
            librarianRepository = repositoryFactory.CreateLibrarianRepository(libraryDepartmentRepository);

            orderRepository = repositoryFactory.CreateOrderRepository(readerRepository, bookRepository, libraryDepartmentRepository, librarianRepository);

            countItems = orderRepository.GetItems().Count();

            department = new LibraryDepartment("Абонемент", true);
            reader     = new Reader("Reader Name", "Reader Address");
            book       = new Book("Author", "Title", 2000, department);
            librarian  = new Librarian("Name", department);

            order1 = new Order(reader, book);
            order2 = new Order(reader, book)
            {
                TimeGetBook = DateTime.Now, LibrarianOpenOrder = librarian
            };
        }
 public BookRepository CreateBookRepository(LibraryDepartmentRepository libraryDepartmentRepository)
 {
     return new BookTextRepository(libraryDepartmentRepository);
 }
 public BookObjectRepository(LibraryDepartmentRepository libraryDepartmentRepository)
 {
     this.libraryDepartmentRepository = libraryDepartmentRepository;
     books = new List<Book>();
 }
        public LibrarianMSSQLRepository(LibraryDepartmentRepository libraryDepartmentRepository, LibraryDataContext context)
        {
            this.libraryDepartmentRepository = libraryDepartmentRepository;

            this.context = context;
        }
 public OrderRepository CreateOrderRepository(ReaderRepository readerRepository, BookRepository bookRepository, 
     LibraryDepartmentRepository libraryDepartmentRepository, LibrarianRepository librarianRepository)
 {
     return new OrderTextRepository(readerRepository, bookRepository, libraryDepartmentRepository, librarianRepository);
 }
 public LibrarianRepository CreateLibrarianRepository(LibraryDepartmentRepository libraryDepartmentRepository)
 {
     return new LibrarianTextRepository(libraryDepartmentRepository);
 }
 public LibrarianObjectRepository(LibraryDepartmentRepository libraryDepartmentRepository)
 {
     this.libraryDepartmentRepository = libraryDepartmentRepository;
     librarians = new List<Librarian>();
 }
 public LibrarianRepository CreateLibrarianRepository(LibraryDepartmentRepository libraryDepartmentRepository)
 {
     return new LibrarianMSSQLRepository(libraryDepartmentRepository, context);
 }
 public BookRepository CreateBookRepository(LibraryDepartmentRepository libraryDepartmentRepository)
 {
     return new BookMSSQLRepository(libraryDepartmentRepository, context);
 }