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


C# Epi.ExecuteNonQuery方法代码示例

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


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

示例1: CascadePermanentDelete

        private void CascadePermanentDelete(Epi.Data.Services.CollectedDataProvider OutputDriver, View pView, List<int> pIDList)
        {
            Dictionary<string, bool> VisitedViews = new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase);
            string SQL = null;
            StringBuilder InSQL = new StringBuilder();
            InSQL.Append(" (");
            foreach (int ID in pIDList)
            {
                pView.LoadRecord(ID);
                InSQL.Append("'");
                InSQL.Append(pView.CurrentGlobalRecordId);
                InSQL.Append("',");
            }
            InSQL.Length = InSQL.Length - 1;
            InSQL.Append(")");

            foreach (Epi.Fields.Field field in pView.Fields)
            {
                if (field is Epi.Fields.RelatedViewField)
                {
                    Epi.Fields.RelatedViewField rvf = field as Epi.Fields.RelatedViewField;
                    if (!VisitedViews.ContainsKey(rvf.ChildView.Name))
                    {
                        SQL = "Select UniqueKey From [" + rvf.ChildView.TableName + "] Where FKey In " + InSQL.ToString();
                        IDataReader reader = OutputDriver.ExecuteReader(OutputDriver.CreateQuery(SQL));
                        List<int> NewIdList = new List<int>();
                        while (reader.Read())
                        {
                            if (reader["UniqueKey"] != DBNull.Value)
                            {
                                NewIdList.Add((int)reader["UniqueKey"]);
                            }
                        }
                        VisitedViews.Add(rvf.ChildView.Name, true);
                        CascadePermanentDelete(OutputDriver, rvf.ChildView, NewIdList);
                    }
                }
                else if(field is Epi.Fields.GridField)
                {

                    Epi.Fields.GridField gf = field as Epi.Fields.GridField;

                    SQL = "Delete from  [" + gf.TableName + "]  Where FKey In " + InSQL.ToString();
                    OutputDriver.ExecuteNonQuery(OutputDriver.CreateQuery(SQL));

                }
            }

            foreach (Epi.Page page in pView.Pages)
            {
                SQL = "Delete from  [" + page.TableName + "]  Where GlobalRecordId In " + InSQL.ToString();
                OutputDriver.ExecuteNonQuery(OutputDriver.CreateQuery(SQL));
            }

            SQL = "Delete from  [" + pView.TableName + "]  Where GlobalRecordId In " + InSQL.ToString();
            OutputDriver.ExecuteNonQuery(OutputDriver.CreateQuery(SQL));
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:57,代码来源:Rule_Delete.cs


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