Initial commit: JDE Scoping Tool migration project
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
This commit is contained in:
+53
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Dapper;
|
||||
using DataModel.Helpers;
|
||||
using DataModel.Models;
|
||||
using Oracle.ManagedDataAccess.Client;
|
||||
|
||||
namespace DataModel.Process
|
||||
{
|
||||
/// <summary>
|
||||
/// Work order component tracking functionality for JDE interface
|
||||
/// </summary>
|
||||
public partial class JDE
|
||||
{
|
||||
/// <summary>
|
||||
/// Fetches updates for workorder components
|
||||
/// </summary>
|
||||
/// <param name="lastUpdateDT">Timestamp of last imported data</param>
|
||||
/// <returns>Streaming updates for workorder components</returns>
|
||||
public static IEnumerable<WorkOrderComponent> GetWorkOrderComponents(DateTime? lastUpdateDT = null)
|
||||
{
|
||||
using (OracleConnection connection = GetConnection())
|
||||
{
|
||||
var results = lastUpdateDT.HasValue ?
|
||||
connection.Query<WorkOrderComponent>(queries["SQL_GET_WORKORDER_COMPONENTS_FILTERED"], new { dateUpdated = lastUpdateDT.Value.ToJDEDate(), timeUpdated = lastUpdateDT.Value.ToJDETime() }, buffered: false, commandTimeout: Config.QueryTimeout) :
|
||||
connection.Query<WorkOrderComponent>(queries["SQL_GET_WORKORDER_COMPONENTS"], buffered: false, commandTimeout: Config.QueryTimeout);
|
||||
|
||||
foreach (var result in results)
|
||||
{
|
||||
yield return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fetches updates for workorder components archive
|
||||
/// </summary>
|
||||
/// <param name="lastUpdateDT">Timestamp of last imported data</param>
|
||||
/// <returns>Streaming updates for workorder components</returns>
|
||||
public static IEnumerable<WorkOrderComponent> GetWorkOrderComponentsArchive(DateTime? lastUpdateDT = null)
|
||||
{
|
||||
using (OracleConnection connection = GetConnection())
|
||||
{
|
||||
var results = connection.Query<WorkOrderComponent>(queries["SQL_GET_WORKORDER_COMPONENTS_ARCHIVE"], buffered: false, commandTimeout: Config.QueryTimeout);
|
||||
|
||||
foreach (var result in results)
|
||||
{
|
||||
yield return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user