示例#1
0
        /// <summary>
        /// 获取所有的权重信息的哈希表
        /// </summary>
        /// <returns></returns>
        private void GetRuleRightWeight()
        {
            try
            {
                //DataTable dt = null; // = GT_CARTO.CommonAPI.ado_OpenTable() .ado_Execute(CommonAPI.Get_DBConnection(), sql);
                //GT_CARTO.CommonAPI.ado_OpenTable("LR_EvaHMWeight", ref dt, GT_CARTO.CommonAPI.Get_DBConnection());
                DataTable dt = Hy.Common.Utility.Data.AdoDbHelper.GetDataTable(SysDbHelper.GetSysDbConnection(), "select * from LR_EvaHMWeight");
                if (dt.Rows.Count < 1)
                {
                    return;
                }
                foreach (DataRow dr in dt.Rows)
                {
                    string key = dr["ElementID"].ToString();
                    if (key != "" && !hashRuleWeight.ContainsKey(key))
                    {
                        hashRuleWeight[key] = dr["ErrType"].ToString();
                    }
                }
            }
            catch (Exception exp)
            {
                Hy.Common.Utility.Log.OperationalLogManager.AppendMessage(exp.ToString());

                //GT_CONST.LogAPI.CheckLog.AppendErrLogs(ex.ToString());
            }
        }
示例#2
0
        private bool GetRuleClassify()
        {
            m_ClassifyLevelRules = new List <ClassifyRule>();
            DataTable result      = null;
            DataTable yjdatatable = null;

            try
            {
                result = SysDbHelper.GetRulesClassifyList(m_strSchemaId);

                if (result == null || result.Rows.Count == 0)
                {
                    return(false);
                }
                yjdatatable = AdoDbHelper.GetDataTable(SysDbHelper.GetSysDbConnection(), string.Format("select yjmlmc,yjmlbm from LR_CheckTypeModel where SchemaId='{0}' group by yjmlmc,yjmlbm order by yjmlbm ", m_strSchemaId));

                foreach (DataRow dr in yjdatatable.Rows)
                {
                    int          parseBm    = int.Parse(dr["YJMLBM"].ToString());
                    ClassifyRule rule       = InitRuleLevel(dr["YJMLMC"].ToString(), parseBm);
                    int          rulesCount = 0;
                    rule.SubRules      = GetChildRules(parseBm.ToString(), "EJMLMC", "EJMLBM", 1, result, out rulesCount);
                    rule.SubRulesCount = rulesCount;//CalculateRulesCount(rule.SubRules);
                    m_ClassifyLevelRules.Add(rule);
                }
            }
            catch (Exception exp)
            {
                Hy.Common.Utility.Log.OperationalLogManager.AppendMessage(exp.ToString());
            }
            finally
            {
                if (result != null)
                {
                    result.Dispose();
                    result = null;
                }
                if (yjdatatable != null)
                {
                    yjdatatable.Dispose();
                    yjdatatable = null;
                }
            }

            return(true);
        }
示例#3
0
 static DefectHelper()
 {
     try
     {
         DataTable dtDefectLevel = Hy.Common.Utility.Data.AdoDbHelper.GetDataTable(SysDbHelper.GetSysDbConnection(), "select ElementID as RuleID,IIF(ErrType='轻缺陷',0,IIF(ErrType='重缺陷',1,2)) as DefectLevel from LR_EvaHMWeight");
         m_DictDefectLevel = new Dictionary <string, enumDefectLevel>();
         for (int i = 0; i < dtDefectLevel.Rows.Count; i++)
         {
             m_DictDefectLevel.Add(dtDefectLevel.Rows[i][0] as string, (enumDefectLevel)Convert.ToInt32(dtDefectLevel.Rows[i][1]));
         }
     }
     catch (Exception exp)
     {
         Hy.Common.Utility.Log.OperationalLogManager.AppendMessage(exp.ToString());
     }
 }
示例#4
0
        /// <summary>
        /// 获取所有图层(DataTable对象)
        /// 开放给知道图层表结构的开发/应用或者配合GetLayerFromDataRow@see::GetLayerFromDataRow方法使用
        /// </summary>
        /// <returns></returns>
        public static DataTable GetAllLayers()
        {
            IDbConnection sysConnection = SysDbHelper.GetSysDbConnection();

            return(AdoDbHelper.GetDataTable(sysConnection, "select * from LR_DicLayer"));
        }
示例#5
0
        public static DataTable GetAllFields()
        {
            IDbConnection sysConnection = SysDbHelper.GetSysDbConnection();

            return(Hy.Common.Utility.Data.AdoDbHelper.GetDataTable(sysConnection, "select * from LR_DicField"));
        }