Exemplo n.º 1
0
        /// <summary>
        /// Check to see if there are any related InventoryItems, and load them if requested
        /// </summary>
        public static void CheckExpandInventoryItems(SqlDataManager sdm, IEnumerable <Scene> scenes, string expandString)
        {
            expandString = expandString.SafeToString();

            if (String.Equals(expandString, "all", StringComparison.OrdinalIgnoreCase) || expandString.IndexOf("inventoryItems", StringComparison.OrdinalIgnoreCase) >= 0)
            {
                var scenesWhere         = CreateSceneWhere(scenes, "Scenes");
                var childInventoryItems = sdm.GetAllInventoryItems <InventoryItem>(scenesWhere)
                                          .OrderBy(orderBy => orderBy.Name)
                ;

                scenes.ToList()
                .ForEach(feScene => feScene.LoadScenes_InventoryItems(childInventoryItems));
            }
        }
        /// <summary>
        /// Check to see if there are any related InventoryItems, and load them if requested
        /// </summary>
        public static void CheckExpandInventoryItems(SqlDataManager sdm, IEnumerable <StaffDirectory> staffDirectories, string expandString)
        {
            expandString = expandString.SafeToString();

            if (String.Equals(expandString, "all", StringComparison.OrdinalIgnoreCase) || expandString.IndexOf("inventoryItems", StringComparison.OrdinalIgnoreCase) >= 0)
            {
                var staffDirectoriesWhere = CreateStaffDirectoryWhere(staffDirectories, "Whocurrentlyhasit");
                var childInventoryItems   = sdm.GetAllInventoryItems <InventoryItem>(staffDirectoriesWhere)
                                            .OrderBy(orderBy => orderBy.Name)
                ;

                staffDirectories.ToList()
                .ForEach(feStaffDirectory => feStaffDirectory.LoadWhocurrentlyhasit_InventoryItems(childInventoryItems));
            }
        }