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>();
 }
Ejemplo n.º 2
0
        public LibrarianTextRepository(LibraryDepartmentRepository libraryDepartmentRepository)
        {
            this.libraryDepartmentRepository = libraryDepartmentRepository;

            if (!Directory.GetParent(FileName).Exists)
            {
                Directory.GetParent(FileName).Create();
            }
            if (!File.Exists(FileName))
            {
                File.Create(FileName).Close();
            }
        }
Ejemplo n.º 3
0
        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 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);
            }
        }
 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 BookRepository CreateBookRepository(LibraryDepartmentRepository libraryDepartmentRepository)
 {
     return(new BookTextRepository(libraryDepartmentRepository));
 }
 public LibrarianObjectRepository(LibraryDepartmentRepository libraryDepartmentRepository)
 {
     this.libraryDepartmentRepository = libraryDepartmentRepository;
     librarians = new List <Librarian>();
 }
 public BookObjectRepository(LibraryDepartmentRepository libraryDepartmentRepository)
 {
     this.libraryDepartmentRepository = libraryDepartmentRepository;
     books = new List <Book>();
 }