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