private void ShowInfo(int id) { AirTicketWeb.BLL.Admin bll = new AirTicketWeb.BLL.Admin(); AirTicketWeb.Model.Admin model = bll.GetModel(id); this.TextBox1.Text = model.Apwd; this.txtName.Text = model.Aname; }
protected void Button1_Click(object sender, EventArgs e) { string Apwd = this.TextBox1.Text; string Aname = this.txtName.Text; AirTicketWeb.Model.Admin model = new AirTicketWeb.Model.Admin(); model.id = int.Parse(Request.Params["id"]); model.Apwd = Apwd; model.Aname = Aname; AirTicketWeb.BLL.Admin bll = new AirTicketWeb.BLL.Admin(); bll.Update(model); Maticsoft.DBUtility.js.AlertAndRedirect("Modify Successful!", "AdminList.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { AirTicketWeb.BLL.Admin bll = new AirTicketWeb.BLL.Admin(); if (bll.Exists(txtName.Text)) { Maticsoft.DBUtility.js.AlertAndRedirect("This ID existed. Please change another one. ", "AddAdmin.aspx"); } else { string Apwd = this.TextBox1.Text; string Aname = this.txtName.Text; AirTicketWeb.Model.Admin model = new AirTicketWeb.Model.Admin(); model.Apwd = Apwd; model.Aname = Aname; bll.Add(model); Maticsoft.DBUtility.js.AlertAndRedirect("Success!", "AdminList.aspx"); } }