예제 #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 });
        }
예제 #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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 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);
 }
예제 #5
0
 public ActionResult NewsAdd()
 {
     int parentID = Request.QueryString["parentID"] == null ? 0 : int.Parse(Request.QueryString["parentID"].ToString());
     int typeID = Request.QueryString["typeID"] == null ? 0 : int.Parse(Request.QueryString["typeID"].ToString());
     int bbsMainID = Request.QueryString["bbsMainID"] == null ? 0 : int.Parse(Request.QueryString["bbsMainID"].ToString());
     string title = "";
     string content = "";
     string username = "";
     if (bbsMainID != 0)
     {
         bizBBSMain bm = new bizBBSMain();
         BBSMainRelationQuery model = bm.GetBBSMainDetail(bbsMainID);
         title = model.Title;
         username = model.UserName;
         string ubbContent = "";
         string htmlContent = "";
         ubbContent = MyText.ReplayUbbCode(model.Content);
         //if (model.FilePath != null && model.FilePath.Trim() != "" && model.FileType == 1)
         //{
         //    ubbContent += "\r\n[img]" + model.FilePath + "[/img]";
         //}
         //else if (model.FilePath != null && model.FilePath.Trim() != "" && model.FileType == 2)
         //{
         //    ubbContent += "\r\n[flash]" + model.FilePath + "[/flash]";
         //}
         //if (model.UpImages != null && model.UpImages.Trim() != "")
         //{
         //    ubbContent += "\r\n[img]" + model.UpImages + "[/img]";
         //}
         if(model.ContentType==1)
             htmlContent = MyText.ReplayCode(MyText.UbbCode(ubbContent), false);
         else
             htmlContent = MyText.ReplayCode(ubbContent, false);
         content = htmlContent;
     }
     bizNewsType bt = new bizNewsType();
     ViewData["Title"] = title;
     ViewData["TitleShort"] = title;
     ViewData["Content"] = content;
     ViewData["BBSMainID"] = bbsMainID;
     ViewData["TypeList"] = bt.ListByParent(parentID);
     ViewData["parentID"] = parentID;
     ViewData["typeID"] = typeID;
     ViewData["UserName"] = username;
     ViewData["Bar"] = MenuBar.Start()
         .AddMenu("��̳��Ѷ", "/AdminNews/NewsType/1101")
         .AddMenu("��Ϣ����","")
         .GetMenuHtml();
     return View();
 }
예제 #6
0
 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);
 }
예제 #7
0
        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 });
        }
예제 #8
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);
        }
예제 #9
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);
        }
예제 #10
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();
        }
예제 #11
0
        public ActionResult NewsAdd(News model,FormCollection f)
        {
            int parentID = Request.QueryString["parentID"] == null ? 0 : int.Parse(Request.QueryString["parentID"].ToString());
            int typeID = Request.QueryString["typeID"] == null ? 0 : int.Parse(Request.QueryString["typeID"].ToString());
            int bbsMainID = Request.QueryString["bbsMainID"] == null ? 0 : int.Parse(Request.QueryString["bbsMainID"].ToString());
            bizNewsType bt = new bizNewsType();
            bizNews b = new bizNews();
            bizNewsContent bc = new bizNewsContent();
            NewsContent modelContent = new NewsContent();

            modelContent.Content = f["Content"];

            model.AddIP = Public.CommonHelper.GetIPAddress();
            int newsID=b.Add(model);
            modelContent.PageID = 1;
            modelContent.NewsID = newsID;
            bc.Add(modelContent);
            return RedirectToAction("NewsMod", new { id = newsID });
        }
예제 #12
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);
        }
예제 #13
0
 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);
 }