public ActionResult GetAnnouncements() { try { var db = new dbTIREntities(); SiteUser su = (SiteUser)Session["SiteUser"]; SupportService supportService = new SupportService(su, db); return PartialView("_AnnouncementPartial", new SiteModels() { Announcements = supportService.GetAnnouncements().ToList() }); } catch (Exception ex) { Logging log = new Logging(); log.LogException(ex); return View("GeneralError"); } }
public ActionResult Announcements(int? page) { try { int pageSize = Convert.ToInt32(ConfigurationManager.AppSettings["PageSize"]); int pageNumber = (page ?? 1); var db = new dbTIREntities(); SiteUser su = (SiteUser)Session["SiteUser"]; SupportService supportService = new SupportService(su, db); var listData = (supportService.GetAnnouncements()).ToPagedList(pageNumber, pageSize); return View("Announcements", listData); } catch (Exception ex) { Logging log = new Logging(); log.LogException(ex); return View("GeneralError"); } }