public bool PushSiteToAllUserNotification(SiteToUserNotificationModel notificationModel) { // registered users //var users = _userRepository.GetAllCustomers(); var users = _customerService.GetCustomers(); foreach (var user in users) { //if (inRole != null && inRole == ) //{ //} var notification = new Z_Harag_Notification { NotificationType = (int)NotificationType.General, OwnerId = user.Id, NotificationTime = DateTime.Now, NotificationContent = notificationModel.Content, CustomerId = notificationModel.AdminId, IsRead = false }; this.AddGeneralNotification(notification); } return(true); }
public bool PushSiteToUserNotification(SiteToUserNotificationModel notificationModel) { var notification = new Z_Harag_Notification { NotificationType = (int)NotificationType.General, OwnerId = notificationModel.UserId, NotificationTime = DateTime.Now, CustomerId = notificationModel.AdminId, NotificationContent = notificationModel.Content, IsRead = false }; try { this.AddGeneralNotification(notification); return(true); } catch (Exception e) { return(false); } }