当前位置: 首页>>代码示例>>C#>>正文


C# DataDictionary.findSubSequence方法代码示例

本文整理汇总了C#中DataDictionary.findSubSequence方法的典型用法代码示例。如果您正苦于以下问题:C# DataDictionary.findSubSequence方法的具体用法?C# DataDictionary.findSubSequence怎么用?C# DataDictionary.findSubSequence使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataDictionary的用法示例。


在下文中一共展示了DataDictionary.findSubSequence方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: importSubSequence

        /// <summary>
        /// Imports the subsequence stored in the database
        /// </summary>
        /// <param name="frame"></param>
        private void importSubSequence(DataDictionary.Tests.Frame frame)
        {
            string sql = "SELECT TestSequenceID, TestSequenceName FROM TSW_TestSequence";

            OleDbDataAdapter adapter = new OleDbDataAdapter(sql, Connection);
            DataSet dataSet = new DataSet();

            adapter.Fill(dataSet);

            if (dataSet.Tables.Count > 0)
            {
                foreach (DataRow dataRow in dataSet.Tables[0].Rows)
                {
                    int subSequenceID = (int)dataRow.ItemArray.GetValue(0);
                    string subSequenceName = (string)dataRow.ItemArray.GetValue(1);

                    DataDictionary.Tests.SubSequence newSubSequence = (DataDictionary.Tests.SubSequence)DataDictionary.Generated.acceptor.getFactory().createSubSequence();
                    newSubSequence.Name = subSequenceName;
                    importInitialValues(newSubSequence, subSequenceID);
                    importSteps(newSubSequence);

                    DataDictionary.Tests.SubSequence oldSubSequence = frame.findSubSequence(subSequenceName);
                    if (oldSubSequence != null)
                    {
                        int cnt = 0;
                        foreach (DataDictionary.Tests.TestCase oldTestCase in oldSubSequence.TestCases)
                        {
                            if (cnt < newSubSequence.TestCases.Count)
                            {
                                DataDictionary.Tests.TestCase newTestCase = newSubSequence.TestCases[cnt] as DataDictionary.Tests.TestCase;
                                if (newTestCase != null)
                                {
                                    if (oldTestCase.Name.Equals(newTestCase.Name))
                                    {
                                        newTestCase.Merge(oldTestCase);
                                    }
                                    else
                                    {
                                        throw new Exception(newTestCase.FullName + " is found instead of " + oldTestCase.FullName + " while importing sub-sequence " + newSubSequence.FullName);
                                    }
                                }
                            }
                            else
                            {
                                throw new Exception("The test case " + oldTestCase.FullName + " is not present in the new data base");
                            }
                            cnt++;
                        }

                        oldSubSequence.Delete();
                    }

                    frame.appendSubSequences(newSubSequence);
                }
            }
            else
            {
                Log.Error("Cannot find table TSW_TestSequence in database");
            }
        }
开发者ID:Assmann-Siemens,项目名称:ERTMSFormalSpecs,代码行数:64,代码来源:TestImporter.cs


注:本文中的DataDictionary.findSubSequence方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。