⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 special.aspx.cs

📁 最好用的站点内容管理系统 全部源代码都有
💻 CS
📖 第 1 页 / 共 2 页
字号:
//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NetCMS.Content;
using NetCMS.Publish;
using NetCMS.Model;
using System.Text.RegularExpressions;

namespace NetCMS.Web
{
    public partial class special : NetCMS.Web.UI.BasePage
    {
        protected static string dimm = NetCMS.Config.UIConfig.dirDumm;
        protected static string TempletDir = NetCMS.Config.UIConfig.dirTemplet;
        public static string gInstallDir = "{$InstallDir}";
        public static string gTempletDir = "{$TempletDir}";
        protected void Page_Load(object sender, EventArgs e)
        {
            string SpecialID = Request.QueryString["id"];
            string gPage = Request.QueryString["Page"];
            int strPage = 1;
            string gChID = Request.QueryString["ChID"];
            int ChID = 0;
            if (gChID != null && gChID != string.Empty)
            {
                if (NetCMS.Common.Input.IsInteger(gChID.ToString()))
                {
                    ChID = int.Parse(gChID.ToString());
                }
            }
            if (dimm.Trim() != string.Empty) { dimm = "/" + dimm; }
            if (gPage != string.Empty && gPage != null && NetCMS.Common.Input.IsInteger(gPage))
            {
                strPage = int.Parse(gPage);
            }
            CommonData.Initialize();
            string getContent = string.Empty;
            if (ChID != 0)
            {
                PubCHSpecialInfo CHinfo = CommonData.GetCHSpecial(int.Parse(SpecialID));
                if (CHinfo != null)
                {
                    getContent = getContentRuslt(ChID,CHinfo.templet, SpecialID, strPage, 0);
                }
            }
            else
            {
                PubSpecialInfo info = CommonData.GetSpecial(SpecialID);
                if (info != null)
                {
                    if (info.isDelPoint == 0)
                    {
                        getContent = getContentRuslt(ChID, info.Templet, SpecialID, strPage, 0);
                    }
                    else
                    {
                        if (NetCMS.Global.Current.IsTimeout())
                        {
                            string Url = NetCMS.Common.Input.URLEncode(Request.Url.ToString());
                            Response.Redirect(NetCMS.Config.UIConfig.dirUser + "/login.aspx?reurl=1&urls=" + Url + "", true);
                        }
                        else
                        {
                            string UserNum = NetCMS.Global.Current.UserNum;
                            string IP = Request.ServerVariables["REMOTE_ADDR"];
                            int PointType = info.isDelPoint;
                            //新闻的参数
                            int iPoint = info.iPoint;
                            int Gpoint = info.Gpoint;
                            string GroupNumber = info.GroupNumber;


                            int iuserPoint = 0;
                            int Guserpoint = 0;
                            string userGroupNumber = string.Empty;
                            DynamicTrans dyNews = new DynamicTrans();
                            IDataReader rd = dyNews.getUserInfo(UserNum);
                            if (rd.Read())
                            {
                                iuserPoint = int.Parse(rd["iPoint"].ToString());
                                Guserpoint = int.Parse(rd["Gpoint"].ToString());
                                userGroupNumber = rd["UserGroupNumber"].ToString();
                            }

                            switch (PointType)
                            {
                                case 1:
                                    if (dyNews.getUserNote(UserNum, SpecialID, 2))
                                    {
                                        getContent = getContentRuslt(ChID, info.Templet, SpecialID, strPage, 1);
                                    }
                                    else
                                    {
                                        if (Guserpoint < Gpoint || getGroup(userGroupNumber, GroupNumber) == false)
                                        {
                                            PageError("G币不足,需要G币:" + Gpoint + "<li>或者您所在的组不能浏览</li>", "");
                                        }
                                        else
                                        {
                                            if (dyNews.UpdateHistory(2, SpecialID, 0, Gpoint, UserNum, IP) == 1)
                                            {
                                                getContent = getContentRuslt(ChID, info.Templet, SpecialID, strPage, 1);
                                            }
                                        }
                                    }
                                    break;
                                case 2:
                                    if (dyNews.getUserNote(UserNum, SpecialID, 2))
                                    {
                                        getContent = getContentRuslt(ChID, info.Templet, SpecialID, strPage, 1);
                                    }
                                    else
                                    {
                                        if (iuserPoint < iPoint || getGroup(userGroupNumber, GroupNumber) == false)
                                        {
                                            PageError("积分不足,需要积分:" + iPoint + "<li>或者您所在的组不能浏览</li>", "");
                                        }
                                        else
                                        {
                                            if (dyNews.UpdateHistory(2, SpecialID, iPoint, 0, UserNum, IP) == 1)
                                            {
                                                getContent = getContentRuslt(ChID, info.Templet, SpecialID, strPage, 1);
                                            }
                                        }
                                    }
                                    break;
                                case 3:
                                    if (dyNews.getUserNote(UserNum, SpecialID, 2))
                                    {
                                        getContent = getContentRuslt(ChID, info.Templet, SpecialID, strPage, 1);
                                    }
                                    else
                                    {
                                        if (iuserPoint < iPoint || Guserpoint < Gpoint || getGroup(userGroupNumber, GroupNumber) == false)
                                        {
                                            PageError("您的积分和G币不足,需要积分:" + iPoint + ",G币:" + Gpoint + "<li>或者您所在的组不能浏览</li>", "");
                                        }
                                        else
                                        {
                                            if (dyNews.UpdateHistory(2, SpecialID, iPoint, Gpoint, UserNum, IP) == 1)
                                            {
                                                getContent = getContentRuslt(ChID, info.Templet, SpecialID, strPage, 1);
                                            }
                                        }
                                    }
                                    break;
                                case 4:
                                    if (Guserpoint < Gpoint || getGroup(userGroupNumber, GroupNumber) == false)
                                    {
                                        PageError("您的G币没达到:" + Gpoint + "<li>或者您所在的组不能浏览</li>", "");
                                    }
                                    else

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -