public IHttpActionResult Delete([FromUri] int id) { bool success = authorBll.DeleteAuthor(id); if (success) { return(Ok()); } return(BadRequest()); }
protected void DeleteButton_Click(object sender, EventArgs e) { if (authorIdTextBox.Text=="") { Response.Write("<script>alert('Please Insert Author Id');</script>"); } else { author = new Author(); author.AuthorId = Convert.ToInt32(authorIdTextBox.Text); string message = authorManager.DeleteAuthor(author.AuthorId); Response.Write("<script>alert('" + message + "');</script>"); AuthorGridView.DataBind(); } }