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


C# SafeDataReader.NextResult方法代码示例

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


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

示例1: ReadRequiredRuleConfigFields

        /// <summary>
        /// Reads required rule config fields.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        /// ProcessCommandSecurityConfigurations
        private static void ReadRequiredRuleConfigFields(ProcessEditDto process, SafeDataReader sr)
        {
            sr.NextResult();

            int? requiredConfigId = null;
            RequiredRuleConfigEditDto config = null;

            while (sr.Read())
            {
                var configFieldDto = new RequiredRuleConfigFieldEditDto
                {
                    Id = sr.GetInt32(0),
                    RequiredConfigId = sr.GetInt32(1),
                    Guid = sr.GetGuid(2),
                    FieldGuid = sr.GetGuid(3),
                    IsRequired = sr.GetBoolean(4)
                };

                if (configFieldDto.RequiredConfigId != requiredConfigId)
                {
                    config = process.RequiredRuleConfigs.First(rrc => rrc.Id == configFieldDto.RequiredConfigId);
                    requiredConfigId = configFieldDto.RequiredConfigId;
                }

                config.FieldList.Add(configFieldDto);
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:33,代码来源:ProcessDAL2.cs

示例2: FetchChildren

 private void FetchChildren(SafeDataReader dr)
 {
     dr.NextResult();
     while (dr.Read())
     {
         _voucherList.Add(FetchVoucherEdit(dr));
     }
 }
开发者ID:FrankMedvedik,项目名称:coopcheck,代码行数:8,代码来源:BatchEditDal.designer.cs

示例3: ExecuteSP

        /// <summary>
        /// Executes the SP.
        /// </summary>
        /// <returns>spResult object</returns>
        public spResult ExecuteSP(int accountID)
        {
            var myData = new DalManager();
             var myResult = new spR_Get_Account_Info_by_AccountID_Result();
             if (myData.GetConnection(out _mySQLConn)) return null;
             try
             {
                 using (var myAccessCommand = new SqlCommand(_storedProcedureName, _mySQLConn))
                 {
                     myAccessCommand.CommandType = System.Data.CommandType.StoredProcedure;
                     myAccessCommand.Parameters.AddWithValue("@AccountID", accountID);

                     _mySQLConn.Open();
                     using (var dr = new SafeDataReader(myAccessCommand.ExecuteReader()))
                     {
                         var rdrResult = Mapper.Map<List<RenterAccountDTO>>(dr);
                         _myDTO = rdrResult.FirstOrDefault();
                         myResult.RowsReturned = rdrResult.Count;
                        // Get the next resultset (Cards) from the DataReader
                        dr.NextResult();
                        LoadRenterData(dr);
                        dr.NextResult();
                        LoadAddresses(dr);
                        dr.NextResult();
                        LoadContactInfoItems(dr);

                        myResult.ResultSet = _myDTO;
                     }
                    }
                return myResult;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Error: Failed to act on the data in the DataBase.\n{0}", ex.Message);
                myResult.ErrorMessage = CreateUIMessage(ex.Message);
                return myResult;
            }
            finally
            {
                _mySQLConn.Close();
            }
        }
开发者ID:gcwolfe007,项目名称:mmMVC_soln,代码行数:46,代码来源:SP_Get_Account_Info_by_AccountID.cs

示例4: ReadSearchDisplayFields

        /// <summary>
        /// Reads search display fields.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        private static void ReadSearchDisplayFields(ProcessEditDto process, SafeDataReader sr)
        {
            sr.NextResult();

            while (sr.Read())
            {
                process.Search.Add(
                    new ProcessSearchEditDto
                    {
                        Id = sr.GetInt32(0),
                        ProcessId = sr.GetInt32(1),
                        GuidId = sr.GetGuid(2),
                        FieldSystemName = sr.GetString(3),
                        Position = sr.GetInt32(4),
                        Width = sr.GetInt32(5),
                        ShowInList = sr.GetBoolean(6)
                    });
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:24,代码来源:ProcessDAL2.cs

示例5: ReadProcessSecurityConfigurations

        /// <summary>
        /// Reads process security configurations.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        private static void ReadProcessSecurityConfigurations(ProcessEditDto process, SafeDataReader sr)
        {
            sr.NextResult();

            while (sr.Read())
            {
                var securityConfigurationDto = new ProcessSecurityConfigurationDto
                {
                    Id = sr.GetInt32(0),
                    CanCreate = sr.GetBoolean(1),
                    CanDelete = sr.GetBoolean(2),
                    ProcessId = sr.GetInt32(3),
                    RoleId = sr.GetInt32(4),
                    BusinessUnitId = sr.GetInt32(5),
                };

                process.SecurityConfigurations.Add(securityConfigurationDto);
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:24,代码来源:ProcessDAL2.cs

示例6: ReadSecurityConfigSystemFields

        /// <summary>
        /// The read security config system fields.
        /// </summary>
        /// <param name="sr">The reader.</param>
        /// <param name="process">The process.</param>
        private static void ReadSecurityConfigSystemFields(SafeDataReader sr, ProcessEditDto process)
        {
            sr.NextResult();
            while (sr.Read())
            {
                var systemFieldSecurityConfig = new ProcessSystemFieldSecurityConfigEditDto
                {
                    Id = sr.GetInt(0),
                    SecurityConfigId = sr.GetInt(1),
                    Guid = sr.GetGuid(2),
                    FieldSystemName = sr.GetString(3),
                    CanView = sr.GetBoolean(4),
                    CanEdit = sr.GetBoolean(5)
                };

                var config = process.SecurityConfigs.FirstOrDefault(sc => sc.Id == systemFieldSecurityConfig.SecurityConfigId);

                if (config != null)
                {
                    config.SecurityConfigSystemFields.Add(systemFieldSecurityConfig);
                }
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:28,代码来源:ProcessDAL2.cs

示例7: BindAttackData

        private void BindAttackData()
        {
            using (SqlConnection cn = new SqlConnection( Database.AphelionTriggerConnection ))
            {
                cn.Open();
                using (SqlCommand cm = cn.CreateCommand())
                {
                    cm.CommandText = "GetAttackData";
                    cm.CommandType = CommandType.StoredProcedure;
                    cm.Parameters.AddWithValue( "@AttackerHouseID", _attackerHouseId );
                    cm.Parameters.AddWithValue( "@DefenderHouseID", _defenderHouseId );

                    using (SafeDataReader dr = new SafeDataReader( cm.ExecuteReader() ))
                    {
                        while (dr.Read())
                        {
                            _attackerHouse = new House(
                                dr.GetInt32( "ID" ),
                                dr.GetInt32( "UserID" ),
                                dr.GetInt32( "FactionID" ),
                                dr.GetString( "Faction" ),
                                dr.GetString( "FactionDisplay" ),
                                dr.GetString( "Name" ),
                                dr.GetInt32( "Intelligence" ),
                                dr.GetInt32( "Power" ),
                                dr.GetInt32( "Protection" ),
                                dr.GetInt32( "Affluence" ),
                                dr.GetInt32( "Speed" ),
                                dr.GetInt32( "Contingency" ),
                                dr.GetInt32( "LevelID" ),
                                (double)dr.GetDecimal( "Ambition" ),
                                dr.GetInt32( "Turns" ),
                                dr.GetInt32( "Credits" ),
                                dr.GetInt32( "MilitiaCount" ),
                                dr.GetInt32( "MilitaryCount" ),
                                dr.GetInt32( "MercenaryCount" ),
                                dr.GetInt32( "AgentCount" ),
                                dr.GetInt32( "Rank" ),
                                dr.GetInt32( "LastRank" ),
                                dr.GetInt32( "Points" ),
                                dr.GetInt32( "Experience" ),
                                dr.GetInt32( "Attack" ),
                                dr.GetInt32( "Defense" ),
                                dr.GetInt32( "Capture" ),
                                dr.GetInt32( "Plunder" ),
                                dr.GetInt32( "Stun" ),
                                dr.GetInt32( "GuildID" ),
                                dr.GetString( "Guild" ),
                                dr.GetString( "SmallFactionIconPath" ),
                                dr.GetInt32( "VotedFactionLeaderHouseID" ),
                                dr.GetInt32( "FactionLeaderHouseID" ),
                                dr.GetInt32( "FactionVotingPower" ) );
                        }

                        if (dr.NextResult())
                        {
                            while (dr.Read())
                            {
                                if (dr.GetInt32( "Count" ) > 0)
                                {
                                    _attackerForces.Add( new Unit(
                                        dr.GetInt32( "ID" ),
                                        dr.GetInt32( "FactionID" ),
                                        dr.GetInt32( "UnitClassID" ),
                                        dr.GetString( "Name" ),
                                        dr.GetString( "Description" ),
                                        dr.GetString( "Faction" ),
                                        dr.GetString( "UnitClass" ),
                                        dr.GetInt32( "Cost" ),
                                        dr.GetInt32( "Attack" ),
                                        dr.GetInt32( "Defense" ),
                                        dr.GetInt32( "Plunder" ),
                                        dr.GetInt32( "Capture" ),
                                        dr.GetInt32( "Stun" ),
                                        dr.GetInt32( "Experience" ),
                                        dr.GetDecimal( "RepopulationRate" ),
                                        dr.GetDecimal( "DepopulationRate" ),
                                        dr.GetInt32( "Count" ),
                                        dr.GetInt32( "AttackTech" ),
                                        dr.GetInt32( "DefenseTech" ),
                                        dr.GetInt32( "CaptureTech" ),
                                        dr.GetInt32( "PlunderTech" ),
                                        dr.GetInt32( "StunTech" ),
                                        dr.GetInt32( "ExperienceTech" ),
                                        dr.GetDecimal( "RepopulationRateTech" ),
                                        dr.GetDecimal( "DepopulationRateTech" ) ) );
                                }
                            }
                        }
                        else
                        {
                            throw new DataPortalException( "Attacker House has no forces to attack with.", this );
                        }

                        if (dr.NextResult())
                        {
                            while (dr.Read())
                            {
                                _attackerTechnologies.Add( new Technology(
                                    dr.GetInt32( "ID" ),
//.........这里部分代码省略.........
开发者ID:TertiumQuid,项目名称:Aphelion-Trigger,代码行数:101,代码来源:AttackCommand.cs

示例8: FetchCrossRefFields


//.........这里部分代码省略.........
     , f.[SystemName]
     , f.[Id]
     , x.[AllowMultiple]
     , x.[DisplayFieldName]
     , p.[SystemName]
     , p.[Id]
FROM [dbo].[Sections] s
INNER JOIN [dbo].[Fields] f ON s.[Id] = f.[SectionId]
INNER JOIN [dbo].[CrossRefRequredFieldStep] x ON f.[Id] = x.[FieldId]
INNER JOIN [dbo].[PublishedProcesses] [pp] ON [pp].[Id] = x.CrossRefProcessId
INNER JOIN [dbo].[Processes] [p] ON [p].[Id] = pp.ProcessId
WHERE s.[ProcessId] = @processId";
                }
            }
            else
            {
                cmdText = @"
DECLARE @pp_id INT
SELECT @pp_id = pp.[Id] FROM [dbo].[PublishedProcesses] pp WHERE pp.[ProcessGuid] = @crossRefProcessGuid

SELECT f.[Name]
     , f.[SystemName]
     , f.[Id]
     , x.[AllowMultiple]
     , x.[DisplayFieldName]
     , p.[SystemName]
     , p.[Id]
FROM [dbo].[Sections] s
INNER JOIN [dbo].[Fields] f ON s.[Id] = f.[SectionId]
INNER JOIN [dbo].[CrossRefRequredFieldStep] x ON f.[Id] = x.[FieldId]
INNER JOIN [dbo].[PublishedProcesses] [pp] ON [pp].[Id] = x.CrossRefProcessId
INNER JOIN [dbo].[Processes] [p] ON [p].[Id] = pp.ProcessId
WHERE s.[ProcessId] = @processId AND x.[CrossRefProcessId] = @pp_id

DECLARE @pp_systemName NVARCHAR(200)
SELECT @pp_systemName = p.[SystemName] FROM [dbo].[Processes] p WHERE p.[Guid] = @crossRefProcessGuid

SELECT f.[Name]
     , f.[SystemName]
     , f.[Id]
     , p.[SystemName]
     , p.[Id]
FROM [dbo].[Sections] s
INNER JOIN [dbo].[Fields] f ON s.[Id] = f.[SectionId]
INNER JOIN [dbo].[stepChecklist] x ON f.[Id] = x.[FieldId]
INNER JOIN [dbo].[Processes] p ON p.[IsRemoved] = 0 AND p.[IsPublishedCopy] = 1 AND p.[SystemName] = x.[AnswerProcessSystemName]
WHERE s.[ProcessId] = @processId AND x.[AnswerProcessSystemName] = @pp_SystemName";
            }

            cmdText += @"

";

            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.VeyronMeta, false))
            {
                var cn = ctx.Connection;

                using (var cmd = new SqlCommand(cmdText, cn))
                {
                    cmd.Parameters.AddWithValue("@processId", processId);
                    cmd.Parameters.AddWithValue("@crossRefProcessGuid", crossRefProcessGuid);

                    using (var reader = new SafeDataReader(cmd.ExecuteReader()))
                    {
                        while (reader.Read())
                        {
                            result.Add(new CrossRefFieldDto
                                           {
                                               Name = reader.GetString(0),
                                               SystemName = reader.GetString(1),
                                               FieldId = reader.GetInt(2),
                                               AllowMany = reader.GetBoolean(3),
                                               DisplayField = reader.GetString(4),
                                               ProcessSystemName = reader.GetString(5),
                                               ProcessId = reader.GetInt(6),
                                               ColumnType = reader.GetBoolean(3) ? ColumnTypes.MultiReference : ColumnTypes.Reference
                                           });
                        }

                        if (reader.NextResult())
                        {
                            while (reader.Read())
                            {
                                result.Add(new CrossRefFieldDto
                                               {
                                                   Name = reader.GetString(0),
                                                   SystemName = reader.GetString(1),
                                                   FieldId = reader.GetInt32(2),
                                                   ProcessSystemName = reader.GetString(3),
                                                   ProcessId = reader.GetInt32(4),
                                                   ColumnType = ColumnTypes.Checklist
                                               });
                            }
                        }
                    }
                }
            }

            return result;
        }
开发者ID:mparsin,项目名称:Elements,代码行数:101,代码来源:ProcessDAL.cs

示例9: FetchReverseCrossRefList

        /// <summary>
        /// Fetches reverse cross ref list.
        /// </summary>
        /// <param name="processGuid">The process GUID.</param>
        /// <returns>The <see cref="IList" />.</returns>
        public IList<PublishedProcessInfoDTO> FetchReverseCrossRefList(Guid processGuid)
        {
            var result = new List<PublishedProcessInfoDTO>();
            const string CmdText =
                @"
-- Select processes with cross reference fields
DECLARE @pp_id INT
SELECT @pp_id = pp.[Id] FROM [dbo].[PublishedProcesses] pp WHERE pp.[ProcessGuid] = @processGuid

SELECT pp.[Id]
      ,p.[Name]
      ,p.[SystemName]
      ,p.[Id]
      ,p.[IsStateEnabled]
      ,p.[ProcessOption]
FROM [dbo].[PublishedProcesses] pp
INNER JOIN [dbo].[Processes] p ON p.[Id] = pp.[ProcessId]
INNER JOIN (SELECT DISTINCT s.[ProcessId] AS [Id]
FROM [dbo].[Sections] s
INNER JOIN [dbo].[Fields] f on f.[SectionId] = s.[Id]
INNER JOIN [dbo].[CrossRefRequredFieldStep] x on x.[FieldId] = f.[Id]
WHERE x.[CrossRefProcessId] = @pp_id) pu ON p.[Id] = pu.[Id]
WHERE pp.Id <> @pp_id

-- Select processes with checklist fields
DECLARE @pp_systemName AS NVARCHAR(200)
SELECT @pp_systemName = p.[SystemName] FROM [dbo].[Processes] p WHERE p.[Guid] = @processGuid AND p.[IsPublishedCopy] = 1 AND p.[IsRemoved] = 0

SELECT pp.[Id]
    ,p.[Name]
    ,p.[SystemName]
    ,p.[Id]
    ,p.[IsStateEnabled]
    ,p.[ProcessOption]
FROM [dbo].[PublishedProcesses] pp
INNER JOIN [dbo].[Processes] p ON p.[Id] = pp.[ProcessId]
INNER JOIN (SELECT DISTINCT s.[ProcessId] AS [Id]
FROM [dbo].[Sections] s
INNER JOIN [dbo].[Fields] f on f.[SectionId] = s.[Id]
INNER JOIN [dbo].[stepChecklist] x on x.[FieldId] = f.[Id]
WHERE x.[AnswerProcessSystemName] = @pp_systemName) pu ON p.[Id] = pu.[Id]
WHERE pp.Id <> @pp_id";

            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.VeyronMeta, false))
            {
                var cn = ctx.Connection;

                using (var cmd = new SqlCommand(CmdText, cn))
                {
                    cmd.Parameters.AddWithValue("@processGuid", processGuid);

                    using (var reader = new SafeDataReader(cmd.ExecuteReader()))
                    {
                        do
                        {
                            while (reader.Read())
                            {
                                var dto = new PublishedProcessInfoDTO
                                              {
                                                  Id = reader.GetInt(0),
                                                  Name = reader.GetString(1),
                                                  SystemName = reader.GetString(2),
                                                  ProcessId = reader.GetInt(3),
                                                  IsStateEnabled = reader.GetBool(4),
                                                  ProcessOption = reader.GetEnum(5, ProcessOption.None)
                                              };

                                if (result.All(x => x.Id != dto.Id))
                                {
                                    result.Add(dto);
                                }
                            }
                        }
                        while (reader.NextResult());
                    }
                }
            }

            return result;
        }
开发者ID:mparsin,项目名称:Elements,代码行数:85,代码来源:ProcessDAL.cs

示例10: ReadRequiredRuleConfigs

        /// <summary>
        /// Reads required rule configurations.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        private static void ReadRequiredRuleConfigs(ProcessEditDto process, SafeDataReader sr)
        {
            sr.NextResult();

            while (sr.Read())
            {
                var configDto = new RequiredRuleConfigEditDto
                {
                    Id = sr.GetInt32(0),
                    ProcessId = sr.GetInt32(1),
                    Guid = sr.GetGuid(2),
                    StateGuid = sr.GetGuid(3)
                };

                process.RequiredRuleConfigs.Add(configDto);
            }

            ReadRequiredRuleConfigFields(process, sr);
        }
开发者ID:mparsin,项目名称:Elements,代码行数:24,代码来源:ProcessDAL2.cs

示例11: ReadCommandSecurityConfiguration

        /// <summary>
        /// Reads command security configuration.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        private static void ReadCommandSecurityConfiguration(ProcessEditDto process, SafeDataReader sr)
        {
            int? commandId = null;
            ProcessCommandEditDto commandDto = null;
            sr.NextResult();
            while (sr.Read())
            {
                var securityConfiguration = new ProcessCommandSecurityConfigurationDto
                {
                    Id = sr.GetInt32(0),
                    ProcessCommandId = sr.GetInt32(1),
                    CommandId = sr.GetInt32(1),
                    RoleId = sr.GetInt32(2),
                    BusinessUnitId = sr.GetInt32(3),
                    StateGuid = sr.GetString(4),
                    PersonFieldName = sr.GetString(5)
                };

                if (commandId != securityConfiguration.CommandId)
                {
                    commandId = securityConfiguration.CommandId;
                    commandDto = process.Commands.First(c => c.Id == commandId);
                }

                commandDto.SecurityConfigurationList.Add(securityConfiguration);
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:32,代码来源:ProcessDAL2.cs

示例12: ReadFilters

        /// <summary>
        /// Reads filters.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        private static void ReadFilters(ProcessEditDto process, SafeDataReader sr)
        {
            sr.NextResult();

            while (sr.Read())
            {
                process.Filters.Add(
                       new ProcessFilterEditDto
                       {
                           Id = sr.GetInt32(0),
                           ProcessId = sr.GetInt32(1),
                           LastModifiedOn = sr.GetDateTime(2),
                           GuidId = sr.GetString(3),
                           Name = sr.GetString(4),
                           Documentation = sr.GetString(5),
                           FilterDefinition = sr.GetString(6),
                           RoleIds = sr.GetString(7)
                       });
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:25,代码来源:ProcessDAL2.cs

示例13: ReadConnectorsSecurityConfigurations

        /// <summary>
        /// Reads connectors security configurations.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        private static void ReadConnectorsSecurityConfigurations(ProcessEditDto process, SafeDataReader sr)
        {
            sr.NextResult();
            var connectorInId = Guid.Empty;
            var connectorOutId = Guid.Empty;
            ConnectorDTO connector = null;

            while (sr.Read())
            {
                var securityDto = new StateConnectorSecurityConfigurationEditDto
                {
                    Id = sr.GetInt(0),
                    CanMove = sr.GetBoolean(1),
                    RoleId = sr.GetInt(2),
                    BusinessUnitId = sr.GetInt(3),
                    PersonFieldName = sr.GetString(4),
                    StateInGuid = sr.GetGuid(5),
                    StateOutGuid = sr.GetGuid(6)
                };

                if (connectorInId != securityDto.StateInGuid || connectorOutId != securityDto.StateOutGuid)
                {
                    connectorInId = securityDto.StateInGuid;
                    connectorOutId = securityDto.StateOutGuid;
                    connector = process.States.SelectMany(s => s.Connectors).FirstOrDefault(c => c.ConnectsToStateGuid == connectorInId && c.ConnectsFromStateGuid == connectorOutId);

                    if (connector == null)
                    {
                        continue;
                    }
                }

                if (connector != null)
                {
                    connector.SecurityConfigurations.Add(securityDto);
                }
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:43,代码来源:ProcessDAL2.cs

示例14: ReadLayouts

        /// <summary>
        /// Reads the layouts.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        private static void ReadLayouts(ProcessEditDto process, SafeDataReader sr)
        {
            sr.NextResult();

            while (sr.Read())
            {
                process.Layouts.Add(
                    new ProcessLayoutDto
                    {
                        Id = sr.GetInt32(0),
                        Name = sr.GetString(1),
                        GuidId = sr.GetGuid(2),
                        LayoutDefinition = sr.GetString(3),
                        ProcessId = process.Id,
                        IsDefault = sr.GetBoolean(4)
                    });
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:23,代码来源:ProcessDAL2.cs

示例15: ReadFieldBackcolorRules

        /// <summary>
        /// Reads field backcolor rules.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        private static void ReadFieldBackcolorRules(ProcessEditDto process, SafeDataReader sr)
        {
            int? ruleId = null;
            ProcessActionRuleEditDto rule = null;

            sr.NextResult();

            while (sr.Read())
            {
                var dto = new FieldBackcolorRuleEditDto
                {
                    RuleId = sr.GetInt32(0),
                    RuleGuid = sr.GetGuid(1),
                    FieldGuid = sr.GetGuid(2),
                    BackColor = sr.GetInt64(3),
                    FieldSystemName = sr.GetString(4),
                    FieldName = sr.GetString(5)
                };

                if (dto.RuleId != ruleId)
                {
                    rule = process.ActionRules.First(r => r.Id == dto.RuleId);
                    ruleId = rule.Id;
                }

                rule.FieldBackcolorRules.Add(dto);
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:33,代码来源:ProcessDAL2.cs


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