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); }); }
public string GetDataFlowIdByName(string flowName) { return(_flowDao.GetDataFlowIdByName(flowName)); }