Example #1
0
        public ActionResult Edit(int?id)
        {
            DbLocation location = GetLocationIfExistsAndUserHasAccess(id);

            if (location == null)
            {
                return(RedirectToAction("Index"));
            }

            ViewBag.Location   = location;
            ViewBag.LocationId = location.Id;

            LocationEditViewModel locationModel = location.ToLocationEditValidationModel();

            return(View(locationModel));
        }