public static void ReturnLibraryElement(OrdinaryUser LoggedOrdinaryUser) { int borrowingIdToReturn; Console.Clear(); Console.WriteLine(TextFileHandler.GetOrdinaryUserBorrowingsListFromFile(LoggedOrdinaryUser.UserID)); Console.Write("Który element chcesz zwrócić?[Podaj ID]: "); borrowingIdToReturn = int.Parse(Console.ReadLine()); if (TextFileHandler.CheckReturnValidation(borrowingIdToReturn, LoggedOrdinaryUser.UserID)) { TextFileHandler.ChangeBorrowingStatusToReturned(borrowingIdToReturn, LoggedOrdinaryUser.UserID); if (TextFileHandler.GetBorrowingElementType(borrowingIdToReturn, LoggedOrdinaryUser.UserID) == 1) { int bookID = TextFileHandler.GetBorrowingElementId(borrowingIdToReturn, LoggedOrdinaryUser.UserID); TextFileHandler.ChangeBookStatusToAvailable(bookID); } else if (TextFileHandler.GetBorrowingElementType(borrowingIdToReturn, LoggedOrdinaryUser.UserID) == 2) { int movieID = TextFileHandler.GetBorrowingElementId(borrowingIdToReturn, LoggedOrdinaryUser.UserID); TextFileHandler.ChangeMovieStatusToAvailable(movieID); } Console.WriteLine("Element oddano do zbioru biblioteki"); Console.ReadLine(); } else { Console.WriteLine("Podano niepoprawne ID!"); Console.ReadKey(); } }
public static void GetAllOrdinaryUserBorrowingsList(int ordinaryUserID) { Console.Clear(); Console.WriteLine("Lista wypożyczeń: "); Console.WriteLine("______________________________________________________"); Console.WriteLine(TextFileHandler.GetOrdinaryUserBorrowingsListFromFile(ordinaryUserID)); Console.WriteLine("Powrót"); Console.ReadKey(); }