private void buttonDelete_Click(object sender, EventArgs e) { c.ContactID = Convert.ToInt32(textBoxContactID.Text); bool success = c.Delete(c); if (success == true) { MessageBox.Show("Kontakt został pomyślnie usunięty."); DataTable dt = c.Select(); dataGridViewContactList.DataSource = dt; Clear(); } else { MessageBox.Show("Błąd w usuwaniu kontaktu. Spróbuj ponownie."); } }
public ActionResult Delete(int id) { cc.Delete(id); ViewBag.ThongBao = "Đã xóa"; return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { cc.Delete(id); return(RedirectToAction("Index")); }