Пример #1
0
        /// <summary>
        /// 指写入数据库记录
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        public static bool AddTask(Task task)
        {
            try
            {
                IDbConnection sysConnection = SysDbHelper.GetSysDbConnection();
                DataTable     tTask         = AdoDbHelper.GetDataTable(sysConnection, "select * from LR_ModelTask where 1=2");
                DataRow       rowNewTask    = tTask.NewRow();
                rowNewTask["TaskID"]        = task.ID;
                rowNewTask["TaskName"]      = task.Name;
                rowNewTask["TaskPath"]      = task.Path;
                rowNewTask["LibraryName"]   = task.SourcePath;
                rowNewTask["TaskType"]      = (int)task.DatasourceType;
                rowNewTask["SchemaID"]      = task.SchemaID;
                rowNewTask["ExeState"]      = (int)task.State;
                rowNewTask["Institution"]   = task.Institution;
                rowNewTask["Person"]        = task.Creator;
                rowNewTask["CreateTime"]    = task.CreateTime;
                rowNewTask["Remark"]        = task.Remark;
                rowNewTask["MapScale"]      = task.MapScale;
                rowNewTask["TopoTolerance"] = task.TopoTolerance;
                rowNewTask["UseDatasource"] = task.UseSourceDirectly;

                rowNewTask["StandardID"] = SysDbHelper.GetStandardID(task.StandardName);

                rowNewTask["LibraryID"]   = 0;
                rowNewTask["BIsTemplate"] = 0;

                tTask.Rows.Add(rowNewTask);
                return(AdoDbHelper.UpdateTable("LR_ModelTask", tTask, sysConnection));
            }
            catch
            {
                return(false);
            }
        }
Пример #2
0
        public override bool Verify()
        {
            //根据别名取featureclass的名字
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            strSrcLayer = LayerReader.GetNameByAliasName(m_pPara.strTargetLayer, standardID);
            strRelLayer = LayerReader.GetNameByAliasName(m_pPara.strRelLayer, standardID);

            if (this.m_BaseWorkspace != null)
            {
                if (!(this.m_BaseWorkspace as IWorkspace2).get_NameExists(esriDatasetType.esriDTFeatureClass, strSrcLayer))
                {
                    string strLog = "当前工作数据库的关系图层" + strSrcLayer + "不存在,无法执行检查!";
                    SendMessage(enumMessageType.RuleError, strLog);
                    return(false);
                }

                if (!(this.m_BaseWorkspace as IWorkspace2).get_NameExists(esriDatasetType.esriDTFeatureClass, strSrcLayer))
                {
                    string strLog = "当前工作数据库的目标图层" + strRelLayer + "不存在,无法执行检查!";
                    SendMessage(enumMessageType.RuleError, strLog);
                    return(false);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="nLayerID">图层的ID</param>
        /// <param name="strStdName">建库标准名称</param>
        /// <param name="strAttrTableName">图层别名</param>
        /// <returns></returns>
        public bool GetLayerIDByTableName(ref int nLayerID, string schemaID, string strAttrTableName)
        {
            try
            {
                int nStdID = SysDbHelper.GetStandardIDBySchemaID(schemaID);

                string strSql = "Select LayerID From LR_DicLayer Where StandardID = " + nStdID + "and AttrTableName = '" +
                                strAttrTableName + "'";
                DataTable dt = new DataTable();
                //	打开表LR_DicStandard
                dt = AdoDbHelper.GetDataTable(this.m_DBConnection, strSql);
                if (dt.Rows.Count == 0)
                {
                    return(false);
                }
                DataRow dr = dt.Rows[0];
                nLayerID = Convert.ToInt32(dr["LayerID"]);
            }
            catch (Exception ex)
            {
                //Hy.Check.Rule.Helper.LogAPI.CheckLog.AppendErrLogs(ex.ToString());
                //显示错误信息;
                //XtraMessageBox.Show("XStandardHelper::GetLayerIDByAlias()" + ex.Message);
                return(false);
            }
            return(true);
        }
Пример #4
0
        protected void RenameClassObjects(IWorkspace wsTarget)
        {
            int          standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);
            IEnumDataset enDataset  = wsTarget.get_Datasets(esriDatasetType.esriDTAny);
            IDataset     dsCurrent  = enDataset.Next();

            while (dsCurrent != null)
            {
                switch (dsCurrent.Type)
                {
                case esriDatasetType.esriDTTable:
                case esriDatasetType.esriDTFeatureClass:
                    RenameClassObject(dsCurrent, standardID);
                    break;

                case esriDatasetType.esriDTFeatureDataset:

                    //RenameClassObject(dsCurrent, standardID);  // FeatureDataset需要改吗

                    IEnumDataset enSubDataset = dsCurrent.Subsets;
                    IDataset     subDataset   = enSubDataset.Next();
                    while (subDataset != null)
                    {
                        RenameClassObject(subDataset, standardID);
                        subDataset = enSubDataset.Next();
                    }
                    break;
                }
                System.Runtime.InteropServices.Marshal.ReleaseComObject(dsCurrent);

                dsCurrent = enDataset.Next();
            }
        }
Пример #5
0
        private void cmbStandard_SelectedIndexChanged(object sender, EventArgs e)
        {
            cmbSchema.Properties.Items.Clear();

            if (cmbStandard.SelectedIndex < 0)
            {
                return;
            }

            m_DicSchema = SysDbHelper.GetSchemasInfo(cmbStandard.SelectedItem as string);
            if (m_DicSchema == null)
            {
                dxErrorProvider.SetError(cmbStandard, "当前标准下没有配置检查方案");
                return;
            }
            Dictionary <string, string> .Enumerator enSchema = m_DicSchema.GetEnumerator();
            while (enSchema.MoveNext())
            {
                cmbSchema.Properties.Items.Add(enSchema.Current);
            }
            if (cmbSchema.Properties.Items.Count > 0)
            {
                cmbSchema.SelectedIndex = 0;
            }
        }
Пример #6
0
        /// <summary>
        /// 检测指定路径下指定名称的任务在数据库中是否存在
        /// </summary>
        /// <param name="strTaskName"></param>
        /// <param name="strTaskPath"></param>
        /// <returns></returns>
        public static bool TaskExistsInDB(string strName, string strPath)
        {
            IDbConnection sysConnection = SysDbHelper.GetSysDbConnection();
            DataTable     tTask         = AdoDbHelper.GetDataTable(sysConnection, string.Format("select * from LR_ModelTask where TaskPath='{0}' and TaskName='{1}'", strPath.Replace("'", "''"), strName.Replace("'", "''")));

            return(tTask.Rows.Count > 0);
        }
Пример #7
0
        /// <summary>
        /// 从数据记录形成Task对象
        /// </summary>
        /// <param name="rowTask"></param>
        /// <returns></returns>
        public static Task GetTaskFromDataRow(System.Data.DataRow rowTask)
        {
            if (rowTask == null)
            {
                return(null);
            }

            try
            {
                Task task = new Task();
                task.ID                = rowTask["TaskID"] as string;
                task.Name              = rowTask["TaskName"] as string;
                task.Path              = rowTask["TaskPath"] as string;
                task.SourcePath        = rowTask["LibraryName"] as string;
                task.DatasourceType    = (enumDataType)Convert.ToInt32(rowTask["TaskType"]);
                task.SchemaID          = rowTask["SchemaID"] as string;
                task.State             = (enumTaskState)Convert.ToInt32(rowTask["ExeState"]);
                task.StandardName      = SysDbHelper.GetStandardName(Convert.ToInt32(rowTask["StandardID"]));
                task.Institution       = rowTask["Institution"] as string;
                task.Creator           = rowTask["Person"] as string;
                task.CreateTime        = rowTask["CreateTime"] as string;
                task.Remark            = rowTask["Remark"] as string;
                task.MapScale          = Convert.ToInt32(rowTask["MapScale"]);
                task.TopoTolerance     = Convert.ToDouble(rowTask["TopoTolerance"]);
                task.UseSourceDirectly = (bool)rowTask["UseDatasource"];
                return(task);
            }
            catch
            {
                return(null);
            }
        }
Пример #8
0
        private void Init()
        {
            // 标准和方案
            Dictionary <int, string> dicStandard = SysDbHelper.GetStandardInfo();

            if (dicStandard == null)
            {
                MessageBoxApi.ShowWaringMessageBox("当前系统库中找不到质检标准,无法创建任务!");

                this.Close();
                this.DialogResult = DialogResult.Cancel;
                return;
            }
            Dictionary <int, string> .ValueCollection.Enumerator enName = dicStandard.Values.GetEnumerator();
            while (enName.MoveNext())
            {
                cmbStandard.Properties.Items.Add(enName.Current);
            }
            if (cmbStandard.Properties.Items.Count > 0)
            {
                cmbStandard.SelectedIndex = 0;
            }

            // 创建时间
            dateTime.DateTime = DateTime.Now;
        }
Пример #9
0
        /// <summary>
        ///通过图层别名获取图层名称
        /// </summary>
        /// <param name="strAliasName">Name of the STR alias.</param>
        /// <returns></returns>
        protected string GetLayerName(string strAliasName)
        {
            if (string.IsNullOrEmpty(strAliasName))
            {
                return(null);
            }
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            return(LayerReader.GetNameByAliasName(strAliasName, standardID));
        }
Пример #10
0
        private string ConstructErrorInfo()
        {
            int            layerid = -1;
            StandardHelper pStand  = new StandardHelper(SysDbHelper.GetSysDbConnection());

            pStand.GetLayerIDByTableName(ref layerid, this.m_SchemaID, m_structPara.strFtName);

            string strSql1 = "Select FieldCode,FieldName From LR_DicField Where LayerID = " + layerid;

            List <FIELDMAP> arrFieldMap = new List <FIELDMAP>();
            DataTable       dt          = new DataTable();

            AdoDbHelper.GetDataTable(SysDbHelper.GetSysDbConnection(), strSql1);
            if (dt.Rows.Count == 0)
            {
                return(null);
            }
            foreach (DataRow dr in dt.Rows)
            {
                string FName  = dr["FieldCode"].ToString(); //字段名
                string FAlias = dr["FieldName"].ToString(); //字段别名

                FIELDMAP fMap = new FIELDMAP();
                fMap.strAlias = FAlias;
                fMap.strName  = FName;
                arrFieldMap.Add(fMap);
            }

            /*string Alias = "", Alias2 = "";
             * pStand.GetAliasByLayerName(ref Alias, m_structPara.strFtName, m_strStdName);
             * pStand.GetAliasByLayerName(ref Alias2, m_structPara.strFtName2, m_strStdName);*/
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            if (!string.IsNullOrEmpty(FtName1))
            {
                FtName1 = LayerReader.GetNameByAliasName(m_structPara.strFtName, standardID);
            }
            if (!string.IsNullOrEmpty(FtName2))
            {
                FtName2 = LayerReader.GetNameByAliasName(m_structPara.strFtName, standardID);
            }
            string strErrInfo = m_structPara.strClause;

            for (int i = 0; i < arrFieldMap.Count; i++)
            {
                string strR = arrFieldMap[i].strAlias;
                string strS = arrFieldMap[i].strName;
                strErrInfo.Replace(strS, strR);
            }
            strErrInfo.Replace(m_structPara.strFtName, FtName1);
            strErrInfo.Replace(m_structPara.strFtName2, FtName2);
            strErrInfo = "字段值符合表达式 (" + strErrInfo + ")";

            return(strErrInfo);
        }
Пример #11
0
        /// <summary>
        /// 更新Task的状态到数据库
        /// </summary>
        /// <param name="taskID"></param>
        /// <param name="taskState"></param>
        /// <returns></returns>
        public static bool UpdateTaskState(string taskID, enumTaskState taskState)
        {
            if (taskState == enumTaskState.PartlyExcuted)
            {
                return(true);
            }

            string strSQL = string.Format("Update LR_ModelTask set ExeState={0} where TaskID='{1}'", (int)taskState, taskID);

            return(AdoDbHelper.ExecuteSql(SysDbHelper.GetSysDbConnection(), strSQL));
        }
Пример #12
0
        public override bool Verify()
        {
            string strSQL = "select AttrTableName,LayerName,LayerOption from LR_DicLayer";

            dtLayer = Hy.Common.Utility.Data.AdoDbHelper.GetDataTable(SysDbHelper.GetSysDbConnection(), strSQL);
            if (dtLayer == null)
            {
                SendMessage(enumMessageType.Exception, "在系统库中找不到标准的图层列表");
                return(false);
            }
            return(true);
        }
Пример #13
0
        /// <summary>
        /// 通过ID获取Task对象
        /// </summary>
        /// <param name="taskID"></param>
        /// <returns></returns>
        public static Task GetTask(string taskID)
        {
            IDbConnection sysConnection = SysDbHelper.GetSysDbConnection();
            DataTable     tTask         = AdoDbHelper.GetDataTable(sysConnection, string.Format("select * from LR_ModelTask where TaskID='{0}'", taskID));

            if (tTask == null || tTask.Rows.Count == 0)
            {
                return(null);
            }

            return(GetTaskFromDataRow(tTask.Rows[0]));
        }
Пример #14
0
        public override bool Verify()
        {
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            lyr = LayerReader.GetLayerByAliasName(m_structFrePara.strFtName, standardID);
            if (lyr == null)
            {
                SendMessage(enumMessageType.VerifyError, "当前方案所在的标准中找不到名为“" + m_structFrePara.strFtName + "”的图层");
                return(false);
            }

            return(true);
        }
Пример #15
0
        public override bool Verify()
        {
            //根据别名取图层名
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            layerName = LayerReader.GetNameByAliasName(m_structPara.strFtName, standardID);
            if (string.IsNullOrEmpty(layerName))
            {
                SendMessage(enumMessageType.VerifyError, string.Format("当前标准中不存在图层“{0}”", m_structPara.strFtName));
                return(false);
            }
            return(true);
        }
Пример #16
0
        public override bool Verify()
        {
            //根据别名取featureclass的名字
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            layerName = LayerReader.GetNameByAliasName(m_structPara.strFtName, standardID);

            //清除以前结果
            if (this.m_QueryConnection == null)
            {
                return(false);
            }
            return(true);
        }
Пример #17
0
        private void cmbStandard_SelectedIndexChanged(object sender, EventArgs e)
        {
            // 方案联动
            cmbSchema.Properties.Items.Clear();

            if (cmbStandard.SelectedIndex < 0)
            {
                return;
            }

            m_DicSchema = SysDbHelper.GetSchemasInfo(cmbStandard.SelectedItem as string);
            if (m_DicSchema == null)
            {
                dxErrorProvider.SetError(cmbStandard, "当前标准下没有配置检查方案");
                return;
            }
            Dictionary <string, string> .Enumerator enSchema = m_DicSchema.GetEnumerator();
            while (enSchema.MoveNext())
            {
                cmbSchema.Properties.Items.Add(enSchema.Current);
            }
            if (cmbSchema.Properties.Items.Count > 0)
            {
                cmbSchema.SelectedIndex = 0;
            }

            // 空间参考图层联动
            List <StandardLayer> lyrList = LayerReader.GetLayersByStandard(m_StandardIDList[cmbStandard.SelectedIndex]);
            int count = lyrList.Count;

            for (int i = 0; i < count; i++)
            {
                if (lyrList[i].Type == enumLayerType.Table ||
                    lyrList[i].Type == enumLayerType.UnKnown)
                {
                    continue;
                }
                cmbSpatialRefLayer.Properties.Items.Add(new KeyValuePair <string, string>(lyrList[i].Name, lyrList[i].AliasName));
            }
            if (cmbSpatialRefLayer.Properties.Items.Count > 0)
            {
                cmbSpatialRefLayer.SelectedIndex = 0;
            }
        }
Пример #18
0
        public override bool Verify()
        {
            m_StandarID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);
            //根据别名取图层名
            m_layerName = LayerReader.GetNameByAliasName(m_structInvalidPara.strFtName, m_StandarID);

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

            if (!(m_QueryWorkspace as IWorkspace2).get_NameExists(esriDatasetType.esriDTTable, m_layerName))
            {
                string strLog = "当前工作数据库中不存在图层" + m_layerName + ",无法执行非法字符检查!";
                SendMessage(enumMessageType.RuleError, strLog);
                return(false);
            }
            return(true);
        }
Пример #19
0
        private void Init()
        {
            // 标准和方案
            Dictionary <int, string> dicStandard = SysDbHelper.GetStandardInfo();

            if (dicStandard == null)
            {
                XtraMessageBox.Show("当前系统库中未建立标准", "HyDC 错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
                return;
            }
            Dictionary <int, string> .Enumerator enStandard = dicStandard.GetEnumerator();
            m_StandardIDList = new List <int>();
            while (enStandard.MoveNext())
            {
                cmbStandard.Properties.Items.Add(enStandard.Current.Value);
                m_StandardIDList.Add(enStandard.Current.Key);
            }
            if (cmbStandard.Properties.Items.Count > 0)
            {
                cmbStandard.SelectedIndex = 0;
            }


            //设置点击可以修改的列弹出的修改文本框的属性和订阅事件
            m_RepTxtDatasource.TextEditStyle = TextEditStyles.DisableTextEditor;
            m_RepTxtDatasource.ButtonClick  += new ButtonPressedEventHandler(m_RepTxtDatasource_ButtonClick);
            m_RepCmbTaskPath.TextEditStyle   = TextEditStyles.DisableTextEditor;
            m_RepCmbTaskPath.ButtonClick    += new ButtonPressedEventHandler(pRepTxtTaskPath_ButtonClick);
            m_RepCmbMapScale.Items.AddRange(m_MapScales);// new string[] {"1:500", "1:1000", "1:2000", "1:5000", "1:10000","1:25000", "1:50000" , "1:100000", "1:25000", "1:500000", "1:1000000"});
            m_RepCmbMapScale.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
            m_RepCmbMapScale.DisplayFormat.FormatString = "1:{0}";
            m_RepCmbCheckType.Items.AddRange(new string[] { Text_CheckMode_CreateOnly, Text_CheckMode_CheckPartly, Text_CheckMode_CheckAll });
            m_RepCmbMapScale.TextEditStyle = TextEditStyles.DisableTextEditor;
            //m_RepCmbMapScale.SelectedIndexChanged += new EventHandler(m_pRepComBox_Scale_SelectedIndexChanged);
            m_RepCmbCheckType.TextEditStyle = TextEditStyles.DisableTextEditor;
            m_RepCmbCheckType.CloseUp      += new CloseUpEventHandler(m_pRepComBox_CheckType_CloseUp);


            //
            wpSourceSelect.AllowNext = false;
        }
Пример #20
0
        public IActionResult Login()
        {
            //Session.Register("a", "p");
            //DbHelper.QueryDynamicList("select * from test1");
            //var country = SysDbHelper.QueryOne<EbayCountry>("select * from EbayCountry where Id = '123'");
            //var result = SysDbHelper.Insert<EbayCountry>(new EbayCountry()
            //    {Code = Models.SystemModel.CountryCodeType.AE, Id = "456", Name = "AE"});
            var sql     = SysDbHelper.GetCompiler().Compile(SysDbHelper.GetQuery("SysEbayAccount").Where("EbayId", "acseller8"));
            var test    = sql.RawSql;
            var test2   = sql.ToString();
            var account = SysDbHelper.QueryOne <SysEbayAccount>(test2); //注意mysql 表名区分大消息

            //var itemService = new EbayItemService();
            //var session = itemService.AddItemTest(account);
            //var session = EbayApiCategory.GetEbayCategory(account);
            //var categoryService = new EbayCategoryService();
            //var session = categoryService.SyncEbayCategory(SysDbHelper, account);
            //SysDbHelper.Insert(session.ToArray());
            //Logger.LogTrace(session);
            return(Ok());
        }
Пример #21
0
        public override bool Verify()
        {
            // 获取标准ID
            int nStdID = SysDbHelper.GetStandardID(this.m_strStdName);

            lyr = LayerReader.GetLayerByAliasName(m_psPara.strFtName, nStdID);
            if (lyr == null)
            {
                SendMessage(enumMessageType.VerifyError, string.Format("标准中不存在图层“{0}”", m_psPara.strFtName));
                return(false);
            }

            // 获取实际字值名
            Helper.StandardHelper helper = new Hy.Check.Rule.Helper.StandardHelper(this.m_QueryConnection);
            strFieldCode = FieldReader.GetNameByAliasName(m_psPara.strCodeField, lyr.ID);
            if (string.IsNullOrEmpty(strFieldCode))
            {
                SendMessage(enumMessageType.VerifyError, string.Format("标准图层中不存在字段“{0}”", m_psPara.strCodeField));
                return(false);
            }

            strFieldCodeType = helper.GetLayerFieldType(strFieldCode, lyr.AttributeTableName);
            if (string.IsNullOrEmpty(strFieldCodeType))
            {
                SendMessage(enumMessageType.VerifyError, string.Format("数据图层中不存在字段“{0}”", m_psPara.strCodeField));
                return(false);
            }

            if (m_psPara.strNameField != "")
            {
                strFieldName = FieldReader.GetNameByAliasName(m_psPara.strNameField, lyr.ID);
            }
            else
            {
                SendMessage(enumMessageType.VerifyError, "没有配置字段");
                return(false);
            }

            return(true);
        }
Пример #22
0
        public override bool Verify()
        {
            standarID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            StandardLayer lyr = LayerReader.GetLayerByAliasName(m_psPara.strTargetLayer, standarID);

            if (lyr == null)
            {
                SendMessage(enumMessageType.VerifyError, "当前方案所在的标准中找不到名为“" + m_psPara.strTargetLayer + "”的图层");
                return(false);
            }

            strLayerName = lyr.Name;
            strCodeField = FieldReader.GetNameByAliasName(m_psPara.strCodeField, lyr.ID);
            if (string.IsNullOrEmpty(strCodeField))
            {
                SendMessage(enumMessageType.VerifyError, string.Format("当前方案所在的标准中找不到名为“{0}”的图层", m_psPara.strCodeField));
                return(false);
            }

            return(true);
        }
Пример #23
0
        public override bool Verify()
        {
            //先取得要进行空间关系查询的ILayer
            IFeatureWorkspace ipFtWS = (IFeatureWorkspace)m_BaseWorkspace;

            int standarID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            StandardLayer lyrSource = LayerReader.GetLayerByAliasName(m_pPara.strGeographyObject, standarID);

            if (lyrSource == null)
            {
                SendMessage(enumMessageType.VerifyError, string.Format("当前方案所在的标准中批不到名为“{0}”的图层", m_pPara.strGeographyObject));
                return(false);
            }

            strSrcLayer = lyrSource.Name;
            if (m_pPara.arrayGraphSpeckleField.Count > 0)
            {
                strSrcFiled = FieldReader.GetNameByAliasName(m_pPara.arrayGraphSpeckleField[0], lyrSource.ID);
                if (string.IsNullOrEmpty(strSrcFiled))
                {
                    SendMessage(enumMessageType.VerifyError, string.Format("当前方案所在的标准中批不到名为“{0}”的图层", m_pPara.arrayGraphSpeckleField[0]));
                    return(false);
                }
            }

            StandardLayer lyrRel = LayerReader.GetLayerByAliasName(m_pPara.strGraphSpeckle, standarID);

            strRelLayer = lyrRel.Name;
            if (m_pPara.arrayGeographyObjectField.Count > 0)
            {
                strRelField = FieldReader.GetNameByAliasName(m_pPara.arrayGeographyObjectField[0], lyrRel.ID);
                if (string.IsNullOrEmpty(strRelField))
                {
                    SendMessage(enumMessageType.VerifyError, string.Format("当前方案所在的标准中批不到名为“{0}”的图层", m_pPara.arrayGeographyObjectField[0]));
                    return(false);
                }
            }
            //得到目标图层和关系图层的featureclass
            IFeatureClass pSrcFeatClass = null;
            IFeatureClass pRelFeatClass = null;
            IWorkspace    TempWorkspace = null;

            IWorkspace2 wsTest = ipFtWS as IWorkspace2;

            // 原始数据准备
            // 打开“源”
            try
            {
                pSrcFeatClass = ipFtWS.OpenFeatureClass(strSrcLayer);
            }
            catch
            {
                SendMessage(enumMessageType.VerifyError, "当前工作数据库的关系图层" + strSrcLayer + "不存在,无法执行检查!");
                return(false);
            }
            m_srcfcname = strSrcLayer;
            if (pSrcFeatClass.FeatureCount(null) == 0)
            {
                Marshal.ReleaseComObject(pSrcFeatClass);
                SendMessage(enumMessageType.VerifyError, "当前工作数据库的关系图层" + strSrcLayer + "为空,无法执行检查!");
                return(false);
            }
            if (pSrcFeatClass != null)
            {
                Marshal.ReleaseComObject(pSrcFeatClass);
                pSrcFeatClass = null;
            }
            // 打开“目标”
            try
            {
                pRelFeatClass = ipFtWS.OpenFeatureClass(strRelLayer);
            }
            catch
            {
                SendMessage(enumMessageType.VerifyError, "当前工作数据库的目标图层" + strRelLayer + "不存在,无法执行检查!");
                return(false);
            }

            if (pRelFeatClass.FeatureCount(null) == 0)
            {
                Marshal.ReleaseComObject(pRelFeatClass);
                SendMessage(enumMessageType.VerifyError, "当前工作数据库的关系图层" + strSrcLayer + "为空,无法执行检查!");
                return(false);
            }

            if (pRelFeatClass != null)
            {
                Marshal.ReleaseComObject(pRelFeatClass);
                pRelFeatClass = null;
            }

            return(true);
        }
Пример #24
0
        //public static bool DeleteTask(TaskInfo task)
        //{
        //    return false;
        //}

        /// <summary>
        /// 指删除数据库记录
        /// </summary>
        /// <param name="taskID"></param>
        /// <returns></returns>
        public static bool DeleteTask(string taskID)
        {
            IDbConnection sysConnection = SysDbHelper.GetSysDbConnection();

            return(AdoDbHelper.ExecuteSql(sysConnection, string.Format("delete from LR_ModelTask where TaskID='{0}'", taskID)));
        }
Пример #25
0
        /// <summary>
        /// 使用统一入口进行质检
        /// </summary>
        /// <param name="dsTarget">可以是IWorkspace,IFeatureClass或ITable</param>
        /// <returns></returns>
        public DataTable Check(IDataset dsTarget)
        {
            // 数据导入
            string       strBaseName  = "Base.gdb";
            string       strQueryDB   = "Base.mdb";
            bool         ready        = false;
            enumDataType baseDataType = enumDataType.FileGDB;

            SendCheckingMessage("正在进行数据导入…");

            try
            {
                Clear();
                if (dsTarget is IWorkspace)
                {
                    ready = PrepareForWorkspace(dsTarget as IWorkspace, out strBaseName, out strQueryDB, out baseDataType);
                }
                else if (dsTarget is IFeatureClass)
                {
                    ready        = PrepareForFeatureClass(dsTarget, out strBaseName, out strQueryDB);
                    baseDataType = enumDataType.PGDB;
                }
                else if (dsTarget is ITable)
                {
                    ready        = PrepareForTable(dsTarget, out strBaseName, out strQueryDB);
                    baseDataType = enumDataType.PGDB;
                }


                if (!ready)
                {
                }

                // 开始准备检查

                string        strBaseFullName  = string.Format("{0}\\{1}", TempPath, strBaseName);
                string        strQueryFullName = string.Format("{0}\\{1}", TempPath, strQueryDB);
                IWorkspace    wsBase           = AEAccessFactory.OpenWorkspace(baseDataType, strBaseFullName);
                IWorkspace    wsQuery          = AEAccessFactory.OpenWorkspace(enumDataType.PGDB, strQueryFullName);
                IDbConnection queryConnection  = AdoDbHelper.GetDbConnection(strQueryFullName);

                // 开始执行检查
                Checker curChecker = new Checker();
                curChecker.VerifyingRuleChanged   += new DealingRuleChangedHandler(VerifyingRuleChanged);
                curChecker.VerifyedComplete       += new VerifyedCompleteHandler(VerifyedComplete);
                curChecker.PretreatingRuleChanged += new DealingRuleChangedHandler(PretreatingRuleChanged);
                curChecker.PretreatComplete       += new CheckEventHandler(PretreatComplete);
                curChecker.CheckingRuleChanged    += new DealingRuleChangedHandler(CheckingRuleChanged);
                curChecker.CheckComplete          += new CheckEventHandler(CheckComplete);
                curChecker.RuleChecked            += new RuleCheckedHandler(RuleChecked);
                curChecker.TopoRuleCheckBegin     += new CheckEventHandler(TopoRuleCheckBegin);

                curChecker.BaseWorkspace   = wsBase;
                curChecker.QueryWorkspace  = wsQuery;
                curChecker.QueryConnection = queryConnection;
                curChecker.ResultPath      = TempPath;
                // 如果没有设置SchemaID,获取第一个
                // 如果没有设置RuleInfo列表,获取所有
                if (string.IsNullOrEmpty(this.SchemaID))
                {
                    Dictionary <int, string> dictStandard = SysDbHelper.GetStandardInfo();
                    if (dictStandard == null || dictStandard.Count == 0)
                    {
                        return(null);
                    }

                    Dictionary <string, string> dictSchema = SysDbHelper.GetSchemasInfo(dictStandard.ElementAt(0).Value);
                    if (dictSchema == null || dictSchema.Count == 0)
                    {
                        return(null);
                    }

                    this.SchemaID = dictSchema.ElementAt(0).Key;
                }
                if (this.RuleInfos == null)
                {
                    TemplateRules templateRule = new TemplateRules(this.SchemaID);
                    this.RuleInfos = templateRule.CurrentSchemaRules;
                }

                curChecker.RuleInfos     = this.RuleInfos;
                curChecker.SchemaID      = this.SchemaID;
                curChecker.TopoDBPath    = TempPath;
                curChecker.TopoTolerance = this.TopoTolerence;

                COMMONCONST.TOPOTOLORANCE = this.TopoTolerence;
                COMMONCONST.dAreaThread   = this.MapScale * 0.04;
                COMMONCONST.dLengthThread = this.MapScale * 0.2 / 10000;

                //SendCheckBeginEvent(curChecker);

                curChecker.Check();            // 检查

                // 获取结果
                string        strResultFullName = string.Format("{0}\\{1}", TempPath, "Result.mdb");
                IDbConnection resultConnection  = AdoDbHelper.GetDbConnection(strResultFullName);

                return(GetErrors(resultConnection));
            }
            catch
            {
                return(null);
            }
            finally
            {
                GC.Collect();

                //Clear();
            }
        }
Пример #26
0
        private string ConstructErrorInfo()
        {
            string strInfo;

            strInfo = "线长度小于域值" + COMMONCONST.dLengthThread + " ";
            string        strFields = "";
            StandardLayer distLayer = LayerReader.GetLayerByName(m_structLengthPara.strFtName, SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID));

            if (m_structLengthPara.fieldArray != null)
            {
                for (int i = 0; i < m_structLengthPara.fieldArray.Count; i++)
                {
                    strFields = strFields + "|" + FieldReader.GetAliasName(m_structLengthPara.fieldArray[i], distLayer.ID);
                }
                strFields = strFields.Remove(0, 1);
                strFields = strFields + " 字段都为空";
                strInfo   = strInfo + ",并且 " + strFields;
            }


            return(strInfo);
        }
Пример #27
0
        public override bool Check(ref List <Error> checkResult)
        {
            try
            {
                List <Error> m_pRuleResult = new List <Error>();

                List <string>         aryFtCode = new List <string>();
                Helper.StandardHelper StdHelp   = new Hy.Check.Rule.Helper.StandardHelper(SysDbHelper.GetSysDbConnection());
                StdHelp.GetLayerCodes(ref aryFtCode, m_psPara.strTargetLayer, standarID);


                if (aryFtCode == null) //如果编码类型为空
                {
                    string strSql = "select OBJECTID,BSM from " + strLayerName;

                    DataTable ipRecordset = new DataTable();
                    ipRecordset = Hy.Common.Utility.Data.AdoDbHelper.GetDataTable(this.m_QueryConnection, strSql);
                    if (ipRecordset == null)
                    {
                        return(false);
                    }

                    // 从DataTable中获取名称
                    foreach (DataRow dr in ipRecordset.Rows) // 遍历结果集
                    {
                        if (dr != null)
                        {
                            int nOID = Convert.ToInt32(dr["ObjectID"]);

                            // 添家结果记录
                            Error pResInfo = new Error();
                            pResInfo.DefectLevel = this.m_DefectLevel;
                            pResInfo.RuleID      = this.InstanceID;

                            pResInfo.OID       = nOID;
                            pResInfo.BSM       = dr["BSM"].ToString();
                            pResInfo.LayerName = m_psPara.strTargetLayer;                        // 目标图层

                            // 错误信息
                            string strMsg;
                            strMsg = string.Format("'{0}'层标识码为'{1}'的'{2}'字段对应的要素类型代码为空", pResInfo.LayerName, pResInfo.BSM, strCodeField);
                            if (m_psPara.strRemark != null && m_psPara.strRemark.Trim() != "")
                            {
                                pResInfo.Description = m_psPara.strRemark;
                            }
                            else
                            {
                                pResInfo.Description = strMsg;
                            }
                            m_pRuleResult.Add(pResInfo);

                            break;
                        }
                    }

                    checkResult = m_pRuleResult;

                    // 关闭记录集
                    ipRecordset.Dispose();
                }
                else
                {
                    try
                    {
                        string strSql;
                        string strFtCode = "";
                        for (int i = 0; i < aryFtCode.Count; i++)
                        {
                            string strTmp;
                            strTmp     = aryFtCode[i];
                            strFtCode += strTmp;
                        }

                        strSql = "select OBJECTID,BSM,YSDM from " + strLayerName + " where (" + strCodeField + " not in ('" +
                                 strFtCode.Substring(0, strFtCode.Length) + "')) or (" + strCodeField + " is null )";

                        DataTable ipRecordset = new DataTable();
                        ipRecordset = Hy.Common.Utility.Data.AdoDbHelper.GetDataTable(this.m_QueryConnection, strSql);
                        if (ipRecordset == null)
                        {
                            return(false);
                        }

                        // 从DataTable中获取名称
                        foreach (DataRow dr in ipRecordset.Rows) // 遍历结果集
                        {
                            if (dr != null)
                            {
                                int nOID = Convert.ToInt32(dr["ObjectID"]);

                                // 添家结果记录
                                Error pResInfo = new Error();
                                pResInfo.DefectLevel = this.m_DefectLevel;
                                pResInfo.RuleID      = this.InstanceID;

                                pResInfo.OID       = nOID;
                                pResInfo.BSM       = dr["BSM"].ToString();
                                pResInfo.LayerName = m_psPara.strTargetLayer;                        // 目标图层

                                // 错误信息
                                string strMsg;
                                strMsg = string.Format("'{0}'层标识码为'{1}'的'{2}({3})'字段的值'{4}'不正确。应为:{5}", pResInfo.LayerName, pResInfo.BSM, m_psPara.strCodeField, strCodeField, dr["YSDM"], strFtCode);
                                if (m_psPara.strRemark != null && !string.IsNullOrEmpty(m_psPara.strRemark.Trim()))
                                {
                                    pResInfo.Description = m_psPara.strRemark;
                                }
                                else
                                {
                                    pResInfo.Description = strMsg;
                                }
                                m_pRuleResult.Add(pResInfo);
                            }
                        }

                        checkResult = m_pRuleResult;

                        // 关闭记录集
                        ipRecordset.Dispose();
                    }
                    catch (Exception ex)
                    {
                        SendMessage(enumMessageType.Exception, ex.ToString());
                        return(false);
                    }
                }
            }
            catch (Exception ex)
            {
                SendMessage(enumMessageType.Exception, ex.ToString());
                return(false);
            }
            return(true);
        }
Пример #28
0
        public override bool Check(ref List <Error> checkResult)
        {
            try
            {
                string    strFeatAlias      = m_psPara.strFtName;
                string    strFieldCodeAlias = m_psPara.strCodeField;
                string    strLibName        = m_psPara.strCodeDataTable;
                string    strSQL;
                string    strFeat;
                DataTable dt;
                string    var = null;

                long nVersion = m_psPara.nVersionID;

                var = lyr.AttributeTableName;
                string pLayerName = var;
                strFeat = pLayerName;


                // 错误列表对象
                List <Error> pResult = new List <Error>();
                checkResult = pResult;

                // 1、进行第一次搜索,所以不满足条件的记录加入错误结果集
                if (strFieldName == "")
                {
                    strSQL = "select distinct " + strFieldCode + " from " + strFeat + "";
                }
                else
                {
                    strSQL = "select distinct " + strFieldCode + "," + strFieldName + " from " + strFeat + "";
                }

                dt = Hy.Common.Utility.Data.AdoDbHelper.GetDataTable(this.m_QueryConnection, strSQL);

                //strfieldcode 编码字段是否为字符类型;
                bool bIsStrType = false;

                if (dt != null)
                {
                    // 遍历唯一值
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (dr != null)
                        {
                            // 获取唯一值
                            string pCode = "";


                            DataRow dr1 = dr;

                            var   = dr1[0].ToString();
                            pCode = var;

                            if (string.IsNullOrEmpty(var))
                            {
                                if (strFieldName == "")
                                {
                                    strSQL = "select OBJECTID,BSM from " + strFeat + " where (" + strFieldCode +
                                             " is Null or " + strFieldCode + "='')";
                                }
                                else
                                {
                                    var = dr1[1].ToString();

                                    if (var != "") //如果var的类型为string型
                                    {
                                        string strName = var.ToString();

                                        strSQL = "select OBJECTID,BSM from " + strFeat + " where (" + strFieldCode +
                                                 " is null or " + strFieldCode + " ='' ) and " + strFieldName + " = '" +
                                                 strName + "'";
                                    }
                                    else if (var == null || var == "")
                                    {
                                        strSQL = "select OBJECTID,BSM from " + strFeat + " where (" + strFieldCode +
                                                 " is Null or " + strFieldCode + " ='' ) and (" +
                                                 strFieldName + " is null or " + strFieldName + " ='' )";
                                    }
                                }
                                DataTable pDt = Hy.Common.Utility.Data.AdoDbHelper.GetDataTable(this.m_QueryConnection, strSQL);

                                if (pDt != null)
                                {
                                    // 遍历记录集,返回错误
                                    foreach (DataRow datarow in pDt.Rows)
                                    {
                                        if (datarow != null)
                                        {
                                            // 获取OID
                                            //object varOID = datarow[0];

                                            // 生成错误结构
                                            Error pInfo = new Error();
                                            pInfo.DefectLevel = this.m_DefectLevel;
                                            pInfo.RuleID      = this.InstanceID;

                                            pInfo.OID       = Convert.ToInt32(datarow["OBJECTID"]);
                                            pInfo.BSM       = datarow["BSM"].ToString();
                                            pInfo.LayerName = strFeatAlias;

                                            //if (strFieldName == "")
                                            //{
                                            //    //pInfo.strErrInfo = "该图层的字段" + strFieldCodeAlias + "(" + strFieldCode +
                                            //    //                   ")值为空!";
                                            //    //pInfo.strErrInfo = string.Format(Helper.ErrMsgFormat.ERR_4201_1, strFeatAlias, pInfo.BSM, strFieldCodeAlias);
                                            pInfo.Description = string.Format("'{0}'层标识码为'{1}'的'{2}'字段的值不正确,不能为空", strFeatAlias, pInfo.BSM, strFieldCodeAlias);
                                            //}

                                            pResult.Add(pInfo);
                                        }
                                    }

                                    pDt.Dispose();
                                }
                            }
                            else
                            {
                                bIsStrType = true;

                                pCode = var;
                            }

                            string strName1 = "";
                            if (strFieldName == "")
                            {
                                strSQL = "select 编码 from " + strLibName + " where 规范号 = " + nVersion + " and 编码 = '" +
                                         pCode +
                                         "'";
                            }
                            else
                            {
                                DataRow dr3 = dr;

                                var = dr3[1].ToString();

                                string pName = var;
                                strName1 = pName;
                                strSQL   = "select 编码,名称 from " + strLibName + " where 规范号 = " + nVersion + " and 编码 = '" +
                                           pCode +
                                           "' and 名称='" + strName1 + "'";
                            }

                            // 在字典中查找这个唯一值, 如果找不到,那么字段属性为这个值的所有记录都必须找出来,返回其OID
                            DataTable ipRSCode = Hy.Common.Utility.Data.AdoDbHelper.GetDataTable(SysDbHelper.GetSysDbConnection(), strSQL);


                            if (ipRSCode == null || ipRSCode.Rows.Count == 0)
                            {
                                // 搜索字段属性为这个唯一值的所有记录
                                if (strFieldName == "")
                                {
                                    if (bIsStrType)
                                    {
                                        if (strFieldCodeType == "System.Int32" || strFieldCodeType == "System.Int64" ||
                                            strFieldCodeType == "System.Double")
                                        {
                                            strSQL = "select OBJECTID,BSM from " + strFeat + " where " + strFieldCode +
                                                     " = " +
                                                     pCode +
                                                     "";
                                        }
                                        else if (strFieldCodeType == "System.String" || strFieldCodeType == "System.Char")
                                        {
                                            strSQL = "select OBJECTID,BSM from " + strFeat + " where " +
                                                     strFieldCode + " = '" +
                                                     pCode +
                                                     "'";
                                        }
                                        else
                                        {
                                            strSQL = "select OBJECTID,BSM from " + strFeat + " where " +
                                                     strFieldCode + " = '" +
                                                     pCode +
                                                     "'";
                                        }
                                    }
                                    else
                                    {
                                        if (pCode.Length > 0)
                                        {
                                            strSQL = "select OBJECTID,BSM from " + strFeat + " where " + strFieldCode +
                                                     "= " +
                                                     pCode +
                                                     "";
                                        }
                                        else
                                        {
                                            strSQL = "select OBJECTID,BSM from " + strFeat + " where " + strFieldCode +
                                                     " is null ";
                                        }
                                    }
                                }
                                else
                                {
                                    if (bIsStrType)
                                    {
                                        strSQL = "select OBJECTID,BSM from " + strFeat + " where " + strFieldCode +
                                                 "= '" +
                                                 pCode +
                                                 "' and " +
                                                 strFieldName + " = '" + strName1 + "'";
                                    }
                                    else
                                    {
                                        if (pCode.Length > 0)
                                        {
                                            strSQL = "select OBJECTID,BSM from '" + strFeat + "' where '" + strFieldCode +
                                                     "'= " +
                                                     pCode +
                                                     "and '" +
                                                     strFieldName + "'='" + strName1 + "'";
                                        }
                                        else
                                        {
                                            strSQL = "select OBJECTID,BSM from " + strFeat + " where " + strFieldCode +
                                                     " is null and " +
                                                     strFieldName + " = '" + strName1 + "'";
                                        }
                                    }
                                }

                                DataTable pDt = Hy.Common.Utility.Data.AdoDbHelper.GetDataTable(this.m_QueryConnection, strSQL);

                                // 遍历记录集,返回错误
                                foreach (DataRow pDr in pDt.Rows)
                                {
                                    if (pDr != null)
                                    {
                                        if (pCode == "")
                                        {
                                            continue;
                                        }

                                        // 生成错误结构
                                        Error pInfo = new Error();
                                        pInfo.DefectLevel = this.m_DefectLevel;
                                        pInfo.RuleID      = this.InstanceID;
                                        pInfo.LayerName   = strFeatAlias;

                                        // 获取OID
                                        pInfo.OID = Convert.ToInt32(pDr["OBJECTID"]);

                                        pInfo.BSM = pDr["BSM"].ToString();


                                        if (strFieldName == "")
                                        {
                                            //pInfo.strErrInfo = "该图层的字段" + strFieldCodeAlias + "(" + strFieldCode + ")编码" +
                                            //                   pCode + "在标准库中不存在!";
                                            //pInfo.strErrInfo = string.Format(Helper.ErrMsgFormat.ERR_RuleCode_1_1, strFeatAlias,pInfo.BSM, strFieldCodeAlias, strFieldCode, pCode);
                                            pInfo.Description = string.Format("'{0}'层标识码为'{1}'的'{2}({3})'字段的值'{4}'在标准编码中不存在", strFeatAlias, pInfo.BSM, strFieldCodeAlias, strFieldCode, pCode);
                                        }
                                        else
                                        {
                                            pInfo.Description  = pCode;
                                            pInfo.Description += "|";
                                            pInfo.Description += strName1;
                                        }

                                        pResult.Add(pInfo);
                                    }
                                }
                                if (pDt != null)
                                {
                                    pDt.Dispose();
                                }
                            }
                        }
                    }
                    dt.Dispose();
                } // 遍历唯一值结束


                // 如果只进行编码的检查,那不需要进行第二步了
                if (strFieldName == "")
                {
                    return(true);
                }

                int nCount = pResult.Count;

                // 2、进行第二次搜索,将代码存在的设置成不匹配,代码不存在的设置成代码不存在
                for (int i = 0; i < nCount; i++)
                {
                    Error pInfo = pResult[i];


                    string[] strArray = pInfo.Description.Split('|');

                    string strCode = "";
                    string strName = "";
                    if (strArray.Length == 2)
                    {
                        strCode = strArray[0];
                        strName = strArray[1];
                    }

                    strSQL = "select 编码 from " + strLibName + " where 规范号 = " + nVersion + " and 编码 = '" + strCode + "'";

                    // 在字典中查找这编码,找到说明错误类型是代码和名称不匹配,反之是代码不存在
                    DataTable ipRSCode = Hy.Common.Utility.Data.AdoDbHelper.GetDataTable(SysDbHelper.GetSysDbConnection(), strSQL);

                    if (ipRSCode != null && ipRSCode.Rows.Count != 0)
                    {
                        //pInfo.strErrInfo = strFieldCodeAlias + "'" + strCode + "'和" + m_psPara.strNameField + "'" + strAliasName +
                        //                   "'不匹配!";
                        //pInfo.strErrInfo = string.Format(Helper.ErrMsgFormat.ERR_RuleCode_2, strFeatAlias, pInfo.BSM, strFieldCodeAlias, strCode, m_psPara.strNameField, strAliasName);
                        pInfo.Description = string.Format("'{0}'层标识码为'{1}'的'{2}'的值'{3}'与'{4}'的值'{5}'不匹配", strFeatAlias, pInfo.BSM, strFieldCodeAlias, strCode, m_psPara.strNameField, strName);
                    }
                    else
                    {
                        //pInfo.strErrInfo = strFieldCodeAlias + "'" + strCode + "'在标准库中不存在!";
                        //pInfo.strErrInfo = string.Format(Helper.ErrMsgFormat.ERR_RuleCode_1_2, strFeatAlias,pInfo.BSM ,strFieldCodeAlias, strCode);
                        pInfo.Description = string.Format("'{0}'层标识码为'{1}'的'{2}({3})'字段的值'{4}'在标准编码中不存在", strFeatAlias, pInfo.BSM, strFieldCodeAlias, strFieldCode, strCode);
                    }
                    if (pInfo.Description == null)
                    {
                        pInfo.Description = "";
                    }
                }
            }
            catch (Exception ex)
            {
                SendMessage(enumMessageType.Exception, ex.ToString());
                return(false);
            }
            return(true);
        }
Пример #29
0
        private string ConstructErrorInfo()
        {
            string        strInfo   = "";
            string        strFields = "";
            StandardLayer distLayer = LayerReader.GetLayerByName(m_structBlankPara.strFtName, SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID));

            if (m_structBlankPara.fieldArray.Count > 0)
            {
                for (int i = 1; i < m_structBlankPara.fieldArray.Count; i++)
                {
                    strFields = strFields + "|" + FieldReader.GetAliasName(m_structBlankPara.fieldArray[i], distLayer.ID);
                }
                strFields = strFields.Remove(0, 1);
            }
            if (m_structBlankPara.iType == 0)
            {
                strInfo = "字段 " + strFields + " 都为空";
            }
            else if (m_structBlankPara.iType == 1)
            {
                strInfo = "字段 " + strFields + " 中有一个或多个为空";
            }
            return(strInfo);
        }
Пример #30
0
        /// <summary>
        /// 获取系统库中所有记录
        /// </summary>
        /// <returns></returns>
        public static DataTable GetAllTaskRecord()
        {
            IDbConnection sysConnection = SysDbHelper.GetSysDbConnection();

            return(AdoDbHelper.GetDataTable(sysConnection, "select * from LR_ModelTask where BIsTemplate=0"));
        }