Ejemplo n.º 1
0
        public void EditPlace(EditPlaceViewModel model)
        {
            using (var db = new DBEntitiesProxy())
            {
                var place = db.Place.Where(x => x.PlaceId == model.PlaceId).Single();

                place.Name = model.Name;
                place.Content = model.Content;
                place.Photo_URI = model.Photo_URI;
                place.CountryId = model.CountryId;
                place.ContentPL = model.ContentPL;
                place.ContentPT = model.ContentPT;

                db.Entry(place).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        public ActionResult Edit(int id, EditPlaceViewModel model)
        {
            try
            {
                model.PlaceId = id;
                placeModel.EditPlace(model);

                return RedirectToAction("Details",new { @Id = id});
            }
            catch
            {
                return RedirectToAction("Details", new { @Id = id });
            }
        }