/// <summary>
        /// Switches to organizer for link participant.
        /// </summary>
        /// <param name="sender">The sender.</param>
        public void SwitchToOrganizerForLinkParticipant(object sender)
        {
            UPMListRow           listRow         = (UPMListRow)sender;
            IIdentifier          identifier      = listRow.Identifier;
            UPCRMLinkParticipant linkParticipant = (UPCRMLinkParticipant)this.recordParticipants.ParticipantWithKey(identifier.IdentifierAsString);

            if (linkParticipant != null)
            {
                ViewReference viewReference = this.linkParticipantsViewReference.ViewReferenceWith(linkParticipant.LinkRecordIdentification);
                if (viewReference != null)
                {
                    this.Delegate.PerformOrganizerAction(this, viewReference, listRow.OnlineData);
                }
            }
        }
 /// <summary>
 /// Finds the quick actions for row.
 /// </summary>
 /// <param name="resultRow">The result row.</param>
 public override void FindQuickActionsForRow(UPMListRow resultRow)
 {
     this.ParentController.FindQuickActionsForRow(resultRow);
 }
 /// <summary>
 /// Finds the quick actions for row.
 /// </summary>
 /// <param name="resultRow">The result row.</param>
 public virtual void FindQuickActionsForRow(UPMListRow resultRow)
 {
     this.alternateGroupModelController?.FindQuickActionsForRow(resultRow);
 }
        private UPMGroup BuildGroup(UPMGroup group)
        {
            Dictionary <string, string> infoAreaImageFileNames = new Dictionary <string, string>();
            IConfigurationUnitStore     configStore            = ConfigurationUnitStore.DefaultStore;
            UPConfigExpand repExpand = configStore.ExpandByName("ID");

            this.linkParticipantsViewReference = null;

            if (!string.IsNullOrEmpty(this.linkParticipantsName))
            {
                SearchAndList searchAndList = configStore.SearchAndListByName(this.linkParticipantsName);
                Menu          menu          = searchAndList != null?configStore.MenuByName(searchAndList.DefaultAction) : null;

                this.linkParticipantsViewReference = menu?.ViewReference;
            }

            if (this.acceptanceCatalogAttributes == null && this.recordParticipants.AcceptanceField != null)
            {
                this.acceptanceCatalogAttributes = configStore.CatalogAttributesForInfoAreaIdFieldId(this.recordParticipants.AcceptanceField.InfoAreaId, this.recordParticipants.AcceptanceField.FieldId);
            }

            foreach (UPCRMParticipant participant in this.recordParticipants.Participants)
            {
                bool           isRepParticipant = participant is UPCRMRepParticipant;
                IIdentifier    identifier       = StringIdentifier.IdentifierWithStringId(participant.Key);
                UPMListRow     listRow          = new UPMListRow(identifier);
                UPMStringField nameField        = new UPMStringField(StringIdentifier.IdentifierWithStringId("name"));
                nameField.StringValue = participant.Name;
                listRow.AddField(nameField);
                UPMStringField acceptanceField = new UPMStringField(StringIdentifier.IdentifierWithStringId("acceptance"));
                if (!isRepParticipant || this.recordParticipants.HasRepAcceptance)
                {
                    acceptanceField.StringValue = participant.AcceptanceDisplayText;
                    UPConfigCatalogValueAttributes configCatalogValueAttributes = this.acceptanceCatalogAttributes?.ValuesByCode[Convert.ToInt32(participant.AcceptanceText)];
                    string colorString = configCatalogValueAttributes?.ColorKey;
                    if (!string.IsNullOrEmpty(colorString))
                    {
                        listRow.RowColor = AureaColor.ColorWithString(colorString);
                    }
                }
                else
                {
                    acceptanceField.StringValue = string.Empty;
                }

                listRow.AddField(acceptanceField);
                UPMStringField requirementField = new UPMStringField(StringIdentifier.IdentifierWithStringId("requirement"));
                requirementField.StringValue = participant.RequirementDisplayText;
                listRow.AddField(requirementField);
                if (isRepParticipant)
                {
                    // listRow.Icon = UIImage.UpImageWithFileName(repExpand.ImageName);     // CRM-5007
                    listRow.RowAction = null;
                }
                else
                {
                    UPCRMLinkParticipant linkParticipant = (UPCRMLinkParticipant)participant;
                    string _infoAreaId = linkParticipant.LinkRecordIdentification.InfoAreaId();
                    string imageName   = infoAreaImageFileNames.ValueOrDefault(_infoAreaId);
                    if (imageName == null)
                    {
                        UPConfigExpand expand = configStore.ExpandByName(_infoAreaId);
                        imageName = expand.ImageName ?? string.Empty;

                        infoAreaImageFileNames.SetObjectForKey(imageName, _infoAreaId);
                    }

                    // listRow.Icon = UIImage.UpImageWithFileName(imageName);       // CRM-5007
                    listRow.OnlineData = !UPCRMDataStore.DefaultStore.RecordExistsOffline(linkParticipant.LinkRecordIdentification);

                    if (this.linkParticipantsViewReference != null)
                    {
                        UPMAction switchToOrganizerAction = new UPMAction(null);
                        switchToOrganizerAction.IconName = "arrow.png";
                        switchToOrganizerAction.SetTargetAction(this, this.SwitchToOrganizerForLinkParticipant);
                        listRow.RowAction = switchToOrganizerAction;
                    }
                }

                group.AddChild(listRow);
            }

            return(group);
        }
Example #5
0
 /// <summary>
 /// The add list row.
 /// </summary>
 /// <param name="listRow">
 /// The list row.
 /// </param>
 public void AddListRow(UPMListRow listRow)
 {
     this.AddChild(listRow);
 }