// GET: /Administration/Places/Create public ActionResult Create() { PlaceViewModel place = new PlaceViewModel(); place.EatTypeItems = GetEatTypeItems(); place.PriceTypeItems = GetPriceTypeItems(); return View(place); }
// GET: /Administration/Places/Edit/5 public ActionResult Edit(int? id) { PlaceViewModel placeVM; if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Place place = db.Places.Find(id); if (place == null) { return HttpNotFound(); } else { placeVM = new PlaceViewModel() { Address = place.Address, AlternativeName = place.AlternativeName, Description = place.Description, EatTime = place.EatTime, Id = place.Id, Latitude = place.Latitude, Longitude = place.Longitude, MonthRating = place.MonthRating, Name = place.Name, PriceType = place.PriceType, Rating = place.Rating }; } placeVM.EatTypeItems = GetEatTypeItems(); placeVM.PriceTypeItems = GetPriceTypeItems(); return View(placeVM); }