public ActionResult EventDetails(int id) { var model = new EventDetailsViewModel(); var current = new EventManager().GetEventById(id); CreateModel(model, current); model.City = current.City; model.Type = current.Type; model.PersonsCategory = current.PersonsCategory; model.Publisher = current.Publisher; model.Publisher.Photo = new PhotoManager().GetImage(current.Publisher.Photo, Server.MapPath("~"), true); model.Members = current.Members; model.MayAttend = current.MayAttend; model.NoAttend = current.NoAttend; model.Likes = current.Likes; model.DisLikes = current.Dislikes; return View(model); }
public ActionResult Edit(int id) { TempEventPhoto = null; var model = new EditViewModel(); var current = new EventManager().GetEventById(id); CreateModel(model, current); model.SelectedTypeId = current.Type.Id; model.SelectedPersonsCategoryId = current.PersonsCategory.Id; model.EventTypes = store.GetAllEventTypes().OrderBy(t => t.Type) .Select(eType => new SelectListItem { Value = eType.Id.ToString(), Text = eType.Type }); model.EventPersonCategories = store.GetAllPersonCategories().OrderBy(c => c.Category) .Select(eCat => new SelectListItem { Value = eCat.Id.ToString(), Text = eCat.Category }); return View(model); }