Esempio n. 1
0
 public Contact Create(Contact instance)
 {
   instance.ModifyDate = DateTime.Now;
   _contactRepository.InsertOrUpdate(instance);
   _contactRepository.Save();
   return instance;
 }
 public ActionResult Create(Contact contact)
 {
   if (ModelState.IsValid)
   {
     _contactRepository.InsertOrUpdate(contact);
     _contactRepository.Save();
     if (Request.IsAjaxRequest())
     {
       return Json(contact, JsonRequestBehavior.AllowGet);
     }
     return RedirectToAction("Index");
   }
   else
   {
     return View();
   }
 }
Esempio n. 3
0
 public Contact Update(string id, Contact instance)
 {
   _contactRepository.InsertOrUpdate(instance);
   _contactRepository.Save();
   return instance;
 }