Esempio n. 1
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         ThemDT(txtMa.Text, txtTen.Text, int.Parse(txtGia.Text), txtPK.Text, txtLoai.Text);
         GridViewTab.DataSource = DSDienThoai();
         GridViewTab.DataBind();
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Nhập vào thành công');", true);
     } catch
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Nhập vào lỗi!');", true);
     }
 }
Esempio n. 2
0
 protected void bntXoa_Click(object sender, EventArgs e)
 {
     XoaDT(txtMa.Text);
     GridViewTab.DataSource = DSDienThoai();
     GridViewTab.DataBind();
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     GridViewTab.DataSource = DSDienThoai();
     GridViewTab.DataBind();
 }