本文整理汇总了C#中Csla.Data.SafeDataReader.GetNullableGuid方法的典型用法代码示例。如果您正苦于以下问题:C# SafeDataReader.GetNullableGuid方法的具体用法?C# SafeDataReader.GetNullableGuid怎么用?C# SafeDataReader.GetNullableGuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Csla.Data.SafeDataReader
的用法示例。
在下文中一共展示了SafeDataReader.GetNullableGuid方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FetchGroupNavigationItems
/// <summary>
/// Fetches the group navigation items.
/// </summary>
/// <param name="connection">The connection.</param>
/// <param name="dto">The dto.</param>
/// <param name="currentLocalizationId">The current localization identifier.</param>
private static void FetchGroupNavigationItems(SqlConnection connection, NavigationGroupEditDto dto, int currentLocalizationId)
{
const string sql =
@"
SELECT
nv.[Id]
,nv.[Guid]
,ISNULL(pl.ProcessName, p.[Name]) + (CASE WHEN ISNULL(pvl.Name, pv.Name) IS NULL THEN '' ELSE ' - ' + ISNULL(pvl.Name, pv.Name) END)
,p.[SystemName]
,nv.[Sequence]
,nv.[PublishedProcessId]
,nv.[IconURL]
,p.[IconId]
,nv.[ProcessViewGuid]
FROM
[dbo].[NavigationItems] nv
INNER JOIN [dbo].[PublishedProcesses] pp ON nv.[PublishedProcessId] = pp.[Id]
INNER JOIN [dbo].[Processes] p ON pp.[ProcessId] = p.[Id]
INNER JOIN Processes p2 ON pp.ProcessGuid = p2.[Guid] and p2.[IsPublishedCopy] = 0
LEFT JOIN [dbo].[ProcessViews] pv ON pv.[Guid] = nv.ProcessViewGuid AND pv.ProcessId = p.Id
LEFT OUTER JOIN dbo.ProcessLocalizations pl ON p2.Id = pl.ProcessId AND pl.LocalizationId = @locId
LEFT OUTER JOIN dbo.ProcessViewLocalizations pvl ON p2.Id = pl.ProcessId AND pvl.LocalizationId = @locId
WHERE
p.[IsRemoved] = 0 AND
p.IsInactive = 0 AND
nv.[NavigationGroupId] = @groupId
UNION
SELECT
nv.[Id]
,nv.[Guid]
,nv.[Name]
,NULL
,nv.[Sequence]
,NULL
,nv.[IconURL]
,NULL
,NULL
FROM
[dbo].[NavigationItems] nv
WHERE nv.[SystemName] IS NULL AND
nv.[PublishedProcessId] IS NULL AND
nv.[NavigationGroupId] = @groupId;
";
using (var cmd = new SqlCommand(sql, connection))
{
cmd.Parameters.AddWithValue("@groupId", dto.Id);
cmd.Parameters.AddWithValue("@locId", currentLocalizationId);
using (var reader = new SafeDataReader(cmd.ExecuteReader()))
{
while (reader.Read())
{
var navigationItemDto = new NavigationItemEditDto
{
Id = reader.GetInt(0),
Guid = reader.GetGuid(1),
Name = reader.GetString(2),
Sequence = reader.GetDouble(4),
PublishedProcessId = reader.GetNullableInt(5),
IconURL = reader.GetString(6),
IconId = reader.GetNullableInt(7),
ProcessViewGuid = reader.GetNullableGuid(8)
};
//FetchNavigationItemSecurityConfigurations(connection, navigationItemDto);
dto.NavigationItems.Add(navigationItemDto);
}
}
foreach (var navigationItemDto in dto.NavigationItems)
{
FetchNavigationItemSecurityConfigurations(connection, navigationItemDto);
}
}
}
示例2: FetchSchedule
/// <summary>
/// Retrieves schedule.
/// </summary>
/// <param name="id">The Process Schedule id.</param>
/// <returns>The <see cref="ProcessScheduleEditDto" />.</returns>
public ProcessScheduleEditDto FetchSchedule(int id)
{
var result = new ProcessScheduleEditDto();
using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.VeyronMeta, false))
{
var connection = ctx.Connection;
const string CommandText =
@"
SELECT [s].[Id]
, [s].[ProcessId]
, [s].[NumberOfItemsScheduled]
, [s].[ScheduleFrequencyPatternId]
, [s].[ScheduleKeyField]
, [s].[ScheduleDisplayDateField]
, [s].[ScheduleStartStateGuid]
, [s].[ScheduleDateField]
, [s].[ScheduleFilterGuid]
FROM [dbo].[ProcessSchedule] s
WHERE s.ProcessId = @p_Id";
using (var command = new SqlCommand(CommandText, connection))
{
command.Parameters.AddWithValue("@p_Id", id);
using (var reader = new SafeDataReader(command.ExecuteReader()))
{
if (reader.Read())
{
result.Id = reader.GetInt32(0);
result.ProcessId = reader.GetInt32(1);
result.NumberOfItemsScheduled = reader.GetInt32(2);
result.ScheduleFrequencyPatternId = reader.GetInt32(3);
result.ScheduleKeyField = reader.GetString(4);
result.ScheduleDisplayDateField = reader.GetString(5);
result.ScheduleStartStateGuid = reader.GetString(6);
result.ScheduleBasedOnDateField = reader.GetString(7);
result.ScheduleFilterGuid = reader.GetNullableGuid(8) ?? Guid.Empty;
}
else
{
return null;
}
}
}
}
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: ReadCommands
/// <summary>
/// Reads commands.
/// </summary>
/// <param name="process">The process.</param>
/// <param name="sr">The reader.</param>
private static void ReadCommands(ProcessEditDto process, SafeDataReader sr)
{
sr.NextResult();
while (sr.Read())
{
var commandDto = new ProcessCommandEditDto
{
Id = sr.GetInt32(0),
ProcessId = sr.GetInt32(1),
GuidId = sr.GetGuid(2).ToString(),
LastModifiedOn = sr.GetDateTime(3),
CommandName = sr.GetString(4),
CommandType = sr.GetString(5),
Documentation = sr.GetString(6),
IntegrationServiceGuid = sr.GetNullableGuid(7),
DataTriggerGuid = sr.GetNullableGuid("DataTriggerGuid")
};
process.Commands.Add(commandDto);
}
ReadCommandSecurityConfiguration(process, sr);
}
示例5: ReadDataTriggerMappings
/// <summary>
/// Reads data trigger mappings.
/// </summary>
/// <param name="process">The process.</param>
/// <param name="sr">The reader.</param>
private static void ReadDataTriggerMappings(ProcessEditDto process, SafeDataReader sr)
{
sr.NextResult();
int? triggerId = null;
ProcessDataTriggerEditDto trigger = null;
while (sr.Read())
{
var mappingDto = new DataTriggerFieldMappingEditDto
{
Id = sr.GetInt32(0),
Guid = sr.GetGuid(1),
DataTriggerId = sr.GetInt32(2),
DestinationFieldSystemName = sr.GetString(3),
DestinationFieldDisplayName = sr.GetString(4),
ModificationType =
(DataTriggerModificationType)
Enum.Parse(typeof(DataTriggerModificationType), sr.GetString(5), true),
Expression = sr.GetString(6),
SourceDataProcessName = sr.GetString(7),
SourceDataFilterGuid = sr.GetNullableGuid(8),
SourceDataFilterDefinition = sr.GetString(9)
};
if (mappingDto.DataTriggerId != triggerId)
{
trigger = process.TriggerList.First(t => t.Id == mappingDto.DataTriggerId);
triggerId = mappingDto.DataTriggerId;
}
trigger.FieldMappingList.Add(mappingDto);
}
ReadDataTriggerFieldMappingDataSources(process, sr);
}
示例6: ReadDataTriggers
/// <summary>
/// Reads data triggers.
/// </summary>
/// <param name="process">The process.</param>
/// <param name="sr">The reader.</param>
private static void ReadDataTriggers(ProcessEditDto process, SafeDataReader sr)
{
sr.NextResult();
while (sr.Read())
{
var dto = new ProcessDataTriggerEditDto
{
Id = sr.GetInt32(0),
Guid = sr.GetGuid(1),
Name = sr.GetString(2),
Notes = sr.GetString(3),
ProcessToModifySystemName = sr.GetString(4),
FilterGuid = sr.GetNullableGuid(5),
FilterDefinition = sr.GetString(6),
ModificationType = (DataTriggerModificationType)Enum.Parse(typeof(DataTriggerModificationType), sr.GetString(7), true),
ModificationMapping = sr.GetString(8),
TriggerType = sr.GetEnum(9, DataTriggerTypes.Process),
StoredProcedureName = sr.GetString(10)
};
process.TriggerList.Add(dto);
}
ReadDataTriggerMappings(process, sr);
ReadDataTriggerRules(process, sr);
ReadDataTriggerStoredProcedureParameters(process, sr);
}
示例7: ReadIntegrationServiceMethods
/// <summary>
/// Reads the integration service methods.
/// </summary>
/// <param name="settingsDto">The settings dto.</param>
/// <param name="reader">The reader.</param>
private static void ReadIntegrationServiceMethods(IntegrationServiceCreationSettingsDto settingsDto, SafeDataReader reader)
{
reader.NextResult();
while (reader.Read())
{
var dto = new IntegrationServiceMethodDto
{
Id = reader.GetInt32(0),
Guid = reader.GetGuid(1),
Name = reader.GetString(2),
Username = reader.GetString(3),
Password = reader.GetString(4),
CanInsert = reader.GetBoolean(5),
CanUpdate = reader.GetBoolean(6),
CanInsertOrUpdate = reader.GetBoolean(7),
CanRemove = reader.GetBoolean(8),
EndpointMapping = reader.GetString(9),
Namespace = reader.GetString(10),
CanSelect = reader.GetBoolean("CanSelect"),
ResultTypeGuid = reader.GetNullableGuid("ResultTypeGuid"),
ResultMapping = reader.GetString("ResultMapping"),
ReturnMode = reader.GetEnum("ReturnMode", IntegrationServiceMethodReturnMode.All),
GenerateIndexes = reader.GetBoolean("GenerateIndexes")
};
settingsDto.Methods.Add(dto);
}
ReadIntegrationServiceMethodParameters(settingsDto, reader);
}