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 NewsMod(int id, News modelOld, FormCollection f) { bizNewsContent bc = new bizNewsContent(); bizNews b = new bizNews(); bizNewsType bt = new bizNewsType(); News model = b.Get(id); NewsContent bContent = bc.Get( id,1); model.Attach(); model.Title = modelOld.Title; model.TitleShort = modelOld.TitleShort; model.TitleColor = modelOld.TitleColor; model.IsBold = modelOld.IsBold; model.NewsTypeID = modelOld.NewsTypeID; model.NewsRemark = modelOld.NewsRemark; model.Images = modelOld.Images; model.PushType = modelOld.PushType; model.Status = modelOld.Status; model.Keyword = modelOld.Keyword; model.NewsSource = modelOld.NewsSource; model.Detach(); bContent.Attach(); bContent.Content = f["Content"]; bContent.Detach(); b.Update(model); bc.Update(bContent); return RedirectToAction("NewsMod", new { id = id }); }
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, FormCollection f) { bizNewsContent bc = new bizNewsContent(); NewsContent model = bc.Get(id, pageID); model.Attach(); model.Content = f["Content"]; if(f["ReID"].Trim()!="") model.ReID = int.Parse(f["ReID"]); model.Detach(); bc.Update(model); return RedirectToAction("NewsContentMod", new { id = id, pageID = pageID }); }
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); }