public ActionResult Content(int id, int page) { int count; bizNewsType bnt = new bizNewsType(); bizNews bn = new bizNews(); bizNewsContent bnn = new bizNewsContent(); News model = bn.Get(id); NewsContent modelContent = bnn.Get(id, page); NewsType modelType = bnt.Get(model.NewsTypeID); NewsType modelTypeParent = bnt.Get(modelType.ParentID); count = bnn.ListByNewsID(id).Count; model.Attach(); model.HitNum = model.HitNum + 1; model.Detach(); bn.Update(model); ViewData["Bar"] = MenuBar.Start() .AddMenu("��ҳ", "/") .AddMenu("���⾭", "/syj/index.html") .AddMenu(modelTypeParent.TypeName, "/syj/index.html") .AddMenu(modelType.TypeName, "/syj/list/" + modelType.NewsTypeID + "_1.html") .AddMenu(model.Title, "/syj/content/" + model.NewsID + "_1.html") .GetMenuHtml(); ViewData["Content"] = modelContent; ViewData["PageList"] = Page.GetPageList("/syj/content/" + model.NewsID + "_$page$.html", count, 1, page); return View(model); }
public ActionResult List(int id,int page) { bizNewsType bnt = new bizNewsType(); bizNews bn = new bizNews(); NewsType modelType = bnt.Get(id); NewsType modelTypeParent = bnt.Get(modelType.ParentID); int pageSize = 40; int count; List<News> list = bn.List(id, false, page-1, pageSize, out count); ViewData["Title"] = modelType.TypeName + "_" + modelTypeParent.TypeName; ViewData["modelPush"] = bn.GetByPush(id); ViewData["PageList"] = Page.GetPageList("/syj/list/" + id+"_$page$.html", count, pageSize, page); ViewData["Bar"] = MenuBar.Start() .AddMenu("��ҳ", "/") .AddMenu("���⾭", "/syj/index.html") .AddMenu(modelTypeParent.TypeName, "/syj/index.html") .AddMenu(modelType.TypeName, "/syj/list/" + modelType.NewsTypeID + "_1.html") .GetMenuHtml(); return View(list); }
public ActionResult News(int id) { bizNewsType bt = new bizNewsType(); bizNews b = new bizNews(); NewsType model = bt.Get(id); ViewData["NewsType"] = model; ViewData["NewsTypeID"] = id; ViewData["Bar"] = MenuBar.Start() .AddMenu("��̳��Ѷ", "/AdminNews/NewsType/" + model.ParentID) .AddMenu(model.TypeName, "/AdminNews/News/" + model.NewsTypeID) .GetMenuHtml(); int pageSize = 50; int count = 0; int page = Request.QueryString["page"] == null ? 1 : int.Parse(Request.QueryString["page"].ToString()); List<News> list = b.List(id, true, page - 1, pageSize, out count); ViewData["PageList"] = Page.GetPageList("/AdminNews/News/" + id, count, pageSize, page, false); return View(list); }
public ActionResult NewsType(int id) { bizNewsType bt = new bizNewsType(); NewsType model = bt.Get(id); List<NewsType> list = bt.ListByParent(id); ViewData["NewsType"] = model; return View(list); }
public ActionResult NewsMod(int id) { bizNewsContent bc = new bizNewsContent(); bizNews b = new bizNews(); bizNewsType bt = new bizNewsType(); News model = b.Get(id); NewsType modelType = bt.Get(model.NewsTypeID); NewsContent bContent = bc.Get(id,1); List<NewsContent> list = bc.ListByNewsID(id); ViewData["TypeList"] = bt.ListByParent(1101); int maxPage = list.Max(p => p.PageID); ViewData["MaxPageNo"] = maxPage; ViewData["Content"] = bContent.Content; ViewData["NewsType"] = modelType; ViewData["Bar"] = MenuBar.Start() .AddMenu("��̳��Ѷ", "/AdminNews/NewsType/" + modelType.ParentID) .AddMenu(modelType.TypeName, "/AdminNews/News/" + model.NewsTypeID) .AddMenu("��Ϣ��", "") .GetMenuHtml(); return View(model); }
public ActionResult NewsContentMod(int id, int pageID) { if (pageID == 1) return RedirectToAction("NewsMod", new { id = id }); bizNewsContent bc = new bizNewsContent(); bizNews b = new bizNews(); bizNewsType bt = new bizNewsType(); News model = b.Get(id); NewsType modelType = bt.Get(model.NewsTypeID); List<NewsContent> list = bc.ListByNewsID(id); ViewData["NewsType"] = modelType; ViewData["News"] = model; ViewData["MaxPageNo"] = list.Max(p => p.PageID); NewsContent m = list.Single(p => p.PageID == pageID); ViewData["Bar"] = MenuBar.Start() .AddMenu("��̳��Ѷ", "/AdminNews/NewsType/" + modelType.ParentID) .AddMenu(modelType.TypeName, "/AdminNews/News/" + model.NewsTypeID) .AddMenu(model.Title, "/AdminNews/NewsMod/" + model.NewsID) .AddMenu("������", "") .GetMenuHtml(); return View(m); }
public ActionResult NewsContentAdd(int id) { int reid = Request.QueryString["ReID"] == null ? 0 : int.Parse(Request.QueryString["ReID"].ToString()); bizNewsContent bc = new bizNewsContent(); bizNews b = new bizNews(); bizNewsType bt = new bizNewsType(); News modelNews = b.Get(id); NewsType modelType = bt.Get(modelNews.NewsTypeID); List<NewsContent> list = bc.ListByNewsID(id); bizBBSDE bd = new bizBBSDE(); string content = ""; if (reid != 0) { BBSDE modelDe = bd.Get(modelNews.BBSMainID, reid); content = MyText.UbbCode(modelDe.Content); } ViewData["NewsID"] = id; ViewData["Content"] = content; ViewData["NewsType"] = modelType; ViewData["News"] = modelNews; ViewData["ReID"] = reid; ViewData["CurrPageNo"] = list.Max(p => p.PageID)+1; ViewData["Bar"] = MenuBar.Start() .AddMenu("��̳��Ѷ", "/AdminNews/NewsType/" + modelType.ParentID) .AddMenu(modelType.TypeName, "/AdminNews/News/" + modelNews.NewsTypeID) .AddMenu(modelNews.Title, "/AdminNews/NewsMod/" + modelNews.NewsID) .AddMenu("������ҳ", "") .GetMenuHtml(); return View(); }
public ActionResult Detail(int id, int page) { int count; int userID = UserID; bizBBSMain bm = new bizBBSMain(); bizBBSDE bde = new bizBBSDE(); bizNewsType bnt = new bizNewsType(); bizNews bn = new bizNews(); bizNewsContent bnn = new bizNewsContent(); News model = bn.Get(id); NewsContent modelContent = bnn.Get(id, page); NewsType modelType = bnt.Get(model.NewsTypeID); BBSMain modelMain = bm.Get(model.BBSMainID); List<BBSDERelationQuery> list = bde.ListByNew(model.BBSMainID,modelMain.AddUser, 0, 20, out count); int pagecount = bnn.ListByNewsID(id).Count; modelMain.Attach(); modelMain.HitNum = modelMain.HitNum + 1; modelMain.Detach(); bm.Update(modelMain); ViewData["Bar"] = MenuBar.Start() .AddMenu("������Ѷ", "/") .AddMenu(modelType.TypeName, "/news/list/" + modelType.NewsTypeID + "_1.html") .AddMenu("����","") .GetMenuHtml(); if (userID == 0) ViewData["Users"] = null; else ViewData["Users"] = (new bizUsers()).Get(userID); ViewData["HotList"] = BBSCache.Instance().ListNewByHot(); ViewData["Count"] = count; ViewData["List"] = list; ViewData["Content"] = modelContent; ViewData["HitCount"] = modelMain.HitNum; ViewData["PageList"] = Page.GetPageList("/news/detail/" + model.NewsID + "_$page$.html", pagecount, 1, page); return View(model); }
public ActionResult List(int id,int page) { bizNews bn = new bizNews(); bizNewsType bnt = new bizNewsType(); int count; int pageSize=30; List<News> list = bn.List(id, false, page - 1, pageSize, out count); ViewData["NewsList"] = list; ViewData["PushList"] = bn.ListByPush(id, 5); ViewData["ImageList"] = bn.ListByImages(id, 9); ViewData["PageList"] = Page.GetPageList("/news/list/" + id+"_$page$.html", count, pageSize, page); NewsType model = bnt.Get(id); ViewData["Bar"] = MenuBar.Start() .AddMenu("������Ѷ", "/") .AddMenu(model.TypeName, "/news/list/" + model.NewsTypeID + "_1.html") .GetMenuHtml(); return View(model); }