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