コード例 #1
0
ファイル: ReligionController.cs プロジェクト: absdk/RslSDK
 public ActionResult Create(Religion religion)
 {
     if (ModelState.IsValid) {
         religionRepository.InsertOrUpdate(religion);
         religionRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
コード例 #2
0
ファイル: ReligionRepository.cs プロジェクト: absdk/RslSDK
 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;
     }
 }
コード例 #3
0
ファイル: ReligionController.cs プロジェクト: absdk/RslSDK
 public ViewResult Search(Religion searchReligion)
 {
     if(searchReligion!=null)
     {
                     }
                 return View("Index",religionRepository.All);
 }