コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: BookPage.cs プロジェクト: BlackieLawless/Library
        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);
        }