Example #1
0
        private void ShowNews(int NewsId)//显示新闻
        {
            Maticsoft.BLL.NewsManage.News   bll   = new Maticsoft.BLL.NewsManage.News();
            Maticsoft.Model.NewsManage.News model = bll.GetModelByCache(NewsId);

            strHeading  = model.Heading;
            strDate     = model.IssueDate.ToString();
            strContent  = model.Content;
            strfrquency = model.Frequency.ToString();

            if (model.IsLimited == 1)
            {
                string XmlPath = Server.MapPath("~/app_data/AllowIp.xml");
                string thisIp  = "";
                thisIp = Page.Request.UserHostAddress;
                Maticsoft.BLL.NewsManage.NewsViewIpcontrol newsipcontrol = new Maticsoft.BLL.NewsManage.NewsViewIpcontrol();

                if (!newsipcontrol.IpAllow(thisIp, XmlPath))
                {
                    strContent = "对不起,您的IP:" + thisIp + "不在本文允许的访问范围内,请联系管理员!";
                    return;
                }
            }

            //附件信息
            this.newsimagescontent.InnerHtml = ShowNewsImage(NewsId).ToString();
            this.newsaffixcontent.InnerHtml  = ShowNewsAffix(NewsId).ToString();
            GenNavigate(model.ClassId);

            //点击率增加
            model.Frequency++;
            bll.FrequencyAdd(model);
        }
Example #2
0
        private void ShowNews(int NewsId)//显示新闻
        {
            Maticsoft.BLL.NewsManage.News bll = new Maticsoft.BLL.NewsManage.News();
            Maticsoft.Model.NewsManage.News model = bll.GetModelByCache(NewsId);

            strHeading = model.Heading;
            strDate = model.IssueDate.ToString();
            strContent = model.Content;
            strfrquency = model.Frequency.ToString();

            if (model.IsLimited == 1)
            {
             string XmlPath=Server.MapPath("~/app_data/AllowIp.xml");
             string thisIp = "";
             thisIp = Page.Request.UserHostAddress;
            Maticsoft.BLL.NewsManage.NewsViewIpcontrol newsipcontrol= new Maticsoft.BLL.NewsManage.NewsViewIpcontrol();

            if (!newsipcontrol.IpAllow(thisIp,XmlPath))
            {
                strContent = "对不起,您的IP:" + thisIp + "不在本文允许的访问范围内,请联系管理员!";
                return;
            }            
            }

            //附件信息
            this.newsimagescontent.InnerHtml = ShowNewsImage(NewsId).ToString();
            this.newsaffixcontent.InnerHtml = ShowNewsAffix(NewsId).ToString();
            GenNavigate(model.ClassId);

            //点击率增加
           model.Frequency++;
           bll.FrequencyAdd(model);
        }