public Book(string author, string bookName, int yearPublishing, string publisherName, BookPosition bookPosition) : this() { this.bookName = bookName; this.yearPublishing = yearPublishing; this.publisherName = publisherName; this.bookPosition = bookPosition; }
public Book(string dateInline) { string[] date = dateInline.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); author = date[0] + " " + date[1]; bookName = date[2]; yearPublishing = int.Parse(date[3]); publisherName = date[4]; bookPosition = new BookPosition(int.Parse(date[5]), int.Parse(date[6])); }
static void Main(string[] args) { string filePath = "data.txt"; Book[] books = ReadDate(filePath); PrintDate(books); Console.WriteLine("Введіть автора книги яку хочете знайти:"); string author = Console.ReadLine(); Console.WriteLine("Введіть назву книги яку хочете знайти:"); string bookName = Console.ReadLine(); BookPosition pBooks = GetCurrentBookPOsition(books, author, bookName); Console.WriteLine(pBooks.shkafNumber + " " + pBooks.polkaNumber + "\n"); Console.WriteLine("Введіть автора книги якого хочете знайти:"); author = Console.ReadLine(); Book[] books1 = GetBooksByAuthor(books, author); PrintDate(books1); Console.WriteLine("Введіть рік видавництва:"); int year = int.Parse(Console.ReadLine()); Console.WriteLine(GetCountBookOfOneYear(books, year)); Console.ReadKey(); }