예제 #1
0
 public ActionResult Create(FamilyRelationship familyrelationship)
 {
     if (ModelState.IsValid) {
         familyrelationshipRepository.InsertOrUpdate(familyrelationship);
         familyrelationshipRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
예제 #2
0
 public void InsertOrUpdate(FamilyRelationship familyrelationship)
 {
     if (familyrelationship.FamilyRelationshipID == default(int)) {
         // New entity
         context.FamilyRelationship.Add(familyrelationship);
     } else {
         // Existing entity
         context.Entry(familyrelationship).State = EntityState.Modified;
     }
 }
예제 #3
0
 public ViewResult Search(FamilyRelationship searchFamilyRelationship)
 {
     if(searchFamilyRelationship!=null)
     {
                     }
                 return View("Index",familyrelationshipRepository.All);
 }