Web/Admin/CustomersAdmin/customersUpdate.aspx.cs

(完整代码) 1KB

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;

public partial class Admin_CustomersAdmin_customersUpdate : System.Web.UI.Page
{
    Bll.CustomerBll cb = new Bll.CustomerBll();
    Model.tab_customers modelCb = new Model.tab_customers();
    PublicClass pc = new PublicClass();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ViewState["cusID"] = Request.QueryString["Cid"];
            modelCb.customerID = Convert.ToInt32(ViewState["cusID"].ToString());
            DataTable dt = cb.CustomerSelect(modelCb);
            this.Label1.Text = dt.Rows[0]["customerName"].ToString();
            this.TextBox2.Text = dt.Rows[0]["customerEmail"].ToString();
            this.TextBox3.Text = dt.Rows[0]["customerTel"].ToString();
            this.TextBox7.Text = dt.Rows[0]["customerCode"].ToString();
            this.TextBox4.Text = dt.Rows[0]["customerAddress"].ToString();
            this.Label2.Text = dt.Rows[0]["customerPwd"].ToString();
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
       
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
       
        modelCb.customerName = this.Label1.Text;
        modelCb.customerEmail = this.TextBox2.Text;
        modelCb.customerTel = this.TextBox3.Text;
        modelCb.customerCode = this.TextBox7.Text;
        modelCb.customerAddress = this.TextBox4.Text;
        modelCb.customerPwd = this.Label2.Text;
        modelCb.customerID =Convert.ToInt32(ViewState["cusID"].ToString());
        int i= cb.update(modelCb);
        if (i!=0)
        {
            Response.Write("<script>alert('更新成功');location='CustomerInfo.aspx'</script>");
        }
    }
}

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

AI 解读 AI

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

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