public ActionResult Edit(Location location) { location.LastUpdatedTimestamp = DateTime.Now; location.LastUpdatedBy = User.Pilot().ToString(); if (!location.ICAO.IsNullOrWhiteSpace()) location.ICAO = location.ICAO.ToUpperInvariant(); if (ModelState.IsValid) { db.Entry(location).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(location); }
private void PopulateViewBag(Location location) { this.ViewBag.Country = new SelectList(GetCountriesByIso3166(), "TwoLetterISORegionName", "EnglishName", (location == null) ? (object)null : location.Country); }