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


C# SafeDataReader.GetInt方法代码示例

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


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

示例1: FetchDataVariableList

        private static void FetchDataVariableList(SqlConnection connection, EDCEditDto dto)
        {
            const string Sql =
               @"
SELECT
     [Id]
    ,[GuidId]   
    ,[EDCId]
    ,[VariableName]
    ,[VariableSystemName]
    ,[VariableDataType] 
FROM
    [dbo].[EDCDataVariables]
WHERE [EDCId] = @edcId;
";
            using (var cmd = new SqlCommand(Sql, connection))
            {
                cmd.Parameters.AddWithValue("@edcId", dto.Id);

                try
                {
                    using (var reader = new SafeDataReader(cmd.ExecuteReader()))
                    {
                        while (reader.Read())
                        {
                            var dataVariableType = DataVariablesType.None;
                            var type = reader.GetString(5);

                            if (!string.IsNullOrWhiteSpace(type))
                            {
                                if (type == "Double")
                                {
                                    dataVariableType = DataVariablesType.Decimal;
                                }
                                else
                                {
                                    dataVariableType = !string.IsNullOrEmpty(reader.GetString(5))
                                        ? (DataVariablesType)Enum.Parse(typeof(DataVariablesType), reader.GetString(5))
                                        : DataVariablesType.None;
                                }
                            }

                            var edcDataVariablesEditDto = new EDCDataVariablesEditDto
                            {
                                Id = reader.GetInt(0),
                                Guid = reader.GetGuid(1),
                                EDCId = reader.GetInt32(2),
                                VariableName = reader.GetString(3),
                                VariableSystemName = reader.GetString(4),
                                VariableDataType = dataVariableType
                            };

                            dto.DataVariableList.Add(edcDataVariablesEditDto);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw new ArgumentException(ex.Data.ToString());
                }
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:62,代码来源:EDCDal.cs

示例2: ReadApprovalActionOptions

        /// <summary>
        /// Reads approval action options.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="reader">The reader.</param>
        private static void ReadApprovalActionOptions(ProcessEditDto process, SafeDataReader reader)
        {
            reader.NextResult();
            while (reader.Read())
            {
                var guid = reader.GetGuid(1);

                var actionDto = new ProcessActionEditDto(ReadRuleGuids(reader.GetInt(0)))
                                    {
                                        Id = reader.GetInt(0),
                                        Guid = guid,
                                        Name = reader.GetString(2),
                                        Documentation = reader.GetString(3),
                                        Subject = reader.GetString(4),
                                        Message = reader.GetString(5),
                                        ActionType = (ActionTypes)Enum.Parse(typeof(ActionTypes), reader.GetString(6)),
                                        GroupName = reader.GetString(7)
                                    };

                actionDto.ApprovalOptions = new ApprovalActionOptionsEditDto
                                                {
                                                    ActionId = actionDto.Id,
                                                    ApprovalFieldName = reader.GetString(9),
                                                    EmailFieldName = reader.GetString(10),
                                                    SendEmail = reader.GetBoolean(11),
                                                    Obsolete = reader.GetBoolean(12),
                                                    EmailDeepLink = reader.GetBoolean(13)
                                                };

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

示例3: FetchProcess

        /// <summary>
        /// Retrieves the process.
        /// </summary>
        /// <param name="id">The process id.</param>
        /// <param name="fetchHistory">The fetch history.</param>
        /// <param name="locId">The localization/language id.</param>
        /// <returns>The processEdit DTO object <see cref="ProcessEditDto" />.</returns>
        public ProcessEditDto FetchProcess(int id, IProcessFetchHistory fetchHistory = null, int locId = 0)
        {
            var process = new ProcessEditDto();
            const string commandText = "GetProcessWithLoc";

            if (fetchHistory != null)
                fetchHistory.BeginLogExecuteSP();

            Database.GetDataReader(
                commandText,
                600,
                r =>
                {
                    if (r == null || !r.Read())
                    {
                        return;
                    }

                    var sr = new SafeDataReader(r);

                    process.Id = sr.GetInt("Id");
                    process.Name = sr.GetString("Name").Trim();
                    process.Description = sr.GetString("Description");
                    process.Documentation = sr.GetString("Documentation");
                    process.SystemName = sr.GetString("SystemName");
                    process.IconId = sr.GetNullableInt("IconId");
                    process.Guid = sr.GetGuid("Guid");
                    process.IsPublishedCopy = sr.GetBool("IsPublishedCopy");
                    process.BaseProcessId = sr.GetNullableInt("BaseProcessId");
                    process.BaseProcessProcessId = sr.GetNullableInt("BaseProcessProcessId");
                    process.ProcessOption = sr.GetString("ProcessOption");
                    process.IsStateEnabled = sr.GetBool("IsStateEnabled", true);
                    process.DefaultStateId = sr.GetInt32("DefaultStateId");
                    process.AllowPaperclips = sr.GetBool("AllowPaperclips", true);
                    process.ColorId = sr.GetNullableInt("ColorId");
                    process.InheritanceContext = sr.GetString("InheritanceContext");
                    process.ShowDerivedProcess = sr.GetBool(Constants.ShowDerivedProcess);
                    process.PublishedProcessId = sr.GetInt("PublishedProcessId");
                    process.PublishedId = sr.GetInt("PublishedId");
                    process.IsSystem = sr.GetBool("IsSystem");
                    process.SimpleProcess = sr.GetBool("SimpleProcess");
                    process.IsInactive = sr.GetBool("IsInactive");
                    process.IsTabbedUI = sr.GetBool("IsTabbedUI");
                    process.IsTrackable = sr.GetBool("IsTrackable");
                    process.ShowSummaryPage = sr.GetBool("ShowSummaryPage");
                    process.AllowBatchProcessing = sr.GetBool("AllowBatchProcessing");
                    process.LastUpdated = sr.GetDateTime("LastUpdated");
                    process.IdentifierField = sr.GetString("IdentifierField");
                    var processVersionId = sr.GetInt("ProcessVersionId");

                    if (fetchHistory != null)
                        fetchHistory.LogExecuteSP();

                    if (processVersionId > 0)
                    {
                        process.Version = new VersionDto
                        {
                            ProcessId = processVersionId,
                            VersioningStyle = sr.GetEnum("VersioningStyle", VersioningStyles.Char),
                            StartingVersion = sr.GetString("StartingVersion"),
                            NextVersionStateGuid = sr.GetGuid("NextVersionStateGuid"),
                            PreviousVersionStateGuid = sr.GetGuid("PreviousVersionStateGuid"),
                            IncludeVersionNumberInList = sr.GetBool("IncludeVersionNumberInList"),
                            IncludeVersionDateInList = sr.GetBool("IncludeVersionDateInList"),
                            StateFilterGuid = sr.GetGuid("StateFilterGuid")
                        };
                    }

                    if (fetchHistory != null)
                        fetchHistory.ProcessHistoryDTO.FetchSectionsTime = Profiler.Profile(() => ReadSections(process, sr));
                    else
                        ReadSections(process, sr);

                    ReadRequiredRuleConfigs(process, sr);

                    if (fetchHistory != null)
                        fetchHistory.ProcessHistoryDTO.FetchSecurityConfigurationsTime = fetchHistory.Profile(
                            () =>
                            {
                                ReadProcessSecurityConfigurations(process, sr);
                                ReadProcessSecurityConfigs(process, sr);
                            });
                    else
                    {
                        ReadProcessSecurityConfigurations(process, sr);
                        ReadProcessSecurityConfigs(process, sr);
                    }

                    ReadStates(process, sr);
                    ReadEscalationActionOptions(process, sr);
                    ReadAssignmentActionOptions(process, sr);
                    ReadApprovalActionOptions(process, sr);
                    ReadActionRules(process, sr);
//.........这里部分代码省略.........
开发者ID:mparsin,项目名称:Elements,代码行数:101,代码来源:ProcessDAL.cs

示例4: FetchReverseCrossRefFields


//.........这里部分代码省略.........
    FROM   Processes p
       INNER JOIN PublishedProcesses pp
            ON  p.BaseProcessId = pp.Id
       INNER JOIN processes p1
            ON  pp.ProcessId = p1.Id
       INNER JOIN ProcessList pl
            ON  p.id = pl.Id
)
SELECT f.[Name]
     , f.[SystemName]
     , f.[Id]
     , x.[DisplayMultiple]
     , x.[DisplayFieldName]
     , x.[CrossRefFieldName]
     , p.[SystemName]
     , p.[Id]
FROM [dbo].[Sections] s
INNER JOIN ProcessList pl ON s.ProcessId = pl.Id
INNER JOIN [dbo].[Fields] f ON s.[Id] = f.[SectionId]
INNER JOIN [dbo].[ReverseCrossRefRequiredFieldStep] x ON f.[Id] = x.[FieldId]
INNER JOIN [dbo].[PublishedProcesses] [pp] ON [pp].[Id] = x.ReverseCrossRefProcessId
INNER JOIN [dbo].[Processes] [p] ON [p].[Id] = pp.ProcessId
";
                }
                else
                {
                    cmdText = @"
SELECT f.[Name]
     , f.[SystemName]
     , f.[Id]
     , x.[DisplayMultiple]
     , x.[DisplayFieldName]
     , x.[CrossRefFieldName]
     , p.[SystemName]
     , p.[Id]
FROM [dbo].[Sections] s
INNER JOIN [dbo].[Fields] f ON s.[Id] = f.[SectionId]
INNER JOIN [dbo].[ReverseCrossRefRequiredFieldStep] x ON f.[Id] = x.[FieldId]
INNER JOIN [dbo].[PublishedProcesses] [pp] ON [pp].[Id] = x.ReverseCrossRefProcessId
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] = @referenceProcessGuid

SELECT f.[Name]
     , f.[SystemName]
     , f.[Id]
     , x.[DisplayMultiple]
     , x.[DisplayFieldName]
     , x.[CrossRefFieldName]
     , p.[SystemName]
     , p.[Id]
FROM [dbo].[Sections] s
INNER JOIN [dbo].[Fields] f ON s.[Id] = f.[SectionId]
INNER JOIN [dbo].[ReverseCrossRefRequiredFieldStep] x ON f.[Id] = x.[FieldId]
INNER JOIN [dbo].[PublishedProcesses] [pp] ON [pp].[Id] = x.ReverseCrossRefProcessId
INNER JOIN [dbo].[Processes] [p] ON [p].[Id] = pp.ProcessId
WHERE s.[ProcessId] = @processId AND x.[ReverseCrossRefProcessId] = @pp_id";
            }

            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("@referenceProcessGuid", referenceProcessGuid);

                    using (var reader = new SafeDataReader(cmd.ExecuteReader()))
                    {
                        while (reader.Read())
                        {
                            result.Add(new ReverseCrossRefFieldDto
                                           {
                                               Name = reader.GetString(0),
                                               SystemName = reader.GetString(1),
                                               FieldId = reader.GetInt(2),
                                               DisplayMultiple = reader.GetBoolean(3),
                                               DisplayField = reader.GetString(4),
                                               ReferenceField = reader.GetString(5),
                                               ReferenceProcessSystemName = reader.GetString(6),
                                               ReferenceProcessId = reader.GetInt(7)
                                           });
                        }
                    }
                }
            }

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

示例5: FetchProcessList

        /// <summary>
        /// Fetches process list.
        /// </summary>
        /// <returns>The <see cref="IList" />.</returns>
        public IList<ProcessInfoDTO> FetchProcessList(bool systemOnly = false)
        {
            string cmdText =
                @"SELECT p.[Id], p.[SystemName],p.[Guid]
                FROM   [dbo].[Processes] p
                    where  IsRemoved = 0";

            if (systemOnly)
                cmdText += " AND IsSystem = 1 AND IsPublishedCopy = 0";

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

                using (var cmd = new SqlCommand(cmdText, cn))
                using (var reader = new SafeDataReader(cmd.ExecuteReader()))
                {
                    while (reader.Read())
                    {
                        result.Add(
                            new ProcessInfoDTO
                            {
                                Id = reader.GetInt(0),
                                SystemName = reader.GetString(1),
                                Guid = reader.GetGuid(2)
                            });
                    }
                }
            }

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

示例6: 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

示例7: ReadReportSecurityConfigurations

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

            int? reportId = null;
            ProcessReportEditDto report = null;

            while (sr.Read())
            {
                var config = new ProcessReportSecurityConfigurationDto
                {
                    Id = sr.GetInt(0),
                    Guid = sr.GetGuid(1),
                    ReportId = sr.GetInt(2),
                    RoleId = sr.GetInt(3),
                    BusinessUnitId = sr.GetInt(4),
                    Name = sr.GetString(5)
                };

                if (config.ReportId != reportId)
                {
                    report = process.ReportList.First(r => r.Id == config.ReportId);
                    reportId = config.ReportId;
                }

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

示例8: FetchPublishedProcesses

        public IList<PublishedProcessInfoDTO> FetchPublishedProcesses(string culture)
        {
            var result = new List<PublishedProcessInfoDTO>();
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.VeyronMeta, false))
            {
                var connection = ctx.Connection;

                var commandText = string.Format(CultureInfo.InvariantCulture, @"
SELECT pp.Id
      ,ISNULL(pl.ProcessName, p.[Name])
      ,p.[SystemName]
      ,p.Id AS ProcessId
      ,p.[BaseProcessId]
      ,p2.[IconId]
      ,p.[Guid]
      ,p.[ProcessOption]
      ,p.[IsStateEnabled]
FROM   [dbo].[PublishedProcesses] pp
       INNER JOIN Processes p ON  pp.ProcessId = p.Id
       INNER JOIN Processes p2 ON pp.ProcessGuid = p2.[Guid] and p2.[IsPublishedCopy] = 0
       LEFT OUTER JOIN dbo.ProcessLocalizations pl
            INNER JOIN dbo.Localizations l ON pl.LocalizationId = l.Id AND l.CultureName = '{0}'
                ON p2.Id = pl.ProcessId
WHERE p.IsRemoved = 0 AND p2.IsRemoved = 0
ORDER BY p.Name", culture);

                using (var cmd = new SqlCommand(commandText, connection))
                using (var reader = new SafeDataReader(cmd.ExecuteReader()))
                {
                    while (reader.Read())
                    {
                        var dto = new PublishedProcessInfoDTO
                                      {
                                          Id = reader.GetInt32(0),
                                          Name = reader.GetString(1),
                                          SystemName = reader.GetString(2),
                                          ProcessId = reader.GetInt32(3),
                                          IconId = reader.GetNullableInt(5),
                                          ProcessGuid = reader.GetGuid(6),
                                          ProcessOption = reader.GetEnum(7, ProcessOption.None),
                                          IsStateEnabled = reader.GetBoolean(8)
                                      };

                        if (!reader.IsDBNull(4))
                        {
                            dto.BaseProcess = this.FetchPublishedProcess(reader.GetInt(4));
                        }

                        result.Add(dto);
                    }
                }
            }

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

示例9: 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

示例10: ReadESyncProcesses

        /// <summary>
        /// The read eSync processes.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        private static void ReadESyncProcesses(ProcessEditDto process, SafeDataReader sr)
        {
            sr.NextResult();

            while (sr.Read())
            {
                var syncProcess = new ESyncProcessDto
                {
                    Id = sr.GetInt(0),
                    Guid = sr.GetGuid(1),
                    Name = sr.GetString(2),
                    Description = sr.GetString(3),
                    Action = (ESyncAction)Enum.Parse(typeof(ESyncAction), sr.GetString(4), true),
                    Definition = sr.GetString(5),
                    PublishedCopyId = sr.GetNullableInt(6),
                    GenerateIndexes = sr.GetBoolean("GenerateIndexes")
                };

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

示例11: 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

示例12: GetStepList

        /// <summary>
        /// Gets step list.
        /// </summary>
        /// <param name="sr">The reader.</param>
        /// <param name="stepList">The step list.</param>
        private static void GetStepList(SafeDataReader sr, List<StepDto> stepList)
        {
            while (sr.Read())
            {
                var fieldEditorDto = new StepDto
                {
                    Id = sr.GetInt("Id"),
                    StepId = sr.GetInt("Id"),
                    Name = sr.GetString("Name"),
                    Class = sr.GetString("Class"),
                    FieldId = sr.GetInt32("FieldId"),
                    StepNumber = sr.GetInt("StepNumber"),
                    ViewClass = sr.GetString("ViewClass")
                };

                stepList.Add(fieldEditorDto);
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:23,代码来源:ProcessDAL2.cs

示例13: ReadFields

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

            int? sectionId = null;
            SectionDto section = null;
            var times = new List<double>();

            while (sr.Read())
            {
                var start = DateTime.Now;
                var fieldDto = new FieldDto
                {
                    Id = sr.GetInt32(0),
                    Name = sr.GetSafeString(1, string.Empty).Replace(@"""", "''"),
                    FieldTypeId = sr.GetInt32(2),
                    SectionId = sr.GetInt32(3),
                    Width = sr.GetDouble(4),
                    RowSpan = sr.GetInt(5),
                    ShowInList = sr.GetBoolean(6),
                    IncludeInFilter = sr.GetBoolean(7),
                    HideFromDetails = sr.GetBoolean(8),
                    SystemName = sr.GetString(9),
                    Position = sr.GetInt32(10),
                    CopyFieldValueOnCopyItem = sr.GetBool(11),
                    DeepCopy = sr.GetBool(12),
                    Guid = sr.GetGuid(13),
                    SearchPosition = sr.GetInt(14),
                    SearchWidth = sr.GetInt(15),
                    IsBase = sr.GetBoolean(16),
                    UseInGlobalSearch = sr.GetBoolean(19),
                    PublishedCopyId = sr.GetNullableInt(21),
                    AllowLocalizedData = sr.GetBoolean("AllowLocalizedData")
                };

                if (fieldDto.SectionId != sectionId || section == null)
                {
                    section = process.Sections.First(s => s.Id == fieldDto.SectionId);
                    sectionId = fieldDto.SectionId;
                }

                fieldDto.FieldTypeInfo = new FieldTypeDto
                {
                    Id = fieldDto.FieldTypeId,
                    Name = sr.GetString(17),
                    DataType = sr.GetString(18),
                    CanBeRequired = sr.GetBoolean(20)
                };

                section.FieldList.Add(fieldDto);

                times.Add((DateTime.Now - start).TotalMilliseconds);
            }

            Profiler.Profile(() => this.ReadFieldEditors(process, sr));
        }
开发者ID:mparsin,项目名称:Elements,代码行数:61,代码来源:ProcessDAL2.cs

示例14: GetProcessesIdsThatRequireUpdate

        /// <summary>
        /// Gets processes Ids that require update.
        /// </summary>
        /// <returns>The <see cref="IList" />.</returns>
        public IList<int> GetProcessesIdsThatRequireUpdate()
        {
            var result = new List<int>();
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.VeyronMeta, false))
            {
                var connection = ctx.Connection;

                const string CommandText = @"
SELECT  pp.[ProcessId]
FROM    [dbo].[PublishedProcesses] pp
        INNER JOIN [dbo].[Processes] p ON pp.[ProcessId] = p.[Id]
WHERE   p.[IsRemoved] = 0
        AND pp.[IsGlobalSearchUpdateRequired] = 1";

                using (var command = new SqlCommand(CommandText, connection))
                {
                    using (var sr = new SafeDataReader(command.ExecuteReader()))
                    {
                        while (sr.Read())
                        {
                            result.Add(sr.GetInt(0));
                        }
                    }
                }
            }

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

示例15: GetViewStepList

        /// <summary>
        /// Gets step list.
        /// </summary>
        /// <param name="sr">The reader.</param>
        /// <param name="stepList">The step list.</param>
        private static void GetViewStepList(SafeDataReader sr, List<ViewStepDto> stepList)
        {
            while (sr.Read())
            {
                var fieldEditorDto = new ViewStepDto
                {
                    Id = sr.GetInt("Id"),
                    Class = sr.GetString("StepName"),
                    SectionId = sr.GetInt32("SectionId")
                };

                stepList.Add(fieldEditorDto);
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:19,代码来源:ProcessDAL2.cs


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