Exemplo n.º 1
0
 public ActionResult Create(Disability disability)
 {
     if (ModelState.IsValid) {
         disabilityRepository.InsertOrUpdate(disability);
         disabilityRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 3
0
 public ViewResult Search(Disability searchDisability)
 {
     if(searchDisability!=null)
     {
                     }
                 return View("Index",disabilityRepository.All);
 }