public JsonResult AddContact(Contact contact) { try { sc.AddContact(contact); return Json(new { success = true, msg = "Tin nhắn của bạn đã gửi thành công" }, JsonRequestBehavior.AllowGet); } catch { return Json(new { success = false, msg = "Đã có lỗi xảy ra" }, JsonRequestBehavior.AllowGet); } }
public void AddContact(Contact contact) { db.Insert(contact); }