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

📄 userinfo_update.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.Content.Common;

public partial class user_info_userinfo_update : NetCMS.Web.UI.UserPage
{
    UserMisc rd = new UserMisc();
    rootPublic pd = new rootPublic();
    public static string dirDumm = NetCMS.Config.UIConfig.dirDumm;
    public static string UserdirFile = NetCMS.Config.UIConfig.UserdirFile;
    public static string Rdir = UserdirFile;
    public static string gEmaill = "";
    public static string _STR = "";
    DefineTable tab = new DefineTable();
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
        getDefine(NetCMS.Global.Current.UserNum);
        if (!IsPostBack)
        {
            
            if (dirDumm.Trim() != "")
            {
                Rdir = NetCMS.Config.UIConfig.dirDumm + "/" + UserdirFile;
            }
            copyright.InnerHtml = CopyRight;
            sex.InnerHtml = sexlist();
            marriage.InnerHtml = marriagelist();
            isopen.InnerHtml = isopenlist();

            DataTable dt = rd.sel_Misc(NetCMS.Global.Current.UserNum,2);
            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    this.NickName.Text = dt.Rows[0]["NickName"].ToString();
                    if (dt.Rows[0]["birthday"].ToString() != "")
                    {
                        this.birthday.Text = ((DateTime)dt.Rows[0]["birthday"]).ToString("yyyy-MM-dd");
                    }
                    if (pd.getUserUserInfo(NetCMS.Global.Current.UserNum) == 1)
                    {
                        this.Userinfo.Text = NetCMS.Common.Input.ToTxt(dt.Rows[0]["Userinfo"].ToString());
                    }
                    else
                    {
                        UserInfo_div.Visible = false;
                    }
                    gEmaill = dt.Rows[0]["email"].ToString();
                    this.UserFace.Text = dt.Rows[0]["UserFace"].ToString();
                    this.userFacesize.Text = dt.Rows[0]["userFacesize"].ToString();
                    this.RealName.Text = dt.Rows[0]["RealName"].ToString();


                    string str_userHeadpic = dt.Rows[0]["UserFace"].ToString().ToLower().Replace("{@userdirfile}", UserdirFile);
                    string str_userHeadSize = dt.Rows[0]["userFacesize"].ToString();
                    string[] arr_userheadSize = str_userHeadSize.Split('|');

                    userFace_div.InnerHtml = "<img id=\"changeFace\" src=\"" + str_userHeadpic + "\" border=\"0\" width=\"" + arr_userheadSize[0].ToString() + "\" height=\"" + arr_userheadSize[1].ToString() + "\" />";
                }
            }

            DataTable dt1 = rd.sel_Misc(NetCMS.Global.Current.UserNum,3);
            if (dt1 != null)
            {
                if (dt1.Rows.Count > 0)
                {
                    this.Nation.Text = dt1.Rows[0]["Nation"].ToString();
                    this.nativeplace.Text = dt1.Rows[0]["nativeplace"].ToString();
                    this.character.Text = dt1.Rows[0]["character"].ToString();
                    this.orgSch.Text = dt1.Rows[0]["orgSch"].ToString();
                    this.job.Text = dt1.Rows[0]["job"].ToString();
                    this.education.Text = dt1.Rows[0]["education"].ToString();
                    this.Lastschool.Text = dt1.Rows[0]["Lastschool"].ToString();
                    this.UserFan.Text = dt1.Rows[0]["UserFan"].ToString();
                }
            }
        }
    }

    protected string sexlist()
    {
        string liststr = "";
        DataTable dt = rd.sel_sysInfos(pd.getUserName_uid(NetCMS.Global.Current.UserNum),0);
        if (dt != null)
        {
            liststr += "<select name=\"sex\">";
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["sex"].ToString() == "0")
                {
                    liststr += "<option value=\"0\" selected>保密</option>";
                }
                else
                {
                    liststr += "<option value=\"0\">保密</option>";
                }
                if (dt.Rows[0]["sex"].ToString() == "1")
                {
                    liststr += "<option value=\"1\" selected>男</option>";
                }
                else
                {
                    liststr += "<option value=\"1\">男</option>";
                }
                if (dt.Rows[0]["sex"].ToString() == "2")
                {
                    liststr += "<option value=\"2\" selected>女</option>";
                }
                else
                {
                    liststr += "<option value=\"2\">女</option>";
                }
                liststr += "</select>";
            }
            else
            {
                liststr += "<option value=\"0\" selected>保密</option>";
                liststr += "<option value=\"1\">男</option>";
                liststr += "<option value=\"2\">女</option>";
            }
        }
        return liststr;
    }

    protected string marriagelist()
    {
        string liststr = "";
        DataTable dt = rd.sel_sysInfos(pd.getUserName_uid(NetCMS.Global.Current.UserNum),0);
        if (dt != null)
        {
            liststr += "<select name=\"marriage\">";
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["marriage"].ToString() == "0")
                {
                    liststr += "<option value=\"0\" selected>保密</option>";
                }
                else
                {
                    liststr += "<option value=\"0\">保密</option>";
                }
                if (dt.Rows[0]["marriage"].ToString() == "1")
                {
                    liststr += "<option value=\"1\" selected>未婚</option>";
                }
                else
                {
                    liststr += "<option value=\"1\">未婚</option>";
                }
                if (dt.Rows[0]["marriage"].ToString() == "2")
                {
                    liststr += "<option value=\"2\" selected>已婚</option>";
                }
                else
                {
                    liststr += "<option value=\"2\">已婚</option>";
                }
                liststr += "</select>";
            }
            else
            {
                liststr += "<option value=\"0\" selected>保密</option>";
                liststr += "<option value=\"1\">未婚</option>";
                liststr += "<option value=\"2\">已婚</option>";
            }
        }
        return liststr;
    }

    protected string isopenlist()
    {
        string liststr = "";
        DataTable dt = rd.sel_sysInfos(pd.getUserName_uid(NetCMS.Global.Current.UserNum),0);
        if (dt != null)
        {
            liststr += "<select name=\"isopen\">";
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["isopen"].ToString() == "0")
                {
                    liststr += "<option value=\"0\" selected>不开放</option>";
                }
                else
                {
                    liststr += "<option value=\"0\">不开放</option>";
                }
                if (dt.Rows[0]["isopen"].ToString() == "1")
                {
                    liststr += "<option value=\"1\" selected>开放</option>";
                }
                else
                {
                    liststr += "<option value=\"1\">开放</option>";
                }
               liststr += "</select>";
            }
            else
            {
                liststr += "<option value=\"1\" selected>开放</option>";
                liststr += "<option value=\"0\">不开放</option>";
            }
        }
        return liststr;
    }

    
    protected void submitSave(object sender, EventArgs e)
    {
        if (Page.IsValid == true)                       //判断是否验证成功
        {

            string NickName = Request.Form["NickName"];
            if (NickName == "")
            {
                PageError("请填写昵称", "userinfo_update.aspx");
            }
            string sex = Request.Form["sex"];
            string birthday = this.birthday.Text;
            string Nation = this.Nation.Text;
            string nativeplace = NetCMS.Common.Input.Htmls(this.nativeplace.Text);
            string Userinfo = "";
            if (this.Userinfo.Text != "")
            {
                Userinfo = NetCMS.Common.Input.Htmls(this.Userinfo.Text); 
            }
            string UserFace = NetCMS.Common.Input.Htmls(this.UserFace.Text);
            string userFacesize = NetCMS.Common.Input.Htmls(this.userFacesize.Text);
            string character =  NetCMS.Common.Input.Htmls(this.character.Text);
            string UserFan = NetCMS.Common.Input.Htmls(this.UserFan.Text);
            string orgSch = NetCMS.Common.Input.Htmls(this.orgSch.Text);
            string job = this.job.Text;
            string education = this.education.Text;
            string Lastschool = NetCMS.Common.Input.Htmls(this.Lastschool.Text);
            string marriage = Request.Form["marriage"];
            string isopen = Request.Form["isopen"];
            string RealName = NetCMS.Common.Input.Htmls(this.RealName.Text);
            string[] userFacesizes = userFacesize.Split('|');
            int uf = 0, uf1 = 0;

⌨️ 快捷键说明

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