Example #1
0
 public ActionResult ModifyRegion(RegionViewModel viewModel)
 {
     RegionOperationService service = new RegionOperationService(regionRepository,
         viewModel.CityName, viewModel.DistrictName, viewModel.RegionName);
     bool result = service.SaveOneRegion(viewModel.ForceSwapRegionDistricts);
     if (result)
     {
         TempData["success"] = viewModel.SaveRegionSuccessMessage;
     }
     else
     {
         TempData["error"] = viewModel.SaveRegionFailMessage;
     }
     TempData["RegionViewModel"] = new RegionViewModel("modifyRegion")
     {
         CityName = viewModel.CityName,
         DistrictName = viewModel.DistrictName,
         TownName = viewModel.TownName,
         RegionName = viewModel.RegionName
     };
     return RedirectToAction("Region");
 }
 public bool TestAddRegionForce(int cityId, int districtId, int regionId)
 {
     service = new RegionOperationService(repository,
         "C-" + cityId, "D-" + districtId, "R-" + regionId);
     return service.SaveOneRegion(true);
 }