public ActionResult NotificationSettings(UserEmailNotificationSettingsVM model) { try { foreach (var setting in model.EmailSubscriptions) { var userNotification = new UserNotificationSubscription { TeamID = TeamID, UserID = UserID }; userNotification.Subscribed = setting.IsSelected; userNotification.ModifiedDate = DateTime.UtcNow; userNotification.NotificationTypeID = setting.NotificationTypeID; repo.SaveUserNotificationSubscription(userNotification); } var msg = new AlertMessageStore(); msg.AddMessage("success", "Notification Settings updated successfully"); TempData["AlertMessages"] = msg; return(RedirectToAction("NotificationSettings")); } catch (Exception ex) { log.Error(ex); return(View("Error")); } }
public ActionResult NotificationSettings(UserEmailNotificationSettingsVM model) { try { foreach (var setting in model.EmailSubscriptions) { var userNotification = new UserNotificationSubscription { TeamID = TeamID, UserID = UserID }; userNotification.Subscribed = setting.IsSelected; userNotification.ModifiedDate = DateTime.UtcNow; userNotification.NotificationTypeID = setting.NotificationTypeID; repo.SaveUserNotificationSubscription(userNotification); } var msg = new AlertMessageStore(); msg.AddMessage("success", "Notification Settings updated successfully"); TempData["AlertMessages"] = msg; return RedirectToAction("NotificationSettings"); } catch (Exception ex) { log.Error(ex); return View("Error"); } }