Пример #1
0
 public ActionResult Create(Disability disability)
 {
     if (ModelState.IsValid) {
         disabilityRepository.InsertOrUpdate(disability);
         disabilityRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
Пример #2
0
 public void InsertOrUpdate(Disability disability)
 {
     if (disability.DisabilityID == default(int)) {
         // New entity
         context.Disability.Add(disability);
     } else {
         // Existing entity
         context.Entry(disability).State = EntityState.Modified;
     }
 }
Пример #3
0
 public ViewResult Search(Disability searchDisability)
 {
     if(searchDisability!=null)
     {
                     }
                 return View("Index",disabilityRepository.All);
 }