-
Notifications
You must be signed in to change notification settings - Fork 0
/
AddAdmin.aspx.cs
39 lines (34 loc) · 1.11 KB
/
AddAdmin.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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_AddAdmin : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
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");
}
}
}