コード例 #1
0
 public ActionResult Create(EmploymentType employmenttype)
 {
     if (ModelState.IsValid) {
         employmenttypeRepository.InsertOrUpdate(employmenttype);
         employmenttypeRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
コード例 #2
0
 public void InsertOrUpdate(EmploymentType employmenttype)
 {
     if (employmenttype.EmploymentTypeID == default(int)) {
         // New entity
         context.EmploymentType.Add(employmenttype);
     } else {
         // Existing entity
         context.Entry(employmenttype).State = EntityState.Modified;
     }
 }
コード例 #3
0
 public ViewResult Search(EmploymentType searchEmploymentType)
 {
     if(searchEmploymentType!=null)
     {
                     }
                 return View("Index",employmenttypeRepository.All);
 }