Beispiel #1
0
        public async Task <IActionResult> Index(SearchConditionParams query)
        {
            try
            {
                ViewBag.keywords = query.KeyWords?.Trim();
                ViewBag.IsNull   = query.ExistNull;
                int counts = await _docService.GetRecordCounts(query);

                var tables = await _docService.GetTables(query);

                foreach (var tb in tables)
                {
                    tb.FieldInfos = await _docService.GetFields(tb.Id);
                }
                PagerOption pageOptions = new PagerOption()
                {
                    ItemCount = counts,
                    PageSize  = query.PageSize, //5
                    PageIndex = query.PageIndex,
                    CountNum  = 5,
                    Url       = Request.Path.Value,
                    Query     = Request.Query,
                };
                ViewBag.Option     = pageOptions;
                ViewBag.TotalCount = counts;
                return(View(tables));
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }
            return(View());
        }
Beispiel #2
0
        public IActionResult Index(SearchConditionParams query)
        {
            ViewBag.keywords = query.KeyWords?.Trim();
            ViewBag.IsNull   = query.ExistNull;
            int         counts      = 0;
            var         tables      = GetTables(out counts, query.PageIndex, query.PageSize, query.KeyWords, query.ExistNull);
            PagerOption pageOptions = new PagerOption()
            {
                ItemCount = counts,
                PageSize  = query.PageSize, //5
                PageIndex = query.PageIndex,
                CountNum  = 5,
                Url       = Request.Path.Value,
                Query     = Request.Query,
            };

            ViewBag.Option     = pageOptions;
            ViewBag.TotalCount = counts;
            return(View(tables));
        }
Beispiel #3
0
 public async Task <int> GetRecordCounts(SearchConditionParams query)
 {
     return(await _docRepostory.GetCountAsync(query.KeyWords, query.ExistNull));
 }
Beispiel #4
0
 public async Task <IEnumerable <TableInfo> > GetTables(SearchConditionParams query)
 {
     return(await _docRepostory.GetAllAsync(query.PageIndex, query.PageSize, query.KeyWords, query.ExistNull));
 }