Beispiel #1
0
        public IEnumerable <LabourAvailabilityItem> GetAvailabilityItems(LabourAvailabilityList list)
        {
            List <LabourAvailabilityItem> items = new List <LabourAvailabilityItem>();

            for (int i = 2; i < Supply.Elements().Count(); i++)
            {
                XElement group = Supply.Elements().ElementAt(i);

                // Skip this item if it has zero-value
                string value = group.Elements().First().Value;
                if (value == "0")
                {
                    continue;
                }

                string name = group.Name.LocalName;

                LabourAvailabilityItem item = new LabourAvailabilityItem(list)
                {
                    Name  = name,
                    Value = Convert.ToDouble(value)
                };

                item.Add(new LabourFilter(item)
                {
                    Value = name
                });

                items.Add(item);
            }

            return(items.AsEnumerable());
        }