public ActionResult NotificationContent() { int noti_id = int.Parse(Request.QueryString.Get("NOID")); Notice notice= new Notice(); List<int> id_list = new List<int>(); NoticeHandle handler = new NoticeHandle(); id_list = handler.getNoticeIdSet(); notice = handler.getNoticeByID(noti_id); ViewData["Current_Notice_id"] = noti_id; ViewData["notice"] = notice; ViewData["notice_id_list"] = id_list; int index = id_list.IndexOf(noti_id); return View(); }
public ActionResult Notification() { string type = Request.QueryString.Get("type"); MyPage page = new MyPage(); if (type == null) { type = "common"; } if (type.Equals("search")) //搜索类型 { int page1 = int.Parse(Request.QueryString.Get("page")); string NameID = Request.QueryString.Get("NameID"); try { int id = int.Parse(NameID); Notice notice = new NoticeHandle().getNoticeByID(id); List<Notice> notices = new List<Notice>(); if (notice.notice_title != null && !notice.Equals("")) { notices.Add(notice); } ViewData["type"] = "search"; ViewData["notices"] = notices; page.CurrentPage = page1; page.CountPerPage = 10; page.WholePage = 1; ViewData["page"] = page; ViewData["NameID"] = NameID; } catch { page.CurrentPage = page1; List<Notice> notices = new NoticeHandle().GetNoticeByNameByPage(page, NameID); ViewData["type"] = "search"; ViewData["notices"] = notices; ViewData["page"] = page; ViewData["NameID"] = NameID; } } else { int page1; if (Request.QueryString.Get("page") == null) { page1 = 1; page.CurrentPage = page1; List<Notice> notices = new NoticeHandle().GetNoticeByPage(page); ViewData["type"] = "common"; ViewData["notices"] = notices; ViewData["page"] = page; } else { page1 = int.Parse(Request.QueryString.Get("page")); page.CurrentPage = page1; List<Notice> notices = new NoticeHandle().GetNoticeByPage(page); ViewData["type"] = "common"; ViewData["notices"] = notices; ViewData["page"] = page; } } try { return View(); } catch { return RedirectToAction("ErrorPage"); } }