예제 #1
0
        public void SaveNotifications(string userId, string modifiedByUserId,
                                      IList <SimpleFlowNotification> notifications)
        {
            // Convert flow names to ids
            List <KeyValuePair <string, NotificationType> > notificationArray = null;

            if (!CollectionUtils.IsNullOrEmpty(notifications))
            {
                notificationArray = new List <KeyValuePair <string, NotificationType> >(notifications.Count);
                foreach (SimpleFlowNotification notification in notifications)
                {
                    KeyValuePair <string, NotificationType> pair =
                        new KeyValuePair <string, NotificationType>(_flowDao.GetDataFlowIdByName(notification.FlowCode),
                                                                    notification.NotificationType);
                    notificationArray.Add(pair);
                }
            }
            // Do the work
            TransactionTemplate.Execute(delegate
            {
                DeleteAllNotificationsForUser(userId);
                SaveNotificationsForUser(userId, modifiedByUserId, notificationArray);
                return(null);
            });
        }
예제 #2
0
 public string GetDataFlowIdByName(string flowName)
 {
     return(_flowDao.GetDataFlowIdByName(flowName));
 }