Exemplo n.º 1
0
    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");
        }
    }