Esempio n. 1
0
        /// <summary>
        /// Get the first day of the week an allocation occurs on and return it.
        /// This is considered the day of the allocation as a majority of cases a unit allocation
        /// will only fall on a single day of the week.
        /// </summary>
        /// <returns>
        /// The day of the week which the allocation falls on
        /// </returns>
        public static string DayOfWeek(this Allocation obj)
        {
            if (obj == null)
            {
                return("Invalid Allocation");
            }

            return(obj.Schedule.DaysOfWeek.First().Day);
        }
Esempio n. 2
0
        /// <summary>
        /// Using XMLDocument process the timetable payload into usable
        /// Allocation objects
        /// </summary>
        /// <param name="data">The XML string</param>
        /// <returns></returns>
        private static void ProcessTimetableDump(string data)
        {
            XDocument doc = XDocument.Parse(data);

            _allocations = new List <Allocation>();
            var allocations = doc.Root.Elements("allocation");

            foreach (var a in allocations)
            {
                Allocation temp = new Allocation();
                temp.Import(a.ToString());
                _allocations.Add(temp);
            }
        }
Esempio n. 3
0
 public AllocationCard(Allocation allocation)
 {
     _vm      = new AllocationViewModel(allocation);
     _content = new CardAllocation(_vm);
 }
Esempio n. 4
0
 public AllocationViewModel(Allocation allocation)
 {
     _allocation = allocation;
 }