コード例 #1
0
        /// <summary>
        /// Gets options for the various drop down lists in this addin.
        /// </summary>
        /// <param name="name">The label of the control for which the options should be returned.</param>
        /// <returns></returns>
        public Hashtable GetOptions(string name)
        {
            var options = new Hashtable();

            switch (name)
            {
            case "Field A":
            case "Field B":
                var order = new Order();
                foreach (var field in order.OrderFieldValues)
                {
                    options.Add(field.OrderField.SystemName, field.OrderField.Name);
                }
                break;

            case "Order State":
                options.Add("", "Leave unchanged");
                goto case "State Filter";

            case "State Filter":
                foreach (var state in OrderState.GetAllOrderStates())
                {
                    options.Add(state.Id, state.Name);
                }
                break;
            }
            return(options);
        }
コード例 #2
0
        public Hashtable GetOptions(string name)
        {
            var options = new Hashtable();

            if (name == "Notification sending frequency")
            {
                foreach (NotificationFrequency frequencyLevel in Enum.GetValues(typeof(NotificationFrequency)))
                {
                    options.Add(((int)frequencyLevel).ToString(), GetNotificationFrequencyText(frequencyLevel));
                }
            }
            else if (name == "Order state after export succeeded" || name == "Order state after export failed")
            {
                options.Add("", "Leave unchanged");
                foreach (var state in OrderState.GetAllOrderStates())
                {
                    options.Add(state.Id, state.Name);
                }
            }
            else if (name == "Shop")
            {
                options.Add("", "Any");
                var shops = Shop.GetShops();
                foreach (var shop in shops)
                {
                    options.Add(shop.Id, shop.Name);
                }
            }
            else if (name == "Cart communication type")
            {
                options.Add(Constants.CartCommunicationType.None, Constants.CartCommunicationType.None);
                options.Add(Constants.CartCommunicationType.Full, Constants.CartCommunicationType.Full);
                options.Add(Constants.CartCommunicationType.OnlyOnOrderComplete, Constants.CartCommunicationType.OnlyOnOrderComplete);
            }
            else if (name == "Synchronize on event")
            {
                options.Add(Constants.UserCommunicationType.None, Constants.UserCommunicationType.None);
                options.Add(Constants.UserCommunicationType.Full, Constants.UserCommunicationType.Full);
                options.Add(Constants.UserCommunicationType.OrderSubmit2NewUsers, Constants.UserCommunicationType.OrderSubmit2NewUsers);
                options.Add(Constants.UserCommunicationType.OrderSubmitAlways, Constants.UserCommunicationType.OrderSubmitAlways);
            }
            else if (name == "Type of user to sync")
            {
                options.Add(Constants.UserSyncType.None, Constants.UserSyncType.None);
                options.Add(Constants.UserSyncType.All, Constants.UserSyncType.All);
                options.Add(Constants.UserSyncType.LoginUsers, Constants.UserSyncType.LoginUsers);
                options.Add(Constants.UserSyncType.ImpersonateUsers, Constants.UserSyncType.ImpersonateUsers);
            }
            else
            {
                foreach (var cacheLevel in Enum.GetNames(typeof(CacheLevel)))
                {
                    options.Add(cacheLevel, cacheLevel);
                }
            }
            return(options);
        }
コード例 #3
0
        public Hashtable GetOptions(string name)
        {
            var options = new Hashtable();

            switch (name)
            {
            case "Shop":
                options.Add("", "Any");
                var shops = Shop.GetShops();
                foreach (var shop in shops)
                {
                    options.Add(shop.Id, shop.Name);
                }
                break;

            case "Order States":
                foreach (OrderState state in OrderState.GetAllOrderStates())
                {
                    options.Add(state.Id, state.Name);
                }
                break;
            }
            return(options);
        }