public ActionResult HaberEkle() { // dropdownlist elemanlarını ilkleme var model = new HaberViewModel { Kategoriler = kategoriServis.Kategoriler(), Kullanicilar = kullaniciServis.Kullanicilar(), HaberTipleri = haberServis.HaberTipleri(), Etiketler = etiketServis.Etiketler(), HaberPozisyon = haberServis.HaberPozisyonlari() }; return(View(model)); }
public ActionResult KullanicilarJson(int page, int rows, string sort, string order) { var kullanicilar = kullaniciServis.Kullanicilar(); int pageIndex = page - 1; int pageSize = rows; int totalRecords = kullanicilar.Count(); int totalPages = (int)Math.Ceiling((float)totalRecords / (float)pageSize); var result = new { total = totalRecords, rows = kullanicilar.Select(x => new { Id = x.Id, Ad = x.Ad, Eposta = x.Eposta }) .AsQueryable() .OrderBy(sort + " " + order) .Skip(pageIndex * pageSize) .Take(pageSize) .ToList() }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult KullanicilarJson(int page, int rows, string sort, string order) { var kullanicilar = kullaniciServis.Kullanicilar(page, rows); var result = new { total = kullanicilar.KayitSayisi, rows = kullanicilar.KaynakListe.Select(x => new { Id = x.Id, KullaniciAdi = x.KullaniciAdi, Eposta = x.Eposta, Resim = x.KucukProfilResim, Roller = String.Join(",", rolServis.KullaniciRolleri(x.Eposta)) }) .AsQueryable() .OrderBy(sort + " " + order) }; return(Json(result, JsonRequestBehavior.AllowGet)); }