예제 #1
0
        private bool CheckTable <T>() where T : GENTableEntity, new()
        {
            var entity = GENTableEntity.Create <T>();

            if (tables.Contains(entity.TableName))
            {
                return(true);
            }

            var script  = string.Empty;
            var scripts = Config.Instance.INFO.ScriptSetting.Scripts;

            if (entity is DBTStkMinuteEntity)
            {
                script = scripts.ContainsKey(TABLES.STK_MINUTE_TD.ToString()) ? scripts[TABLES.STK_MINUTE_TD.ToString()] : null;
            }
            if (entity is DBTStkDailyEntity)
            {
                script = scripts.ContainsKey(TABLES.STK_DAILY_TD.ToString()) ? scripts[TABLES.STK_DAILY_TD.ToString()] : null;
            }
            if (entity is DBTStkFavoriteEntity)
            {
                script = scripts.ContainsKey(TABLES.STK_FAVORITE_M.ToString()) ? scripts[TABLES.STK_FAVORITE_M.ToString()] : null;
            }

            var check = false;

            accessor.SetDBAccessor2(entity);
            if (check = entity.CreateTable(script))
            {
                tables.Add(entity.TableName);
            }
            return(check);
        }
예제 #2
0
        protected bool CheckTable <T>() where T : GENTableEntity, new()
        {
            var entity = GENTableEntity.Create <T>();

            if (tables.Contains(entity.TableName))
            {
                return(true);
            }

            var check = false;

            if (check = accessor.TableExists(entity.TableName))
            {
                tables.Add(entity.TableName);
            }
            return(check);
        }