예제 #1
0
 public ActionResult Create(Region region)
 {
     if (ModelState.IsValid) {
         regionRepository.InsertOrUpdate(region);
         regionRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
예제 #2
0
 public void InsertOrUpdate(Region region)
 {
     if (region.RegionID == default(int)) {
         // New entity
         context.Region.Add(region);
     } else {
         // Existing entity
         context.Entry(region).State = EntityState.Modified;
     }
 }
예제 #3
0
 public ViewResult Search(Region searchRegion)
 {
     if(searchRegion!=null)
     {
                     }
                 return View("Index",regionRepository.All);
 }
예제 #4
0
 public ActionResult Create()
 {
     Region region = new Region();
     return View(region);
 }