Add required city field

This commit is contained in:
2014-05-21 10:17:05 -04:00
parent b2f8baaca6
commit 365aa47328
10 changed files with 70 additions and 41 deletions
+10
View File
@@ -270,6 +270,16 @@ namespace MileageTraker.Web.Controllers
Action = GetFixLink(viewModel)
}, JsonRequestBehavior.AllowGet);
}
// verify city exists
if (DataService.FindCityByName(log.CityName) == null)
{
return Json(new
{
Status = ImportStatus.Failure.ToString(),
Message = "City must exist in system",
Action = GetFixLink(viewModel)
}, JsonRequestBehavior.AllowGet);
}
// SAVE IT!
DataService.AddLog(log);