예제 #1
0
        /// <summary>
        /// Get all the To email addresses associated with the input flow and notification type.
        /// </summary>
        public IList <string> GetNotificationEmails(string flowId, NotificationType notificationType, out string flowName)
        {
            flowName = _flowDao.GetDataFlowNameById(flowId);

            List <string> emails = null;

            DoSimpleQueryWithRowCallbackDelegate(
                string.Format("{0} a;{1} n", Windsor.Node2008.WNOS.Data.AccountDao.TABLE_NAME, TABLE_NAME),
                "n.FlowId;a.IsActive;a.IsDeleted;n." + GetNotificationColumnNameFromType(notificationType) + ";a.Id = n.AccountID",
                new object[] { flowId, DbUtils.ToDbBool(true), DbUtils.ToDbBool(false), DbUtils.ToDbBool(true) },
                null, "a.NAASAccount",
                delegate(IDataReader reader)
            {
                if (emails == null)
                {
                    emails = new List <string>();
                }
                emails.Add(reader.GetString(0));
            });
            if (!CollectionUtils.IsNullOrEmpty(emails))
            {
                // Filter based upon permissions
                IList <string> usernames = _accountDao.GetAuthorizedUsernamesForFlow(flowName, FlowRoleType.Endpoint);
                emails = CollectionUtils.Intersect(emails, usernames);
            }
            return(emails);
        }
예제 #2
0
 public string GetDataFlowNameById(string flowId)
 {
     return(_flowDao.GetDataFlowNameById(flowId));
 }