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

📄 url_add.aspx.cs

📁 最好用的站点内容管理系统 全部源代码都有
💻 CS
字号:
//======================================================
//==     (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;

public partial class user_info_url_add : NetCMS.Web.UI.UserPage
{
    UserMisc rd = new UserMisc();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            
            Response.Expires = 0;
            Response.CacheControl = "no-cache";
            string ID = Request.QueryString["id"];
            if (ID != null && ID != string.Empty)
            {
                DataTable dt = rd.sel_sysInfos(int.Parse(ID.ToString()),9);
                if (dt != null && dt.Rows.Count > 0)
                {
                    this.URLName.Text = dt.Rows[0]["URLName"].ToString();
                    this.URL.Text = dt.Rows[0]["URL"].ToString();
                    this.Content.Text = dt.Rows[0]["Content"].ToString();
                    //this.URLName.Text = dt.Rows[0]["URLName"].ToString();
                    //URLColor = dt.Rows[0]["URLColor"].ToString();
                    string URLColor = dt.Rows[0]["URLColor"].ToString();
                    for (int k = 0; k < this.URLColor.Items.Count; k++)
                    {
                        if (this.URLColor.Items[k].Value == URLColor)
                        {
                            this.URLColor.Items[k].Selected = true;
                        }
                    }
                }
                DataTable dts = rd.sel_Misc(NetCMS.Global.Current.UserNum,14);
                if (dts != null)
                {
                    this.ClassID.DataSource = dts;
                    this.ClassID.DataTextField = "ClassName";
                    this.ClassID.DataValueField = "ID";
                    this.ClassID.DataBind();
                    for (int m = 0; m < this.ClassID.Items.Count; m++)
                    {
                        if (this.ClassID.Items[m].Value == dt.Rows[0]["ClassID"].ToString()) 
                        { 
                            this.ClassID.Items[m].Selected = true; 
                        }
                    }
                }
            }
            else
            {
                DataTable dts = rd.sel_Misc(NetCMS.Global.Current.UserNum,14);
                if (dts != null)
                {
                    this.ClassID.DataSource = dts;
                    this.ClassID.DataTextField = "ClassName";
                    this.ClassID.DataValueField = "ID";
                    this.ClassID.DataBind();
                }
            }
        }
    }


    protected void Button1_Click(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            string URLName = NetCMS.Common.Input.Htmls(this.URLName.Text);
            string URL = this.URL.Text;
            string URLColor = this.URLColor.SelectedValue;
            string ClassID = this.ClassID.SelectedValue;
            string Content = NetCMS.Common.Input.Htmls(this.Content.Text);
            string ID = Request.QueryString["id"];
            if (URLName == string.Empty  || URL == string.Empty || ClassID == string.Empty)
            {
                PageError("带*必须填写", "");
            }
            else
            {
                if (ID != null && ID != string.Empty)
                {
                    rd.updateURL(URLName, URL, URLColor, ClassID, Content, 1, int.Parse(ID));
                }
                else
                {
                    rd.updateURL(URLName, URL, URLColor, ClassID, Content, 0, 0);
                }
            }
            PageRight("操作成功", "URL.aspx");
        }
    }
}

⌨️ 快捷键说明

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