26ff8d9b4f
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
37 lines
1.4 KiB
C#
Executable File
37 lines
1.4 KiB
C#
Executable File
using System;
|
|
using System.Collections.Generic;
|
|
using Dapper;
|
|
using DataModel.Helpers;
|
|
using DataModel.Models;
|
|
|
|
namespace DataModel.Process
|
|
{
|
|
/// <summary>
|
|
/// Status codes tracking functionality for JDE interface
|
|
/// </summary>
|
|
public partial class JDE
|
|
{
|
|
/// <summary>
|
|
/// Fetches updated status codes
|
|
/// </summary>
|
|
/// <param name="lastUpdateDT">Timestamp of last updated record already imported</param>
|
|
/// <returns>Streaming updated status codes</returns>
|
|
public static IEnumerable<StatusCode> GetStatusCodes(DateTime? lastUpdateDT = null)
|
|
{
|
|
using (DDTek.Oracle.OracleConnection connection = new DDTek.Oracle.OracleConnection(Config.GIWCS))
|
|
{
|
|
connection.Open();
|
|
|
|
var results = lastUpdateDT.HasValue ?
|
|
connection.Query<StatusCode>(queries["SQL_GET_STATUS_CODES_FILTERED"], new { dateUpdated = lastUpdateDT.Value.Date, timeUpdated = lastUpdateDT.Value.ToJDETime() }, buffered: false, commandTimeout: Config.QueryTimeout) :
|
|
connection.Query<StatusCode>(queries["SQL_GET_STATUS_CODES"], buffered: false, commandTimeout: Config.QueryTimeout);
|
|
|
|
foreach (var result in results)
|
|
{
|
|
yield return result;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|