Esempio n. 1
0
        /// <summary>
        /// Initialize cache by load all data on db.
        /// </summary>
        private void InitializeCache()
        {
            // Load all data screen on DB to make cache.
            DatabaseScreenList listScreen = m_bizScreen.LoadScreens();

            DatabaseScreenList.Clear();
            for (int i = 0; i < listScreen.Count; i++)
            {
                DatabaseScreenList.Add(listScreen[i]);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Check if that found database screen.
        /// If found database screen, will cache it.
        /// </summary>
        /// <param name="screenCode">screenCode</param>
        /// <returns>Boolean</returns>
        public bool IsFoundDatabaseScreen(string screenCode)
        {
            if (!DatabaseScreenList.ContainKeys(screenCode))
            {
                // Load from database and store into cache.
                DatabaseScreen databaseScreen = m_bizScreen.LoadScreen(new NZString(null, screenCode));

                if (databaseScreen == null)
                {
                    return(false);
                }

                // Add to image cache.
                DatabaseScreenList.Add(databaseScreen);
                return(true);
            }

            return(true);
        }