Beispiel #1
0
        public TahsilatViewModel GetAlltahsilat(int pageid = 1, string Filter = "")
        {
            IQueryable <Tahsilat> result = db.Tahsilats;

            if (!string.IsNullOrEmpty(Filter))
            {
                result = db.Tahsilats.Where(t => t.Daneshgah.Contains(Filter) ||
                                            t.Reshte.Contains(Filter) ||
                                            t.gerayesh.Contains(Filter) ||
                                            t.maghta.Contains(Filter) ||
                                            t.StartTime.Contains(Filter) ||
                                            t.EndTime.Contains(Filter));
            }

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

            list.CurrentPage = pageid;
            list.PageCount   = result.Count() / take;
            list.Tahsilats   = result.OrderBy(t => t.TahsilatId).Skip(skip).Take(take).ToList();
            return(list);
        }
Beispiel #2
0
 public void OnGet(int pageid = 1, string filter = "")
 {
     TahsilatViewModel = _adminService.GetAlltahsilat(pageid, filter);
 }