public ActionResult EditSocialSettings(SocialSettingsViewModel model) { if (ModelState.IsValid) { } return(PartialView("_SocialPartial", model)); }
public ActionResult Index() { var settings = SettingsService.GetSettings(); var viewModel = new SocialSettingsViewModel { EnableSocialLogins = settings.EnableSocialLogins == true, FacebookAppId = ForumConfiguration.Instance.FacebookAppId, FacebookAppSecret = ForumConfiguration.Instance.FacebookAppSecret, GooglePlusAppId = ForumConfiguration.Instance.GooglePlusAppId, GooglePlusAppSecret = ForumConfiguration.Instance.GooglePlusAppSecret, MicrosoftAppId = ForumConfiguration.Instance.MicrosoftAppId, MicrosoftAppSecret = ForumConfiguration.Instance.MicrosoftAppSecret }; return(View(viewModel)); }
public ActionResult Index(int?profileView) { var vm = new UserProfileViewModel(); var quizzes = _quizService.GetAll().Where(x => x.CreatedBy == User.Identity.Name); vm.Quizzes = quizzes.ToQuizViewModels(); vm.ProfileView = profileView.HasValue ? profileView.Value : 0; var socialSettings = new SocialSettingsViewModel(); vm.SocialSettings = socialSettings; return(View("Index", vm)); }
public ActionResult Index() { using (UnitOfWorkManager.NewUnitOfWork()) { var settings = SettingsService.GetSettings(); var viewModel = new SocialSettingsViewModel { EnableSocialLogins = settings.EnableSocialLogins == true, FacebookAppId = SiteConstants.FacebookAppId, FacebookAppSecret = SiteConstants.FacebookAppSecret, GooglePlusAppId = SiteConstants.GooglePlusAppId, GooglePlusAppSecret = SiteConstants.GooglePlusAppSecret, MicrosoftAppId = SiteConstants.MicrosoftAppId, MicrosoftAppSecret = SiteConstants.MicrosoftAppSecret }; return(View(viewModel)); } }
public ActionResult Index(SocialSettingsViewModel viewModel) { using (var unitOfWork = UnitOfWorkManager.NewUnitOfWork()) { var settings = SettingsService.GetSettings(false); settings.EnableSocialLogins = viewModel.EnableSocialLogins; // Repopulate the view model viewModel.FacebookAppId = SiteConstants.FacebookAppId; viewModel.FacebookAppSecret = SiteConstants.FacebookAppSecret; viewModel.GooglePlusAppId = SiteConstants.GooglePlusAppId; viewModel.GooglePlusAppSecret = SiteConstants.GooglePlusAppSecret; viewModel.MicrosoftAppId = SiteConstants.MicrosoftAppId; viewModel.MicrosoftAppSecret = SiteConstants.MicrosoftAppSecret; try { unitOfWork.Commit(); // Show a message ShowMessage(new GenericMessageViewModel { Message = "Updated", MessageType = GenericMessages.success }); } catch (Exception ex) { LoggingService.Error(ex); unitOfWork.Rollback(); // Show a message ShowMessage(new GenericMessageViewModel { Message = "Error, please check log", MessageType = GenericMessages.danger }); } return(View(viewModel)); } }
public ActionResult Index(SocialSettingsViewModel viewModel) { var settings = SettingsService.GetSettings(false); settings.EnableSocialLogins = viewModel.EnableSocialLogins; // Repopulate the view model viewModel.FacebookAppId = ForumConfiguration.Instance.FacebookAppId; viewModel.FacebookAppSecret = ForumConfiguration.Instance.FacebookAppSecret; viewModel.GooglePlusAppId = ForumConfiguration.Instance.GooglePlusAppId; viewModel.GooglePlusAppSecret = ForumConfiguration.Instance.GooglePlusAppSecret; viewModel.MicrosoftAppId = ForumConfiguration.Instance.MicrosoftAppId; viewModel.MicrosoftAppSecret = ForumConfiguration.Instance.MicrosoftAppSecret; try { Context.SaveChanges(); _cacheService.ClearStartsWith(CacheKeys.Settings.Main); // Show a message ShowMessage(new GenericMessageViewModel { Message = "Updated", MessageType = GenericMessages.success }); } catch (Exception ex) { LoggingService.Error(ex); Context.RollBack(); // Show a message ShowMessage(new GenericMessageViewModel { Message = "Error, please check log", MessageType = GenericMessages.danger }); } return(View(viewModel)); }
public ActionResult Index(string id, int?profileView) { var vm = new UserProfileViewModel(); vm.UserId = id; vm.ProfileView = profileView.HasValue ? profileView.Value : 0; var quizzes = _quizService.GetAll().Where(x => x.CreatedBy == id); vm.Quizzes = _modelConverter.ToUserQuizzesViewModel(quizzes, id); var socialSettings = new SocialSettingsViewModel(); vm.SocialSettings = socialSettings; var userActivities = _userActivityService.GetAll(id); vm.UserActivities = _modelConverter.ToUserActivitiesViewModel(userActivities); vm.UserActivities.UserId = id; return(View("Index", vm)); }