Пример #1
0
        public static TrainItem CreateTrainItem()
        {
            TrainItem newItem = ScheduleStore.Instance.CreateStoreItem <TrainItem>(ItemTypeID.Train);

            newItem.Title     = "New Train";
            newItem.StartDate = DateTime.Today;
            newItem.EndDate   = DateTime.Today;
            return(newItem);
        }
Пример #2
0
        //------------------------------------------------------------------------------------
        /// <summary>
        /// Returns a string that represents the number of off days specified by the given
        /// collection of OffTimeItems, for the given train.
        /// </summary>
        //------------------------------------------------------------------------------------
        public static string TrainOffDays(TrainItem trainItem, AsyncObservableCollection <OffTimeItem> offTimeItems)
        {
            if (trainItem != null && offTimeItems != null)
            {
                DateTime startDate           = trainItem.StartDate;
                DateTime endDate             = trainItem.EndDate;
                int      netDaysOffThisTrain = WorkUtils.GetNetOffDays(startDate, endDate, offTimeItems);
                return(netDaysOffThisTrain.ToString() + " Days");
            }

            return("0 Days");
        }
Пример #3
0
        public static List <BacklogItem> GetBacklogItemsByPillarAndTrain(PillarItem pillar, TrainItem train)
        {
            List <BacklogItem> backlogItems = new List <BacklogItem>();

            foreach (BacklogItem backlogItem in BacklogItem.Items)
            {
                if (backlogItem.ParentPillarItem == pillar && backlogItem.ParentTrainItem == train)
                {
                    backlogItems.Add(backlogItem);
                }
            }

            return(backlogItems);
        }