private void AddCategoryActionsToRow(UPMResultRow row)
        {
            var      categories      = this.Analysis.CategoryDictionary.Values;
            UPMGroup detailGroupCol1 = new UPMGroup(StringIdentifier.IdentifierWithStringId("det1"));

            foreach (AnalysisCategory category in categories)
            {
                UPMStringField field = new UPMStringField(null)
                {
                    LabelText   = category.Key,
                    StringValue = category.Label
                };

                detailGroupCol1.AddField(field);
            }

            row.AddDetailGroup(detailGroupCol1);
            UPMGroup detailGroupCol2 = new UPMGroup(StringIdentifier.IdentifierWithStringId("det2"));

            row.AddDetailGroup(detailGroupCol2);
            foreach (var analysisResultColumn in this.AnalysisSettings.ResultColumns)
            {
                UPMStringField field = new UPMStringField(null)
                {
                    LabelText   = analysisResultColumn.Key,
                    StringValue = analysisResultColumn.Label
                };
                detailGroupCol2.AddField(field);
            }
        }
        private void ProcessResultRows(
            AnalysisResult result,
            UPMGridPage searchPage,
            IReadOnlyList <object> xColumnArray,
            bool keyAsRawString,
            int columnCount,
            UPMResultSection section)
        {
            var i          = 0;
            var resultRows = CreateResultRows(result);
            var sumRow     = result.SumLine;

            foreach (AnalysisRow row in resultRows)
            {
                var identifier = StringIdentifier.IdentifierWithStringId($"row {i}");
                var listRow    = new UPMResultRow(identifier)
                {
                    Context = row
                };
                i++;
                var fieldArray = CreateFieldArray(row, xColumnArray, keyAsRawString, columnCount, i);

                listRow.Fields = fieldArray;
                if (searchPage.FixedSumRow && sumRow != null && i == resultRows.Count && resultRows.Count > 12)
                {
                    searchPage.SumResultRow = listRow;
                    searchPage.SumRowAtEnd  = false;
                }
                else
                {
                    section.AddResultRow(listRow);
                }

                if (row.HasDetails)
                {
                    var detailGroupCol1 = new UPMAnalysisResultRowGroup(StringIdentifier.IdentifierWithStringId("det1"))
                    {
                        Invalid = true,
                        Left    = true,
                        Row     = row
                    };
                    listRow.AddDetailGroup(detailGroupCol1);
                    var detailGroupCol2 = new UPMAnalysisResultRowGroup(StringIdentifier.IdentifierWithStringId("det2"))
                    {
                        Invalid = true,
                        Left    = false,
                        Row     = row
                    };
                    listRow.AddDetailGroup(detailGroupCol2);
                }

                this.AddDrilldownActionsFromRowToListRow(row, listRow);
                this.AddDetailsActionFromRowToListRow(row, listRow);
            }
        }
Exemple #3
0
        /// <summary>
        /// Adds the dropdown groups for result row.
        /// </summary>
        /// <param name="resultRow">The result row.</param>
        /// <param name="rowContext">The row context.</param>
        /// <param name="expand">The expand.</param>
        public override void AddDropdownGroupsForResultRow(UPMResultRow resultRow, UPCoreMappingResultRowContext rowContext, UPConfigExpand expand)
        {
            UPCoreMappingResultContext resultContext = rowContext.Context;

            if (resultContext.DropdownFields.Any())
            {
                int detailFieldCount = resultContext.DropdownFields.Count;
                if (detailFieldCount > 0)
                {
                    UPCRMResultRow row             = rowContext.Row;
                    string         recordId        = row.RecordIdentificationAtIndex(0);
                    var            detailGroupCol1 =
                        new UPMTimelineDetailsGroup(FieldIdentifier.IdentifierWithInfoAreaIdRecordIdFieldId(this.InfoAreaId, recordId, "DetailField_Left"))
                    {
                        Invalid       = true,
                        ResultContext = resultContext
                    };
                    resultRow.AddDetailGroup(detailGroupCol1);
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// The sender needs calendar item details.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="item">The item.</param>
        public void SenderNeedsCalendarItemDetails(/*UPCalendarViewController*/ object sender, ICalendarItem item)
        {
            if (item.CrmResultRow == null && item.ResultRow != null)
            {
                return;
            }

            UPMResultRow resultRow = new UPMResultRow(new RecordIdentifier(item.CrmResultRow.RootRecordIdentification));

            item.ResultRow      = resultRow;
            resultRow.Invalid   = true;
            resultRow.DataValid = true;

            UPMCalendarPopoverGroup popoverGroup = new UPMCalendarPopoverGroup(item.ResultRow.Identifier)
            {
                Invalid = true,
                Context = item
            };

            resultRow.AddDetailGroup(popoverGroup);
        }