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

📄 userinfo_contact.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;
using NetCMS.Content.Common;

public partial class user_info_userinfo_contact : NetCMS.Web.UI.UserPage
{
    UserMisc rd = new UserMisc();
    rootPublic pd = new rootPublic();
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
        if (!IsPostBack)
        {
            
            copyright.InnerHtml = CopyRight;
            DataTable dt = rd.sel_Misc(NetCMS.Global.Current.UserNum,4);
            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    this.province.Text = dt.Rows[0]["province"].ToString();
                    this.City.Text = dt.Rows[0]["City"].ToString();
                    this.Address.Text = dt.Rows[0]["Address"].ToString();
                    this.Postcode.Text = dt.Rows[0]["Postcode"].ToString();
                    this.FaTel.Text = dt.Rows[0]["FaTel"].ToString();
                    this.WorkTel.Text = dt.Rows[0]["WorkTel"].ToString();
                    this.Fax.Text = dt.Rows[0]["Fax"].ToString();
                    this.QQ.Text = dt.Rows[0]["QQ"].ToString();
                    this.MSN.Text = dt.Rows[0]["MSN"].ToString();
                }
            }
        }
    }

    protected void submitSave(object sender, EventArgs e)
    {
        if (Page.IsValid == true)                       //判断是否验证成功
        {
            string province = NetCMS.Common.Input.Htmls(this.province.Text);
            string City = NetCMS.Common.Input.Htmls(this.City.Text);
            string Address = NetCMS.Common.Input.Htmls(this.Address.Text);
            string Postcode = NetCMS.Common.Input.Htmls(this.Postcode.Text);
            string FaTel = NetCMS.Common.Input.Htmls(this.FaTel.Text);
            string WorkTel = NetCMS.Common.Input.Htmls(this.WorkTel.Text);
            string Fax = NetCMS.Common.Input.Htmls(this.Fax.Text);
            string QQ = NetCMS.Common.Input.Htmls(this.QQ.Text);
            string MSN = NetCMS.Common.Input.Htmls(this.MSN.Text);

            DataTable sdt = rd.sel_Misc(NetCMS.Global.Current.UserNum,4);
            if (sdt != null)
            {
                if (sdt.Rows.Count > 0)
                {
                    NetCMS.Model.UserInfo2 uc1 = new NetCMS.Model.UserInfo2();
                    uc1.UserNum = NetCMS.Global.Current.UserNum;
                    uc1.province = province;
                    uc1.City = City;
                    uc1.Address = Address;
                    uc1.Postcode = Postcode;
                    uc1.FaTel = FaTel;
                    uc1.WorkTel = WorkTel;
                    uc1.Fax = Fax;
                    uc1.QQ = QQ;
                    uc1.MSN = MSN;
                    rd.addUpdate_fields(uc1,true);
                }
                else
                {
                    NetCMS.Model.UserInfo2 uc1 = new NetCMS.Model.UserInfo2();
                    uc1.UserNum = NetCMS.Global.Current.UserNum;
                    uc1.province = province;
                    uc1.City = City;
                    uc1.Address = Address;
                    uc1.Postcode = Postcode;
                    uc1.FaTel = FaTel;
                    uc1.WorkTel = WorkTel;
                    uc1.Fax = Fax;
                    uc1.QQ = QQ;
                    uc1.MSN = MSN;
                    rd.addUpdate_fields(uc1,false);
                }
            }
            else
            {
                NetCMS.Model.UserInfo2 uc1 = new NetCMS.Model.UserInfo2();
                uc1.UserNum = NetCMS.Global.Current.UserNum;
                uc1.province = province;
                uc1.City = City;
                uc1.Address = Address;
                uc1.Postcode = Postcode;
                uc1.FaTel = FaTel;
                uc1.WorkTel = WorkTel;
                uc1.Fax = Fax;
                uc1.QQ = QQ;
                uc1.MSN = MSN;
                rd.addUpdate_fields(uc1,true);
            }
            PageRight("修改资料成功!", "userinfo_contact.aspx");
        }
    }
}

⌨️ 快捷键说明

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