private ArrayList coordinatorOrderEntry_OnGetOptions(string theModel, string theStyle)
        {
            ArrayList options = new ArrayList();

            ArrayList category1 = new ArrayList();

            PricedItem[] category1Items = new PricedItem[] {
                new PricedItem("Category 1", 0),
                new PricedItem("Option 1", 111),
                new PricedItem("Option 2", 222),
                new PricedItem("Option 3", 333)
            };
            options.Add(category1Items);

            ArrayList category2 = new ArrayList();

            PricedItem[] category2Items = new PricedItem[] {
                new PricedItem("Category 2", 0),
                new PricedItem("Option 11", 777),
                new PricedItem("Option 22", 888),
                new PricedItem("Option 33", 999)
            };
            options.Add(category2Items);

            return(options);
        }
        private void buttonSubmitOrder_Click(object sender, System.EventArgs e)
        {
            PricedItem[] requestedOptions;
            if (options.Count > 0)
            {
                // convert an array of PriceItem arrays into a PricedItem array
                ArrayList items = new ArrayList();
                foreach (PricedItem[] pricedItems in options)
                {
                    foreach (PricedItem pricedItem in pricedItems)
                    {
                        items.Add(pricedItem);
                    }
                }
                requestedOptions = items.ToArray(typeof(PricedItem)) as PricedItem[];
            }
            else
            {
                requestedOptions = new PricedItem[] { new PricedItem("Option1", 11), new PricedItem("Option2", 22) }
            };

            Color color = Color.FromName(comboBoxColors.Text);

            orderSystem.SubmitOrder(comboBoxModels.Text, comboBoxStyles.Text, color, requestedOptions);
            DisplayQueuedMessages();
        }
        // each entry in the returned array is a PricedItem[]
        public ArrayList GetOptions(string theModel, string theStyle)
        {
            // the following data would probably be fetched from a database
            ArrayList options = new ArrayList();

            ArrayList category1 = new ArrayList();

            PricedItem[] category1Items = new PricedItem[] {
                new PricedItem("Category 1", 0),
                new PricedItem("Option 1", 111),
                new PricedItem("Option 2", 222),
                new PricedItem("Option 3", 333)
            };
            options.Add(category1Items);

            ArrayList category2 = new ArrayList();

            PricedItem[] category2Items = new PricedItem[] {
                new PricedItem("Category 2", 0),
                new PricedItem("Option 11", 777),
                new PricedItem("Option 22", 888),
                new PricedItem("Option 33", 999)
            };
            options.Add(category2Items);

            return(options);
        }
Beispiel #4
0
 public void AddBreakdownItem(ProductScopeType scope, PricedItem pricedItem)
 {
     if (this.Breakdown.Keys.Contains(scope))
     {
         this.Breakdown.First(x => x.Key == scope).Value.Add(pricedItem);
     }
     else
     {
         this.Breakdown.Add(scope, new List <PricedItem> {
             pricedItem
         });
     }
 }
Beispiel #5
0
        // first item is category, remainders are options
        void PopulateOption(PricedItem[] theOptions)
        {
            if (theOptions.Length == 0)
            {
                return;
            }

            PricedItem category     = theOptions[0];
            TreeNode   categoryNode = new TreeNode(category.Name);

            categoryNode.Tag = category;
            treeViewOptions.Nodes.Add(categoryNode);

            for (int i = 1; i < theOptions.Length; i++)
            {
                PricedItem option = theOptions[i];
                TreeNode   node   = new TreeNode(option.Name);
                node.Tag = option;
                categoryNode.Nodes.Add(node);
            }
        }
Beispiel #6
0
 /// <summary>
 ///     Removes a single item from the list
 /// </summary>
 /// <param name="item"></param>
 public void RemoveItem(PricedItem item)
 {
     Items.Remove(item);
 }
Beispiel #7
0
 /// <summary>
 ///     Adds a single item to the list
 /// </summary>
 /// <param name="item"></param>
 /// <remarks>
 ///     Does not check for duplicates. Any duplicate added cannot be retreived in any way except for clearing the list or
 ///     clearing all duplicates.
 /// </remarks>
 public void AddItem(PricedItem item)
 {
     Items.Add(item);
 }
 public void SetUp()
 {
     pricedItem = new PricedItem();
 }