//Edit Participant public ActionResult Edit(int id) { var participant = new Participant(); if (id > 0) { participant = _participantManager.GetById(id); var model = Mapper.Map <ParticipantEntryVm>(participant); model.OrganizationList = GetOrganizationList(); model.CountryList = GetCountryList(); return(View(model)); } return(View()); }
// GET: Picture public ActionResult PictureDetail(int id) { ViewBag.picture = PictureManager.GetPictureById(id); if (Session["participantID"] != null) { ViewBag.Participant = ParticipantManager.GetById(Convert.ToInt32(Session["participantID"])); } string listSort = Request.QueryString["ListSort"];//check if user prompted a type of sorting if (listSort == null || listSort == "Recent") { ViewBag.comments = CommentsManage.SortByRecent(CommentsManage.GetCommentByPictureId(id)); } else { ViewBag.comments = CommentsManage.SortByPopular(CommentsManage.GetCommentByPictureId(id));//popular sorting, most votes } return(View()); }