/// <summary>
 /// Initializes a new instance of the <see cref="UpcrmTile"/> class.
 /// </summary>
 /// <param name="tiles">The tiles.</param>
 /// <param name="viewReference">The view reference.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="menuAction">The menu action.</param>
 public UPCRMTile(UPCRMTiles tiles, ViewReference viewReference, Dictionary <string, object> parameters, Menu menuAction)
 {
     this.Tiles         = tiles;
     this.ViewReference = viewReference;
     this.Parameters    = parameters;
     this.RequestOption = UPRequestOption.FastestAvailable;
     this.MenuAction    = menuAction;
 }
Exemplo n.º 2
0
        private void ContinueWithCopyFieldsLoaded(Dictionary <string, object> parameters)
        {
            this.ParameterDictionary = parameters;
            this.Tiles = !string.IsNullOrEmpty(this.TilesName) ? new UPCRMTiles(this.TilesName, this.RecordIdentification, parameters, this) : null;

            if (this.Tiles != null)
            {
                this.Tiles.Load();
                return;
            }

            this.ContinueBuildDetailsOrganizerPageTilesLoaded();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UPCRMRecordTile"/> class.
        /// </summary>
        /// <param name="tiles">The tiles.</param>
        /// <param name="viewReference">The view reference.</param>
        /// <param name="parameters">The parameters.</param>
        /// <param name="menuAction">The menu action.</param>
        /// <exception cref="Exception">
        /// RecordIdentification is null
        /// or
        /// TableCaptionName is null
        /// </exception>
        public UPCRMRecordTile(UPCRMTiles tiles, ViewReference viewReference, Dictionary <string, object> parameters, Menu menuAction)
            : base(tiles, viewReference, parameters, menuAction)
        {
            this.tableCaptionName     = this.ViewReference.ContextValueForKey("tableCaption");
            this.recordIdentification = this.ViewReference.ContextValueForKey("uid");
            string imageMapFilterName           = this.ViewReference.ContextValueForKey("imageMapFilter");
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;

            if (string.IsNullOrEmpty(this.recordIdentification))
            {
                throw new Exception("RecordIdentification is null");
            }

            if (!string.IsNullOrEmpty(this.tableCaptionName))
            {
                this.tableCaption = configStore.TableCaptionByName(this.tableCaptionName);
            }

            if (this.tableCaption == null)
            {
                if (string.IsNullOrEmpty(this.tableCaptionName))
                {
                    throw new Exception("TableCaptionName is null");
                }
            }

            if (!string.IsNullOrEmpty(imageMapFilterName))
            {
                this.imageFilter = configStore.FilterByName(imageMapFilterName);
                this.imageFilter = this.imageFilter?.FilterByApplyingValueDictionaryDefaults(this.Parameters, true);

                if (this.imageFilter != null)
                {
                    this.catalogAttributes = configStore.CatalogAttributesByFilter(this.imageFilter);
                    if (this.catalogAttributes != null)
                    {
                        this.crmQuery?.AddCrmFields(new List <UPCRMField> {
                            this.catalogAttributes.CrmField
                        });
                    }
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Updateds the element.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <returns>
        /// The <see cref="UPMElement" />.
        /// </returns>
        public override UPMElement UpdatedElement(UPMElement element)
        {
            if (element is UPMOrganizer)
            {
                this.AlternateExpandChecker = null;
                this.LinkReader             = null;
                this.Tiles      = null;
                this.TilesName  = null;
                this.CopyFields = null;
                this.PageModelControllers.Clear();
                List <UPMElement> newActions = null;

                foreach (UPMOrganizerAction action in this.LeftNavigationBarItems)
                {
                    if (action.Identifier.IdentifierAsString == "CloseOrganizerAction")
                    {
                        newActions = new List <UPMElement> {
                            action
                        };
                    }
                }

                if (newActions != null)
                {
                    this.LeftNavigationBarItems = newActions;
                }
                else
                {
                    this.LeftNavigationBarItems.Clear();
                }

                this.RightNaviagtionBarItems.Clear();
                this.OrganizerHeaderQuickActionItems?.Clear();
                this.OrganizerHeaderActionItems.Clear();
                this.SaveActionItems.Clear();
                this.BuildDetailOrganizerPages();
            }

            return(null);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Tileses the did finish with success.
        /// </summary>
        /// <param name="crmTiles">The CRM tiles.</param>
        /// <param name="data">The data.</param>
        public void TilesDidFinishWithSuccess(UPCRMTiles crmTiles, object data)
        {
            this.Tiles = crmTiles;
            UPMOrganizer detailOrganizer = (UPMOrganizer)this.TopLevelElement;

            if (detailOrganizer.ExpandFound)
            {
                List <UPMTile> recordTiles = new List <UPMTile>();
                foreach (UPCRMTile tile in this.Tiles.Tiles)
                {
                    if (string.IsNullOrEmpty(tile.Value) && string.IsNullOrEmpty(tile.Text))
                    {
                        continue;
                    }

                    UPMTile tileElement = new UPMTile(StringIdentifier.IdentifierWithStringId("Tile"))
                    {
                        TextField = new UPMStringField(StringIdentifier.IdentifierWithStringId("TileText"))
                        {
                            StringValue = tile.Text
                        },
                        ValueField = new UPMStringField(StringIdentifier.IdentifierWithStringId("ValueText"))
                        {
                            StringValue = tile.Value
                        },
                        ImageName = tile.ImageName
                    };
                    recordTiles.Add(tileElement);
                }

                detailOrganizer.Tiles = recordTiles;
                this.InformAboutDidChangeTopLevelElement(this.Organizer, this.Organizer, null, UPChangeHints.ChangeHintsWithHint("RecordDataChanged"));
            }
            else
            {
                this.ContinueBuildDetailsOrganizerPageTilesLoaded();
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UPCRMSearchTile"/> class.
 /// </summary>
 /// <param name="tiles">The tiles.</param>
 /// <param name="viewReference">The view reference.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="menuAction">The menu action.</param>
 public UPCRMSearchTile(UPCRMTiles tiles, ViewReference viewReference, Dictionary <string, object> parameters, Menu menuAction)
     : base(tiles, viewReference, parameters, menuAction)
 {
 }
        /// <summary>
        /// Tiles from view reference.
        /// </summary>
        /// <param name="viewReference">The view reference.</param>
        /// <param name="parameters">The parameters.</param>
        /// <param name="menuAction">The menu action.</param>
        /// <param name="crmTiles">The CRM tiles.</param>
        /// <returns></returns>
        public static UPCRMTile TileFromViewReference(ViewReference viewReference, Dictionary <string, object> parameters, Menu menuAction, UPCRMTiles crmTiles)
        {
            if (viewReference.ViewName == "Record")
            {
                return(new UPCRMRecordTile(crmTiles, viewReference, parameters, menuAction));
            }

            if (viewReference.ViewName == "Search")
            {
                return(new UPCRMSearchTile(crmTiles, viewReference, parameters, menuAction));
            }

            return(null);
        }