Esempio n. 1
0
        public static CloudEnv GetDefaultEnv()
        {
            var list = select("select * from DBCONF order by updateDate desc");

            if (list.Count <= 0)
            {
                return(CloudEnv.GetDefault());
            }
            return(CloudEnv.FromDict(list[0]));
        }
Esempio n. 2
0
        public static CloudEnv GetEnvByHostAndDbType(String host, int dbtype, ref int index)
        {
            var list = select("select * from DBCONF where dbHost='" + host + "' and dbType='" + dbtype + "' order by updateDate desc");

            if (list.Count <= 0 && index == 0)
            {
                return(null);
            }
            if (list.Count <= 0)
            {
                index++;
                return(GetEnvByHostAndDbType(host, dbtype, ref index));
            }
            if (index >= list.Count)
            {
                index = 0;
                var env = CloudEnv.FromDict(list[index]);
                index = -1;
                return(env);
            }
            return(CloudEnv.FromDict(list[index]));
        }