protected override void OnEndLoadNecessaryData(ReportBookPage.LoadNecessaryData result) { base.OnEndLoadNecessaryData(result); Rubrics = result.Rubrics; Publishers = result.Publishers; var rubrics = result.Rubrics.ToList(); rubrics.Insert(0, new Rubric() { Id = -1, Name = "Все" }); var publishers = result.Publishers.ToList(); publishers.Insert(0, new Publisher() { Id = -1, Name = "Все" }); RubricItem.Bind(rubrics, r => r.Name, Rubric); PublisherItem.Bind(publishers, p => p.Name, Publisher); }
private static void InputPublisherFields(BookItem book) { var publisherItem = new PublisherItem(); Console.WriteLine("Введите имя издателя:"); publisherItem.Name = ConsoleExtensions.ReadNotEmptyString(); book.Publisher = publisherItem; }
private PublisherItem GetPublisherItem(Publisher publisher) { if (publisher == null) { return(null); } var publisherItem = new PublisherItem() { PublisherId = publisher.PublisherId, PublisherName = publisher.Name }; return(publisherItem); }
protected override void OnEndLoadNecessaryData(BookPage.LoadNecessaryData result) { base.OnEndLoadNecessaryData(result); Rubrics = result.Rubrics; Publishers = result.Publishers; Authors = result.Authors; var rubrics = result.Rubrics.ToList(); rubrics.Insert(0, new Rubric() { Id = -1, Name = "Все" }); var publishers = result.Publishers.ToList(); publishers.Insert(0, new Publisher() { Id = -1, Name = "Все" }); var authors = result.Authors.ToList(); authors.Insert(0, new Author() { Id = -1, FirstName = "Все", LastName = "", MiddleName = "" }); RubricItem.Bind(rubrics, r => r.Name, Rubric); PublisherItem.Bind(publishers, p => p.Name, Publisher); AuthorItem.Bind(authors, a => string.Format("{0} {1} {2}", a.LastName, a.FirstName, a.MiddleName), Author); }