public List <Employees> returnEmployees() { var employeeStore = new EmployeesStore() { Path = empoyeesPath }; var employeeList = employeeStore.GetCollection(); return(employeeList); }
static void Main(string[] args) { var readerStore = new ReaderStore() { Path = readerPath }; var readerList = readerStore.GetCollection(); var recordStore = new RecordStore() { Path = recordPath }; var recordList = recordStore.GetCollection(); var employeeStore = new EmployeesStore() { Path = empoyeesPath }; var employeeList = employeeStore.GetCollection(); var readerss = readerList; var empllist = employeeList; var prodTemplate = "{0} | {1} | {2} "; Console.WriteLine(string.Format(prodTemplate, "Id", "Name", "Course")); foreach (var p in readerss) { Console.WriteLine(string.Format(prodTemplate, p.Id, p.Name, p.Course)); } var prodTemplate = "{0} | {1} | {2} | {3}"; // Console.WriteLine(string.Format(prodTemplate, // "Id", // "Name", // "job_position", // "email")); // foreach(var p in empllist ){ // Console.WriteLine(string.Format(prodTemplate, // p.employee_id, // p.name, // p.job_position, // p.email)); // } // var records = recordList; // var prodTemplate = "{0} | {1} | {2} "; // Console.WriteLine(string.Format(prodTemplate, // "borrowed_date", // "returned_date", // "reader_id", // "employee_id", // "book_id")); // foreach(var record in records){ // Console.WriteLine(string.Format(prodTemplate, // p.borrowed_date, // p.returned_date, // p.reader_id, // p.employee_id, // p.book_id)); // } }
static void Main(string[] args) { var readerStore = new ReaderStore() { Path = readerPath }; var readerList = readerStore.GetCollection(); var bookStore = new BookStore() { Path = bookPath }; var bookList = bookStore.GetCollection(); var recordStore = new RecordStore() { Path = recordPath }; var recordList = recordStore.GetCollection(); var employeeStore = new EmployeesStore() { Path = empoyeesPath }; var employeeList = employeeStore.GetCollection(); while (true) { Console.WriteLine("[1] Show books" + "\n" + "[2] Show records" + "\n" + "[3] Order book" + "\n" + "[4] Show readers history"); string choice = Console.ReadLine(); switch (choice) { case "1": var printhistory1 = new PrintHistory(); printhistory1.printBookList(bookList); break; case "2": var libraryManager2 = new LibraryManager(); var value2 = libraryManager2.ReturnDetails(bookList, recordList, employeeList, readerList); var printhistory2 = new PrintHistory(); printhistory2.printBorrow(value2); break; case "3": Console.WriteLine("Enter willing books' name: "); string name = Console.ReadLine(); Console.WriteLine("Are you sure? (y/n)"); string answer = Console.ReadLine(); switch (answer) { case "y": var libraryManager4 = new LibraryManager(); libraryManager4.oderBook(bookList, recordList, name); break; case "n": break; default: break; } break; case "4": var libraryManager3 = new LibraryManager(); var value3 = libraryManager3.ReturnHistory(bookList, recordList, employeeList, readerList); var printhistory3 = new PrintHistory(); printhistory3.printHistory(value3); break; default: break; } } }