Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 public void AddContact(Contact contact)
 {
     db.Insert(contact);
 }