Ejemplo n.º 1
1
        public ActionResult NewsContentAdd(int id,FormCollection f)
        {
            bizNewsContent bc = new bizNewsContent();
            bizNews b = new bizNews();
            bizNewsType bt = new bizNewsType();

            List<NewsContent> list = bc.ListByNewsID(id);

            int pageID = list.Max(p => p.PageID) + 1;
            NewsContent modelContent = new NewsContent();
            modelContent.PageID = pageID;
            modelContent.NewsID = id;
            if (f["ReID"].Trim()!="")
                modelContent.ReID = int.Parse(f["ReID"]);
            modelContent.Content = f["Content"];
            bc.Add(modelContent);

            return RedirectToAction("NewsContentMod", new { id = id, pageID = pageID });
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public ContentResult NewsContentDelete(int id, int pageID)
 {
     bizNewsContent bc = new bizNewsContent();
     List<NewsContent> list = bc.ListByNewsID(id);
     if (list.Count == 1)
         return Content("ֻ��һҳ��������ɾ��");
     bc.DeleteByPageID(id, pageID);
     return Content("");
 }
Ejemplo n.º 6
0
        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();
        }
Ejemplo n.º 7
0
        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);
        }