예제 #1
0
		public ActionResult Notifications(NotificationSettingsViewModel model)
		{
			UserProfile profile = CurrentUserProfileOrThrow;

			profile.AllowUsersToSendSiteMessages = model.AllowUsersToSendSiteMessages;
			profile.NotifyAllWhenLoggedOn = model.NotifyAllWhenLoggedOn;
			profile.NotifyOfSiteUpdatesToEmail = model.NotifyOfSiteUpdatesToEmail;
			profile.SendSiteMessagesToEmail = model.SendSiteMessagesToEmail;
			profile.SendSiteMessagesToSms = model.SendSiteMessagesToSms;
			profile.SubscribeToNewsletterEmail = model.SubscribeToNewsletterEmail;

			GStoreDb.UserProfiles.Update(profile);
			GStoreDb.SaveChanges();

			GStoreDb.LogUserActionEvent(HttpContext, RouteData, this, UserActionCategoryEnum.Profile, UserActionActionEnum.Profile_UpdateNotifications, "", true);

			return RedirectToAction("Index");
		}
예제 #2
0
		//
		// GET: /Profile/Settings
		public ActionResult Notifications()
		{
			UserProfile profile = CurrentUserProfileOrThrow;

			NotificationSettingsViewModel viewModel = new NotificationSettingsViewModel()
			{

				AllowUsersToSendSiteMessages = profile.AllowUsersToSendSiteMessages,
				Email = profile.Email,
				NotifyAllWhenLoggedOn = profile.NotifyAllWhenLoggedOn,
				NotifyOfSiteUpdatesToEmail = profile.NotifyOfSiteUpdatesToEmail,
				SendSiteMessagesToEmail = profile.SendSiteMessagesToEmail,
				SendSiteMessagesToSms = profile.SendSiteMessagesToSms,
				SubscribeToNewsletterEmail = profile.SubscribeToNewsletterEmail,
				UserProfile = profile
			};

			return View(viewModel);
		}