Пример #1
0
        public override string ToString()
        {
            string ans = Environment.NewLine +
                         "Relationship Type: " + RelationShipType + Environment.NewLine +
                         "Value Type: " + ValueType + Environment.NewLine +
                         "Concept --> " + ConceptNameCodeSequence.ToString();

            if (ConceptCodeSequence != null)
            {
                ans = ans + ConceptCodeSequence.ToString();
            }
            if (ValueType == Value.TEXT)
            {
                ans = ans + Environment.NewLine + "Value: " + TextValue;
            }
            if (DateTimeValue.HasValue)
            {
                ans = ans + Environment.NewLine + "Value: " + DateTimeValue.Value.ToString();
            }
            if (ValueType == Value.NUM)
            {
                ans = ans + Environment.NewLine + MeasuredValueSequence.ToString();
            }
            if (ContentItems.Any())
            {
                foreach (var c in ContentItems)
                {
                    ans = ans + Environment.NewLine + "Content Item-->" + c.ToString();
                }
            }
            return(ans);
        }
Пример #2
0
        public async Task GenerateScreenerMenuList()
        {
            var localList = new List <MenuContentModel>();
            await Task.Delay(0);

            if (TotalCategories != null && TotalCategories.Any())
            {
                var sequence = 0;
                foreach (var item in TotalCategories)
                {
                    sequence += 1;
                    var MenuContentModel = new MenuContentModel();
                    if (item.contentCategoryLevelId == 4)
                    {
                        MenuContentModel.ShowStatus       = true;
                        MenuContentModel.ContentLevelID   = item.contentCategoryLevelId;
                        MenuContentModel.ContentCatgoryId = item.contentCategoryId;
                        MenuContentModel.Code             = item.name;
                        MenuContentModel.Text             = item.name;
                        MenuContentModel.ShowImage        = true;
                        MenuContentModel.SequenceNumber   = sequence;
                        //MenuContentModel.SelectedCommandAction = new Action<MenuContentModel>(AddorRemoveItems);
                        localList.Add(MenuContentModel);
                    }
                    else if (item.contentCategoryLevelId == 5)
                    {
                        if (ContentCategoryItems != null && ContentCategoryItems.Any())
                        {
                            var filteredContentCategoryItems = ContentCategoryItems.Where(p => p.contentCategoryId == item.contentCategoryId).ToArray();
                            if (filteredContentCategoryItems.Length > 0)
                            {
                                if (ContentItems != null && ContentItems.Any())
                                {
                                    var filteredContentItems = ContentItems.Where(p => filteredContentCategoryItems.Select(q => q.contentItemId).Contains(p.contentItemId)).OrderBy(p => p.sequenceNo).ToArray();
                                    if (filteredContentItems.Length > 0)
                                    {
                                        var startingpoint = new MenuContentModel();
                                        startingpoint.Code             = filteredContentItems.FirstOrDefault().itemCode;
                                        startingpoint.ContentItemId    = filteredContentItems.FirstOrDefault().contentItemId;
                                        startingpoint.Text             = "Starting Point for developmental ages " + item.name;
                                        startingpoint.ContentCatgoryId = item.contentCategoryId;
                                        startingpoint.ParentID         = item.parentContentCategoryId;
                                        startingpoint.ContentLevelID   = item.contentCategoryLevelId;
                                        startingpoint.IsStartingPoint  = true;
                                        startingpoint.SequenceNumber   = sequence;
                                        //startingpoint.SelectedCommandAction = new Action<MenuContentModel>(AddorRemoveItems);
                                        localList.Add(startingpoint);
                                        foreach (var contentItem in filteredContentItems)
                                        {
                                            sequence += 1;
                                            var menuItem = new MenuContentModel();
                                            menuItem.ContentLevelID   = item.contentCategoryLevelId;
                                            menuItem.ContentCatgoryId = item.contentCategoryId;
                                            menuItem.ParentID         = item.parentContentCategoryId;
                                            menuItem.Code             = contentItem.itemCode;
                                            menuItem.Text             = !string.IsNullOrEmpty(contentItem.alternateItemText) ? contentItem.alternateItemText : contentItem.itemText;
                                            menuItem.ContentItemId    = contentItem.contentItemId;
                                            menuItem.SequenceNumber   = sequence;
                                            menuItem.HtmlFilePath     = contentItem.HtmlFilePath;
                                            //menuItem.SelectedCommandAction = new Action<MenuContentModel>(AddorRemoveItems);
                                            localList.Add(menuItem);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            ScreenerMenuList = new List <MenuContentModel>(localList);
        }