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


C# Epi.ExecuteReader方法代码示例

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


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

示例1: UnMarkRelatedRecoredsAsDeleted

        private void UnMarkRelatedRecoredsAsDeleted(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(" Where FKey In (");
            foreach (int ID in pIDList)
            {
                pView.LoadRecord(ID);
                pView.RecStatusField.CurrentRecordValue = 1;
                pView.SaveRecord(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 + "] " + 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);
                        UnMarkRelatedRecoredsAsDeleted(OutputDriver, rvf.ChildView, NewIdList);
                    }
                }
            }
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:41,代码来源:Rule_Delete.cs

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