Example #1
0
 public ActionResult Create(Salutation salutation)
 {
     if (ModelState.IsValid) {
         salutationRepository.InsertOrUpdate(salutation);
         salutationRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
Example #2
0
 public void InsertOrUpdate(Salutation salutation)
 {
     if (salutation.SalutationID == default(int)) {
         // New entity
         context.Salutation.Add(salutation);
     } else {
         // Existing entity
         context.Entry(salutation).State = EntityState.Modified;
     }
 }
Example #3
0
 public ViewResult Search(Salutation searchSalutation)
 {
     if(searchSalutation!=null)
     {
                     }
                 return View("Index",salutationRepository.All);
 }