public ActionResult Delete(int id) { Author author = dao.Find(id); dao.Delete(author); return(RedirectToAction("Index")); }
private void Delete_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrWhiteSpace(Id.Text)) { int id; if (int.TryParse(Id.Text, out id)) { creatorDAO.Delete(id); } } }
public JsonResult Delete(long[] id) { try { int[] status = new int[id.Length]; for (int i = 0; i < id.Length; i++) { status[i] = dao.Delete(id[i]); } return(Json(new { status = status })); } catch (Exception) { return(Json(new { status = 0 })); } }
public static void Delete(int id) { AuthorDAO.Delete(id); }