public ActionResult Edit(UpdateUserProfileQuestionsModel aSettings) { if (!IsLoggedIn()) { return RedirectToLogin(); } try { UserInformationModel<User> myUser = GetUserInformatonModel(); theProfileQuestionsService.UpdateProfileQuestions(myUser, aSettings); TempData["Message"] += MessageHelper.SuccessMessage(EDIT_SUCCESS); } catch (Exception e) { LogError(e, EDIT_FAIL); TempData["Message"] += MessageHelper.ErrorMessage(EDIT_FAIL); } return RedirectToAction(EDIT_VIEW); }
public ActionResult List(UpdateUserProfileQuestionsModel aSettings) { if (!IsLoggedIn()) { return RedirectToLogin(); } UserInformationModel<User> myUser = GetUserInformatonModel(); LoggedInListModel<FriendConnectionModel> myLoggedIn = new LoggedInListModel<FriendConnectionModel>(myUser.Details, SiteSection.FriendSuggestion); IEnumerable<FriendConnectionModel> myConnectionModel = new List<FriendConnectionModel>(); try { myConnectionModel = theProfileQuestionsService.GetPossibleFriendConnections(myUser, 3); if (myConnectionModel.Count<FriendConnectionModel>() == 0) { TempData["Message"] += MessageHelper.NormalMessage(NO_SUGGESTIONS); } } catch (Exception e) { LogError(e, SUGGESTION_FAIL); TempData["Message"] += MessageHelper.ErrorMessage(SUGGESTION_FAIL); } myLoggedIn.Set(myConnectionModel); return View(LIST_VIEW, myLoggedIn); }