Exemplo n.º 1
0
        //解析存储全国区域网格表
        public static void PraseGridUnitConfigAllChina(string computernode)
        {
            //!!取出当前key值
            string keyString = "china";

            //! 数据库表类型对应的表名
            //!2\创建个map容器,key:value(表类型:数据库表名)
            Dictionary <string, DataTable> tableTypes = new Dictionary <string, DataTable>();

            //!遍历table,存储起来
            string[] tbnames  = { "GRID_HSFX_UNIT", "HSFX_ComputeUnit" };
            int      tableNum = tbnames.Length;

            for (int i = 0; i != tableNum; ++i)
            {
                //!当前表名类型
                string tableTypeName = tbnames[i];

                string sql = String.Format("SELECT *  from {0}", tbnames[i]);
                if (tableTypeName == "GRID_HSFX_UNIT")
                {
                    sql = String.Format(@"SELECT
                                                T1.*
                                        FROM
                                                {0} T1
                                        INNER JOIN(
                                                SELECT
                                                        a.ComputeUnit,
                                                        b.bswatacd
                                                FROM
                                                        HSFX_ComputeUnit a
                                                LEFT JOIN HSFX_Computer b ON a.ComputeNode = b.ComputeNode
                                                WHERE
                                                        a.ComputeNode = '{1}'
                                        ) T2 ON T1.GroupID = T2.ComputeUnit
                                        AND T1.bswatacd = T2.bswatacd
                                        ORDER BY province asc", tbnames[i], computernode);
                }
                else if (tableTypeName == "HSFX_ComputeUnit")
                {
                    sql = String.Format(@"SELECT
                                                *
                                        FROM
                                                {0}
                                        WHERE
                                                ComputeNode = '{1}'
                                        AND ComputeUnit > 100
                                        ORDER BY
                                                ComputeUnit ", tbnames[i], computernode);
                }
                DataTable value = Dal_Rain.GetDataBySql(keyString, sql);
                tableTypes.Add(tableTypeName, value);
            }

            //! 存储
            m_dbTableConfig.Add(keyString, tableTypes);
        }
Exemplo n.º 2
0
        public static bool IsValidDat(string datName)
        {
            String    errinfoSQL = String.Format("select * from Grid_TaiFeng_ErrorCALC where DATName = '{0}'", datName);
            string    keyString  = "china";
            DataTable dt         = Dal_Rain.GetDataBySql(keyString, errinfoSQL);

            if (dt.Rows.Count > 0)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
        public static void PraseComputerTableConfig()
        {
            //!!取出当前key值
            string keyString = "china";

            string tableTypeName = "HSFX_COMPUTER_Group";
            string sql           = String.Format("SELECT *  from {0}", tableTypeName);

            DataTable value = Dal_Rain.GetDataBySql(keyString, sql);

            //! 遍历DataTable存储
            for (int i = 0; i < value.Rows.Count; ++i)
            {
                string ip   = value.Rows[i]["ComputerIP"].ToString();
                string node = value.Rows[i]["ComputeNode"].ToString();
                m_computerValues.Add(ip, node);
            }
        }
Exemplo n.º 4
0
        public static void PraseGridUnitConfig()
        {
            m_dbTableConfig.Clear();
            int num = m_dataBaseConnects.Count;

            foreach (var curDB in m_dataBaseConnects)
            {
                //!!取出当前key值
                string keyString = curDB.Key;

                //! 数据库表类型对应的表名
                //!2\创建个map容器,key:value(表类型:数据库表名)
                Dictionary <string, DataTable> tableTypes = new Dictionary <string, DataTable>();

                //!遍历table,存储起来
                string[] tbnames  = { "GRID_HSFX_UNIT", "HSFX_ComputeUnit" };
                int      tableNum = tbnames.Length;
                for (int i = 0; i != tableNum; ++i)
                {
                    //!当前表名类型
                    string tableTypeName = tbnames[i];

                    string sql = String.Format("SELECT *  from {0}", tbnames[i]);
                    if (tableTypeName == "GRID_HSFX_UNIT")
                    {
                        sql = String.Format("SELECT *  from {0} where GroupID <> 9999 order by ID", tbnames[i]);
                    }
                    else if (tableTypeName == "HSFX_ComputeUnit")
                    {
                        sql = String.Format("select * from {0} where ComputeUnit > 100 ORDER BY ComputeUnit", tbnames[i]);
                    }
                    DataTable value = Dal_Rain.GetDataBySql(keyString, sql);
                    tableTypes.Add(tableTypeName, value);
                }

                //! 存储
                m_dbTableConfig.Add(keyString, tableTypes);
            }
        }