Example #1
0
        private void CreateFixedSlides(TaskGroupData taskData, int[] dynamicSlideIndices, int lateSlideIndex,int upComingSlideIndex, int chartSlideIndex, int SPDLSTartToBLSlideIndex, int SPDLFinishToBLSlideIndex,int BEISlideIndex, SlidePart lateSlidePart,SlidePart upComingSlidePart, SlidePart chartSlidePart, SlidePart SPDLSTartToBLSlidePart, SlidePart SPDLFinishToBLSlidePart,SlidePart BEISlidePart, PresentationPart oPPart)
        {
            Repository.Utility.WriteLog("CreateFixedSlides started", System.Diagnostics.EventLogEntryType.Information);
            foreach (int slideIndex in dynamicSlideIndices)
            {
                if (lateSlideIndex == slideIndex)
                {
                    if (taskData.LateTaskGroups != null && taskData.LateTaskGroups.Count > 0)
                    {
                        if (lateSlidePart != null)
                        {
                            foreach (TaskItemGroup group in taskData.LateTaskGroups)
                            {
                                var newLateSlidePart = lateSlidePart.CloneSlide(SlideType.Late);
                                oPPart.AppendSlide(newLateSlidePart);
                            }
                        }
                    }
                    else
                    {
                        if (lateSlidePart != null)
                        {
                            var newLateSlidePart = lateSlidePart.CloneSlide(SlideType.Late);
                            oPPart.AppendSlide(newLateSlidePart);
                        }
                    }
                }
                if (upComingSlideIndex == slideIndex)
                {
                    if (taskData.UpComingTaskGroups != null && taskData.UpComingTaskGroups.Count > 0)
                    {
                        if (upComingSlidePart != null)
                        {
                            foreach (TaskItemGroup group in taskData.UpComingTaskGroups)
                            {
                                var newupComingSlidePart = upComingSlidePart.CloneSlide(SlideType.Late);
                                oPPart.AppendSlide(newupComingSlidePart);
                            }
                        }
                    }
                    else
                    {
                        if (upComingSlidePart != null)
                        {
                            var newupComingSlidePart = upComingSlidePart.CloneSlide(SlideType.Late);
                            oPPart.AppendSlide(newupComingSlidePart);
                        }
                    }
                }

                if (SPDLSTartToBLSlideIndex == slideIndex)
                {
                        if (SPDLSTartToBLSlidePart != null)
                        {
                                var newSPDLStartToBLSlidePart = SPDLSTartToBLSlidePart.CloneSlide(SlideType.Chart);
                                oPPart.AppendSlide(newSPDLStartToBLSlidePart);
                        }
                }

                if (SPDLFinishToBLSlideIndex == slideIndex)
                {
                    if (SPDLFinishToBLSlidePart != null)
                    {
                        var newSPDLFinishToBLSlidePart = SPDLFinishToBLSlidePart.CloneSlide(SlideType.Chart);
                        oPPart.AppendSlide(newSPDLFinishToBLSlidePart);
                    }
                }

                if (BEISlideIndex == slideIndex)
                {
                    if (BEISlidePart != null)
                    {
                        var newBEISlidePart = BEISlidePart.CloneSlide(SlideType.Chart);
                        oPPart.AppendSlide(newBEISlidePart);
                    }
                }

                if (chartSlideIndex == slideIndex)
                {
                    if (taskData.ChartsData != null && taskData.ChartsData.Count > 0)
                    {
                        if (chartSlidePart != null && taskData.ChartsData.Keys.Any(t => t.StartsWith("Show On") == true))
                        {
                            foreach (string chartType in taskData.ChartsData.Keys)
                            {
                                if (chartType.StartsWith("Show On"))
                                {
                                    var newChartSlidePart = chartSlidePart.CloneSlide(SlideType.Chart);
                                    oPPart.AppendSlide(newChartSlidePart);
                                }
                            }
                        }
                        else
                        {
                            var newChartSlidePart = chartSlidePart.CloneSlide(SlideType.Chart);
                            oPPart.AppendSlide(newChartSlidePart);
                        }
                    }

                }
            }
            Repository.Utility.WriteLog("CreateFixedSlides completed successfully", System.Diagnostics.EventLogEntryType.Information);
        }
Example #2
0
        private void CreateDynamicSlides(IList<TaskItemGroup> data, int[] dynamicSlideIndices, int gridSlideIndex, int completedSlideIndex, SlidePart gridSlidePart, SlidePart completedSlidePart, PresentationPart oPPart)
        {
            Repository.Utility.WriteLog("CreateDynamicSlides started", System.Diagnostics.EventLogEntryType.Information);
            if (data.Count < 1)
            {
                foreach (int slideIndex in dynamicSlideIndices)
                {
                    if (slideIndex == gridSlideIndex)
                    {
                        var newGridSlidePart = gridSlidePart.CloneSlide(SlideType.Grid);
                        oPPart.AppendSlide(newGridSlidePart);
                    }
                    if (slideIndex == completedSlideIndex)
                    {
                        var newCompletedSlidePart = completedSlidePart.CloneSlide(SlideType.Completed);
                        oPPart.AppendSlide(newCompletedSlidePart);
                    }
                }
            }
            for (int i = 0; i < data.Count; i++)
            {
                foreach (int slideIndex in dynamicSlideIndices)
                {
                    if (slideIndex == gridSlideIndex)
                    {
                        if (gridSlidePart != null)
                        {
                            var newGridSlidePart = gridSlidePart.CloneSlide(SlideType.Grid);
                            oPPart.AppendSlide(newGridSlidePart);
                        }
                    }
                    if (slideIndex == completedSlideIndex)
                    {
                        if (data[i].CompletedTaskgroups != null)
                        {
                            if (completedSlidePart != null)
                            {
                                if (data[i].CompletedTaskgroups.Count == 0)
                                {
                                    var newCompletedSlidePart = completedSlidePart.CloneSlide(SlideType.Completed);
                                    oPPart.AppendSlide(newCompletedSlidePart);
                                }
                                else
                                {
                                    foreach (TaskItemGroup group in data[i].CompletedTaskgroups)
                                    {
                                        var newCompletedSlidePart = completedSlidePart.CloneSlide(SlideType.Completed);
                                        oPPart.AppendSlide(newCompletedSlidePart);
                                    }
                                }
                            }
                        }
                        else
                        {
                            var newCompletedSlidePart = completedSlidePart.CloneSlide(SlideType.Completed);
                            oPPart.AppendSlide(newCompletedSlidePart);
                        }
                    }
                }

            }
            Repository.Utility.WriteLog("CreateDynamicSlides completed successfully", System.Diagnostics.EventLogEntryType.Information);
        }