/// <summary> /// 删除数据 /// </summary> /// <returns></returns> public IActionResult Del() { try { int id = Convert.ToInt32(Request.Query["id"]); ViewBag.customer_id = Convert.ToInt32(Request.Query["customer_id"]); ViewBag.type = Convert.ToInt32(Request.Query["type"]); int count = CM.Del(id); if (count > 0) { return(Json("Success")); } else { return(Json("Fail")); } } catch (Exception ex) { throw ex; } }
private void button6_Click(object sender, EventArgs e) { ContactManager.Del(ContactList.Items[ContactList.SelectedIndex].ToString()); LoadContacts(); }