Beispiel #1
0
 protected void btnXoa_Click(object sender, EventArgs e)
 {
     try
     {
         TinTuc_Xoa(txtMaTin.Text);
         GridTable.DataSource = TinTuc_DS();
         GridTable.DataBind();
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Xóa thành công!');", true);
     } catch
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Thêm thất bại!');", true);
     }
 }
Beispiel #2
0
 protected void btnXoa_Click(object sender, EventArgs e)
 {
     try
     {
         Xoa_DT(txtMa.Text);
         GridTable.DataSource = DienThoai_DS();
         GridTable.DataBind();
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Sửa thành công!');", true);
     } catch
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Sửa lỗi!');", true);
     }
 }
Beispiel #3
0
 protected void btnThem_Click(object sender, EventArgs e)
 {
     try
     {
         Them_DT(txtMa.Text, txtTen.Text, txtUpload.FileName, txtPK.Text, int.Parse(txtGia.Text), dropLoai.SelectedValue);
         GridTable.DataSource = DienThoai_DS();
         GridTable.DataBind();
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Thêm thành công!');", true);
     } catch
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Thêm thất bại!');", true);
     }
 }
 protected void bntThem_Click(object sender, EventArgs e)
 {
     try
     {
         TinTuc_Them(txtMaTin.Text, txtTieuDe.Text, txtNgayDang.Text, AnhUp.FileName, DropTT.SelectedValue);
         GridTable.DataSource = TinTuc_DS();
         GridTable.DataBind();
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Thêm thành công!');", true);
     }
     catch
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Thêm thất bại!');", true);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     GridTable.DataSource = TinTuc_DS();
     GridTable.DataBind();
     ListDrop();
 }
Beispiel #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     GridTable.DataSource = DienThoai_DS();
     GridTable.DataBind();
     ListUpdate();
 }