protected void selectid_Click(object sender, EventArgs e) { Int32 myid = 0; Int32.TryParse(id.Text.ToString(), out myid); bool cekid = RepositoryProduct.CekID(myid); if (cekid) { Response.Redirect("InsertNewProductPage.aspx?id=" + myid); } else { Response.Write("<script>alert('ID does not exists.')</script>"); } }
protected void deleteproduct_Click(object sender, EventArgs e) { Int32 deletebyID = 0; Int32.TryParse(id.Text.ToString(), out deletebyID); bool cek = RepositoryProduct.CekID(deletebyID); if (cek) { RepositoryProduct.DeleteProduct(deletebyID); Response.Write("<script>alert('Delete product successfully.')</script>"); refresh(); } else { Response.Write("<script>alert('ID does not exists.')</script>"); } }