protected virtual List <Select> GetSelectsFromProviders()
        {
            Dictionary <string, object> parameters = new Dictionary <string, object> {
                { "sysAdminUnitId", _sysAdminUnitId },
                { "userConnection", _userConnection }
            };
            NotificationUtilities notificationUtilities = new NotificationUtilities();
            List <string>         classNames            = notificationUtilities
                                                          .GetNotificationProviderClassNames(NotificationProviderType.Visa, _userConnection);
            List <Select> selectsFromProviders = new List <Select>();

            if (classNames.Count > 0)
            {
                object[] objectParams = { parameters };
                foreach (string className in classNames)
                {
                    var    classInstance  = notificationUtilities.GetClassInstance(className, objectParams);
                    Select providerSelect = ((INotificationProvider)classInstance).GetEntitiesSelect();
                    if (providerSelect != null)
                    {
                        selectsFromProviders.Add(providerSelect);
                    }
                }
            }
            return(selectsFromProviders);
        }
Ejemplo n.º 2
0
        private Select GetSelectFromProviders()
        {
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("sysAdminUnitId", _sysAdminUnitId);
            parameters.Add("userConnection", _userConnection);
            NotificationUtilities notificationUtilities = new NotificationUtilities();
            Select        mainSelect = null;
            List <string> classNames = notificationUtilities
                                       .GetNotificationProviderClassNames(NotificationProviderType.Visa, _userConnection);

            if (classNames.Count == 0)
            {
                return(null);
            }
            object[] objectParams = new object[] { parameters };
            foreach (string className in classNames)
            {
                var    classInstance  = notificationUtilities.GetClassInstance(className, objectParams);
                Select providerSelect = ((INotificationProvider)classInstance).GetEntitiesSelect();
                if (providerSelect != null)
                {
                    mainSelect = mainSelect == null
                                                ? providerSelect
                                                : mainSelect.UnionAll(providerSelect) as Select;
                }
            }
            return(mainSelect);
        }