site_add.aspx.cs

来自「这也是关于论坛的一个源代码」· CS 代码 · 共 344 行 · 第 1/2 页

CS
344
字号
//===========================================================
//==     (c)2007 Foosun Inc. by dotNETCMS 1.0              ==
//==             Forum:bbs.foosun.net                      ==
//==            website:www.foosun.net                     ==
//==     Address:NO.109 HuiMin ST.,Chengdu ,China          ==
//==         TEL:86-28-85098980/66026180                   ==
//==         TEL:86-28-85098980/66026180                   ==
//==         qq:655071,MSN:ikoolls@gmail.com               ==
//==               Code By JiangDong                       ==
//===========================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Foosun.Model;

public partial class manage_news_Site_add : Foosun.Web.UI.ManagePage
{
    Foosun.CMS.Common.rootPublic pd = new Foosun.CMS.Common.rootPublic();
    public string PublishType = Foosun.Config.verConfig.PublicType;
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";

        if (!Page.IsPostBack)
        {
            
            if (PublishType != "1")
            {
                N_13.Visible = false;
            }
            if (SiteID != "0") { PageError("您没有创建站群的权限!", ""); }
            this.LblID.Text = "";
            this.LblCID.Text = "";
            this.RadStatus.Items[0].Selected = true;
            this.RadFileType.Items[0].Selected = true;
            this.DdlDataTable.Items.Clear();
            Foosun.CMS.News news = new Foosun.CMS.News();
            DataTable tbnews = news.GetTables();
            this.DdlDataTable.DataSource = tbnews;
            this.DdlDataTable.DataTextField = "TableName";
            this.DdlDataTable.DataValueField = "TableName";
            this.DdlDataTable.DataBind();
            tbnews.Dispose();
            this.LblCaption.Text = this.LblNavigation.Text = "新建站群";
            if (Request.QueryString["ID"] != null && !Request.QueryString["ID"].Trim().Equals(string.Empty))
            {
                int id = int.Parse(Request.QueryString["ID"]);
                this.TxtEnName.Enabled = false;
                this.LblID.Text = id.ToString();
                Foosun.CMS.Site site = new Foosun.CMS.Site();
                DataTable tb = site.GetSingle(id);
                if (tb != null && tb.Rows.Count > 0)
                {
                    DataRow r = tb.Rows[0];
                    if (!r.IsNull("CName")) this.TxtCnName.Text = r["CName"].ToString();
                    if (!r.IsNull("EName")) this.TxtEnName.Text = r["EName"].ToString();
                    if (!r.IsNull("ChannelID")) this.LblCID.Text = r["ChannelID"].ToString();
                    if (!r.IsNull("ChannCName")) this.TxtItemName.Text = r["ChannCName"].ToString();
                    if (!r.IsNull("isLock"))
                    {
                        int n = int.Parse(r["isLock"].ToString());
                        if (n == 1)
                            this.RadStatus.Items[1].Selected = true;
                        else if (n == 0)
                            this.RadStatus.Items[0].Selected = true;
                    }
                    if (!r.IsNull("IsURL"))
                    {
                        int n = int.Parse(r["IsURL"].ToString());
                        if (n == 1)
                            this.ChbType.Checked = true;
                        else if (n == 0)
                            this.ChbType.Checked = false;
                    }

                    if (!r.IsNull("Urladdress")) this.TxtUrl.Text = r["Urladdress"].ToString();
                    if (!r.IsNull("DataLib")) this.DdlDataTable.SelectedValue = r["DataLib"].ToString();
                    if (!r.IsNull("IndexTemplet")) this.TxtIndxTmp.Text = r["IndexTemplet"].ToString();
                    if (!r.IsNull("ClassTemplet")) this.TxtClsTmp.Text = r["ClassTemplet"].ToString();
                    if (!r.IsNull("ReadNewsTemplet")) this.TxtBrwTmp.Text = r["ReadNewsTemplet"].ToString();
                    if (!r.IsNull("SpecialTemplet")) this.TxtSpcTmp.Text = r["SpecialTemplet"].ToString();
                    if (!r.IsNull("Domain")) this.TxtDomain.Text = r["Domain"].ToString();
                    //权限空缺
                    if (!r.IsNull("isCheck"))
                    {
                        int n = int.Parse(r["isCheck"].ToString());
                        if (n == 1)
                            this.ChbAuditing.Checked = true;
                        else if (n == 0)
                            this.ChbAuditing.Checked = false;
                    }
                    if (!r.IsNull("Keywords")) this.TxtKeywords.Text = r["Keywords"].ToString();
                    if (!r.IsNull("Descript")) this.TxtDescribe.Text = r["Descript"].ToString();
                    if (!r.IsNull("ContrTF"))
                    {
                        int n = int.Parse(r["ContrTF"].ToString());
                        if (n == 1)
                            this.ChbContribute.Checked = true;
                        else if (n == 0)
                            this.ChbContribute.Checked = false;
                    }
                    if (!r.IsNull("ShowNaviTF"))
                    {
                        int n = int.Parse(r["ShowNaviTF"].ToString());
                        if (n == 1)
                            this.ChbShowNavi.Checked = true;
                        else if (n == 0)
                            this.ChbShowNavi.Checked = false;
                    }
                    if (!r.IsNull("UpfileType")) this.TxtUpFileType.Text = r["UpfileType"].ToString();
                    if (!r.IsNull("UpfileSize")) this.TxtUpFileSize.Text = r["UpfileSize"].ToString();
                    if (!r.IsNull("NaviContent")) this.TxtLead.Text = r["NaviContent"].ToString();
                    if (!r.IsNull("NaviPicURL")) this.TxtPic.Text = r["NaviPicURL"].ToString();
                    if (PublishType == "1")
                    {
                        if (!r.IsNull("SaveType"))
                        {
                            int n = int.Parse(r["SaveType"].ToString());
                            if (n == 0)
                                this.DdlType.Items[0].Selected = true;
                            else if (n == 1)
                                this.DdlType.Items[1].Selected = true;
                            else if (n == 2)
                                this.DdlType.Items[2].Selected = true;
                        }
                    }
                    if (!r.IsNull("PicSavePath")) this.TxtAccessories.Text = r["PicSavePath"].ToString();
                    if (!r.IsNull("SaveFileType"))
                    {
                        int n = int.Parse(r["SaveFileType"].ToString());
                        if (n == 1)
                            this.RadFileType.Items[1].Selected = true;
                        else if (n == 0)
                            this.RadFileType.Items[0].Selected = true;
                    }
                    if (!r.IsNull("SaveDirPath")) this.TxtFileDir.Text = r["SaveDirPath"].ToString();
                    if (!r.IsNull("SaveDirRule")) this.TxtDirRule.Text = r["SaveDirRule"].ToString();
                    if (!r.IsNull("SaveFileRule")) this.TxtFileRule.Text = r["SaveFileRule"].ToString();
                    if (!r.IsNull("NaviPosition")) this.TxtNaviPosition.Text = r["NaviPosition"].ToString();
                    if (!r.IsNull("IndexEXName")) this.DdlIndexEXName.SelectedValue = r["IndexEXName"].ToString();
                    if (!r.IsNull("ClassEXName")) this.DdlClassEXName.SelectedValue = r["ClassEXName"].ToString();
                    if (!r.IsNull("NewsEXName")) this.DdlNewsEXName.SelectedValue = r["NewsEXName"].ToString();
                    if (!r.IsNull("SpecialEXName")) this.DdlOtherEXName.SelectedValue = r["SpecialEXName"].ToString();
                    //if (!r.IsNull("classRefeshNum")) this.TxtClassRefresh.Text = r["classRefeshNum"].ToString();
                    //if (!r.IsNull("infoRefeshNum")) this.TxtInfoRefresh.Text = r["infoRefeshNum"].ToString();
                    //if (!r.IsNull("DelNum")) this.TxtDelNum.Text = r["DelNum"].ToString();
                    //if (!r.IsNull("SpecialNum")) this.TxtSpecialNum.Text = r["SpecialNum"].ToString();
                    #region 权限
                    if (!r.IsNull("isDelPoint")) this.UserPop1.AuthorityType = int.Parse(r["isDelPoint"].ToString());
                    if (!r.IsNull("Gpoint")) this.UserPop1.Gold = int.Parse(r["Gpoint"].ToString());
                    if (!r.IsNull("iPoint")) this.UserPop1.Point = int.Parse(r["iPoint"].ToString());
                    if (!r.IsNull("GroupNumber")) this.UserPop1.MemberGroup = r["GroupNumber"].ToString().Split('|');
                    #endregion 权限
                }
                else
                {
                    PageError("找不到站群!", "");
                }
                this.LblCaption.Text = this.LblNavigation.Text = "修改站群";
            }
            else
            {
                PageError("此版本不具备创建站群管理功能。", "javascript:history.back()", true);
                string _tmpSite = "";
                string _dirSite ="";

⌨️ 快捷键说明

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