Ejemplo n.º 1
0
        public void CheckPageList(DateTime dt)
        {
            //I need to check if the page exists. if it doesn't then create a new page.else
            //set the page to the old page.
            //I need to see if the month of dt is same month as list.  If not update list
            CheckListOfDates(dt);

            //1.) check if page exists
            PageDate tempPage = listOfPages.Find(x => x.EntryDate == dt);

            if (tempPage == null)
            {
                //Page newPage = new Page();
                this.page.id   = 0;
                this.Thought   = null;
                this.Title     = null;
                this.EntryDate = new DateTime(1, 1, 1);
            }
            else
            {
                //find page and set it to Page
                Page foundPage = dr.GetPage(tempPage.id);
                this.page.id   = foundPage.id;
                this.Thought   = foundPage.Thought;
                this.Title     = foundPage.Title;
                this.EntryDate = foundPage.EntryDate;
            }

            Console.WriteLine("Object id {0}, {1}, {2}, {3}", page.id, page.EntryDate, page.Title, page.Thought);
        }
Ejemplo n.º 2
0
        public async Task <PageDate <T> > GetPageDate <T>(PageSearch pageSearch) where T : class
        {
            var result = new PageDate <T>();

            result.Data = await GlobalIFreeSql.Select <T>().Count(out var total).Page(pageSearch.PageIndex, pageSearch.PageSize).ToListAsync();

            result.TotalCount = Convert.ToInt32(total);
            result.PageIndex  = pageSearch.PageIndex;
            result.PageSize   = pageSearch.PageSize;
            return(result);
        }