Exemple #1
0
 public ActionResult Create(Religion religion)
 {
     if (ModelState.IsValid) {
         religionRepository.InsertOrUpdate(religion);
         religionRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
Exemple #2
0
 public void InsertOrUpdate(Religion religion)
 {
     if (religion.ReligionID == default(int)) {
         // New entity
         context.Religion.Add(religion);
     } else {
         // Existing entity
         context.Entry(religion).State = EntityState.Modified;
     }
 }
Exemple #3
0
 public ViewResult Search(Religion searchReligion)
 {
     if(searchReligion!=null)
     {
                     }
                 return View("Index",religionRepository.All);
 }