Пример #1
0
        public SabegheViewModel GetAllTajrobiyat(int pageid = 1, string Filter = "")
        {
            IQueryable <Sabeghe> result = db.Sabeghes;

            if (!string.IsNullOrEmpty(Filter))
            {
                result = db.Sabeghes.Where(t => t.Stitle.Contains(Filter) ||
                                           t.Description.Contains(Filter) ||
                                           t.StartTime.Contains(Filter) ||
                                           t.EndTime.Contains(Filter) ||
                                           t.StartTime.Contains(Filter) ||
                                           t.EndTime.Contains(Filter));
            }

            var take = 10;
            var skip = (pageid - 1) * take;
            SabegheViewModel list = new SabegheViewModel();

            list.CurrentPage = pageid;
            list.PageCount   = result.Count() / take;
            list.Sabeghes    = result.OrderBy(t => t.SId).Skip(skip).Take(take).ToList();
            return(list);
        }
Пример #2
0
 public void OnGet(int pageid = 1, string filter = "")
 {
     ViewModel = _adminService.GetAllTajrobiyat(pageid, filter);
 }