/// <summary> /// Loads the element for calendar group field control. /// </summary> /// <param name="_origDetailGroup">The original detail group.</param> /// <param name="_sourceFieldControl">The source field control.</param> public void LoadElementForCalendarGroupFieldControl(UPMCalendarPopoverGroup _origDetailGroup, FieldControl _sourceFieldControl) { this.sourceFieldControl = _sourceFieldControl; FieldControlTab tabConfig = _sourceFieldControl.TabAtIndex(0); this.origDetailGroup = _origDetailGroup; this.origDetailGroup.LabelText = tabConfig.Label; if (this.sourceFieldControl != null) { this.LoadSourceRecordRecordId(this.sourceFieldControl, ((RecordIdentifier)this.origDetailGroup.Identifier).RecordIdentification); } }
/// <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); }
/// <summary> /// Updates the element for calendar group. /// </summary> /// <param name="origDetailGroup">The original detail group.</param> /// <returns></returns> public override UPMCalendarPopoverGroup UpdateElementForCalendarGroup(UPMCalendarPopoverGroup origDetailGroup) { if (!(origDetailGroup.Context is ResultRowCalendarItem)) { return(base.UpdateElementForCalendarGroup(origDetailGroup)); } if (origDetailGroup.Invalid) { ResultRowCalendarItem calendarItem = (ResultRowCalendarItem)origDetailGroup.Context; UPCoreMappingResultContext resultContext = calendarItem.ResultContext; TimelineSearch timelineSearch = (TimelineSearch)resultContext.Context; string sourceCopyFieldGroupName = timelineSearch.FieldGroupName; IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore; FieldControl sourceFieldControl = configStore.FieldControlByNameFromGroup("Details", sourceCopyFieldGroupName) ?? configStore.FieldControlByNameFromGroup("MiniDetails", sourceCopyFieldGroupName); this.Loader = new UPCalendarPopoverLoader(this); this.Loader.LoadElementForCalendarGroupFieldControl(origDetailGroup, sourceFieldControl); } return(origDetailGroup); }