本文整理汇总了C#中Csla.Data.SafeDataReader.GetNullableBool方法的典型用法代码示例。如果您正苦于以下问题:C# SafeDataReader.GetNullableBool方法的具体用法?C# SafeDataReader.GetNullableBool怎么用?C# SafeDataReader.GetNullableBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Csla.Data.SafeDataReader
的用法示例。
在下文中一共展示了SafeDataReader.GetNullableBool方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FetchReverseCrossRefField
/// <summary>
/// Retrieves reverse cross ref field.
/// </summary>
/// <param name="fieldId">The field id.</param>
/// <returns>The <see cref="ReverseCrossRefFieldDto" />.</returns>
public ReverseCrossRefFieldDto FetchReverseCrossRefField(int fieldId)
{
const string CmdText =
@"
SELECT
f.[Id]
,f.[Name]
,f.[SystemName]
,x.[DisplayMultiple]
,x.[ReverseCrossRefProcessId]
,p.[SystemName]
,x.[CrossRefFieldName]
,x.[DisplayFieldName]
,o.[ShowLatestVersion]
FROM [dbo].[Fields] f
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] AND p.[IsRemoved] = 0
LEFT OUTER JOIN [dbo].[ReverseCrossRefOptionsFieldStep] o ON o.[FieldId] = f.[Id]
WHERE f.[Id] = @fieldId";
using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.VeyronMeta, false))
{
var cn = ctx.Connection;
using (var cmd = new SqlCommand(CmdText, cn))
{
cmd.Parameters.AddWithValue("@fieldId", fieldId);
using (var reader = new SafeDataReader(cmd.ExecuteReader()))
{
while (reader.Read())
{
return new ReverseCrossRefFieldDto
{
FieldId = reader.GetInt32(0),
Name = reader.GetString(1),
SystemName = reader.GetString(2),
DisplayMultiple = reader.GetBoolean(3),
ReferenceProcessId = reader.GetInt32(4),
ReferenceProcessSystemName = reader.GetString(5),
ReferenceField = reader.GetString(6),
DisplayField = reader.GetString(7),
ShowLatestVersion = reader.GetNullableBool(8) ?? false
};
}
}
}
}
return new ReverseCrossRefFieldDto();
}
示例2: GetPersons
public Collection<PersonInfo> GetPersons(IEditableRoot item)
{
if (item == null)
throw new ArgumentNullException("item");
using (var ctx = ConnectionManager<SqlConnection>.GetManager(ServerSettings.ConnectionString, false))
{
using (var cmd = new SqlCommand(QueryDefinition.CommandText, ctx.Connection))
{
foreach (var parameterBuilder in QueryDefinition.ParameterBuilders)
{
cmd.Parameters.Add(parameterBuilder.CreateParameter(item));
}
using (var reader = new SafeDataReader(cmd.ExecuteReader()))
{
var result = new Collection<PersonInfo>();
while (reader.Read())
{
result.Add(
new PersonInfo
{
Id = reader.GetInt32(0),
FirstName = reader.GetString(1),
LastName = reader.GetString(2),
Email = reader.GetString(3),
OutOfOffice = reader.GetNullableBool(4),
DelegateApproverId = reader.GetNullableInt(5),
AccountId = reader.GetNullableInt(6),
UserName = reader.GetString(7),
Locale = reader.GetString(8),
AuthenticationType = reader.GetEnum(9, AuthenticationTypes.MQ1)
});
}
return result;
}
}
}
}
示例3: AddNavigationItem
/// <summary>
/// Adds the navigation item.
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="currentGroup">The current group.</param>
private static void AddNavigationItem(SafeDataReader reader, NavigationGroupDTO currentGroup)
{
var navItemDto = new NavigationItemDTO
{
Id = reader.GetInt32(5),
Name = reader.GetString(6),
SystemName = reader.GetString(7),
IconId = reader.GetNullableInt(8),
IconUrl = reader.GetString(9),
AssemblyName = reader.GetString(10),
ProcessId = reader.GetNullableInt(11),
ProcessSystemName = reader.GetString(13),
Description = reader.GetString(17)
};
navItemDto.Description = navItemDto.ProcessId == null ? reader.GetString("HelpText") : reader.GetString(reader.GetOrdinal("Description"));
navItemDto.BackgroundColor = reader.GetInt64(reader.GetOrdinal("BackgroundColor"));
navItemDto.ProcessViewGuid = reader.GetNullableGuid(reader.GetOrdinal("ProcessViewGuid"));
navItemDto.IsSystem = reader.GetNullableBool(reader.GetOrdinal("IsSystem"));
navItemDto.IsBeta = reader.GetBoolean(reader.GetOrdinal("IsBeta"));
var processName = reader.GetString(12);
if (!string.IsNullOrEmpty(processName))
navItemDto.Name = processName;
currentGroup.NavigationItems.Add(navItemDto);
}
示例4: ReadPerson
/// <summary>
/// Initializes a new <see cref="PersonInfo"/> with values from a data reader.
/// </summary>
/// <param name="reader">
/// The data reader.
/// </param>
/// <returns>
/// The <see cref="PersonInfo"/>.
/// </returns>
protected virtual PersonInfo ReadPerson(SafeDataReader reader)
{
if (reader == null)
throw new ArgumentNullException("reader");
return new PersonInfo
{
Id = reader.GetInt32(0),
FirstName = reader.GetString(1),
LastName = reader.GetString(2),
Email = reader.GetString(3),
OutOfOffice = reader.GetNullableBool(4),
DelegateApproverId = reader.GetNullableInt(5),
AccountId = reader.GetNullableInt(6),
UserName = reader.GetString(7),
Locale = reader.GetString(8),
AuthenticationType = reader.GetEnum(9, AuthenticationTypes.MQ1)
};
}