JobsOnline/Account/frmSelfContact.aspx.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SqlDataClass;

public partial class Account_frmSelfContact : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int id = 0;
            if (Session["userID"] != null)
            {
                id = Convert.ToInt32(Session["userID"]);
                TextBind(id);
            }
            hideid.Value = id.ToString();

        }
    }

    private void TextBind(int sid)
    {
        SelfContact sf = BaseData.Instanse.SelectSelfContactBySbh(sid);
        if (sf != null)
        {
            txtAddress.Text = sf.address;
            txtSelfPhone.Text = sf.selfPhone;
            txtQQ.Text = sf.QQ;
            txtEmail.Text = sf.email;
            txtotherContract.Text = sf.otherContract;
        }
    }

    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            string sqlstr = "";

            SelfContact sc = new SelfContact();
            sc.sbh = Convert.ToInt32(hideid.Value);
            sc.address = txtAddress.Text;
            sc.selfPhone = txtSelfPhone.Text;
            sc.QQ = txtQQ.Text;
            sc.email = txtEmail.Text;
            sc.otherContract = txtotherContract.Text;

            BaseData.Instanse.UpdateSelfContact(sc);
            ClientScript.RegisterClientScriptBlock(this.GetType(), "s", "<script>alert('保存成功!');</script>");

        }
        catch (Exception)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "s", "<script>alert('保存失败!');'</script>");
后面还有 3 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。