Refactoring project

parent 5e824dba
...@@ -11,72 +11,91 @@ using RouteHandler = IntegrationKSSS.WebService.Infrastructure.RouteHandlers.Rou ...@@ -11,72 +11,91 @@ using RouteHandler = IntegrationKSSS.WebService.Infrastructure.RouteHandlers.Rou
using IRouteHandler = IntegrationKSSS.WebService.Infrastructure.RouteHandlers.IRouteHandler; using IRouteHandler = IntegrationKSSS.WebService.Infrastructure.RouteHandlers.IRouteHandler;
using NLog.Config; using NLog.Config;
using ILogger = NLog.ILogger; using ILogger = NLog.ILogger;
using System.Reflection; using Microsoft.AspNetCore.Authorization;
namespace IntegrationKSSS.WebService.Infrastructure.Configurations namespace IntegrationKSSS.WebService.Infrastructure.Configurations;
/// <summary>
/// Configuration of the WEB API
/// </summary>
public static class ApplicationConfiguration
{ {
public static class ApplicationConfiguration #region Methods
/// <summary>
/// Getting a logger
/// </summary>
/// <returns>Logger</returns>
private static ILogger GetLogger()
{ {
public static ILogger GetLogger() string fileName = string.Empty;
{
string fileName = string.Empty;
#if DEBUG #if DEBUG
fileName = Path.GetFullPath(@"../../IntegrationKSSS/IntegrationKSSS.WebService/NLog.config"); fileName = Path.GetFullPath(@"../../IntegrationKSSS/IntegrationKSSS.WebService/NLog.config");
#endif #endif
#if !DEBUG #if !DEBUG
fileName = $"{Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)}/NLog.config"; fileName = $"{Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)}/NLog.config";
#endif #endif
LogManager.Configuration = new XmlLoggingConfiguration(fileName); LogManager.Configuration = new XmlLoggingConfiguration(fileName);
return LogManager.GetCurrentClassLogger(); return LogManager.GetCurrentClassLogger();
} }
/// <summary>
/// Adding middleware, services and functions
/// </summary>
/// <param name="webApplicationBuilder"></param>
public static void RegisterBuilder(WebApplicationBuilder webApplicationBuilder)
{
var logger = GetLogger();
public static void RegisterBuilder(WebApplicationBuilder webApplicationBuilder) try
{ {
var logger = GetLogger(); webApplicationBuilder.Services.AddEndpointsApiExplorer();
webApplicationBuilder.Logging.ClearProviders();
webApplicationBuilder.Host.UseNLog();
webApplicationBuilder.Services.AddSwaggerGen();
webApplicationBuilder.Services.AddSingleton(logger);
try var connectionString = webApplicationBuilder.Configuration["ConnectionStrings:MicrosoftSqlServer"]
.DecryptString(AesConfiguration.Key, AesConfiguration.IV);
webApplicationBuilder.Services.AddDbContext<RDnLDbContext>(options =>
options.UseSqlServer(connectionString));
webApplicationBuilder.Services.AddScoped<IAuthService, AuthService>();
webApplicationBuilder.Services.AddScoped<IKsssRepository, KsssRepository>();
webApplicationBuilder.Services.AddTransient<IRouteHandler, RouteHandler>();
webApplicationBuilder.Services.AddAuthentication("BasicAuthentication")
.AddScheme<AuthenticationSchemeOptions, BasicAuthenticationHandler>("BasicAuthentication", options => { });
webApplicationBuilder.Services.AddAuthorization(options =>
{ {
webApplicationBuilder.Services.AddEndpointsApiExplorer(); options.AddPolicy("BasicAuthentication", new AuthorizationPolicyBuilder("BasicAuthentication").RequireAuthenticatedUser().Build());
webApplicationBuilder.Logging.ClearProviders(); });
webApplicationBuilder.Host.UseNLog();
webApplicationBuilder.Services.AddSwaggerGen();
webApplicationBuilder.Services.AddSingleton(logger);
webApplicationBuilder.Services.AddAuthorization();
webApplicationBuilder.Services.AddAuthentication("BasicAuthentication")
.AddScheme<AuthenticationSchemeOptions, BasicAuthenticationHandler>("BasicAuthentication", null);
var connectionString = webApplicationBuilder.Configuration["ConnectionStrings:MicrosoftSqlServer"]
.DecryptString(AesConfiguration.Key, AesConfiguration.IV);
webApplicationBuilder.Services.AddDbContext<RDnLDbContext>(options =>
options.UseSqlServer(connectionString));
webApplicationBuilder.Services.AddScoped<IAuthService, AuthService>();
webApplicationBuilder.Services.AddScoped<IKsssRepository, KsssRepository>();
webApplicationBuilder.Services.AddTransient<IRouteHandler, RouteHandler>();
}
catch (Exception ex)
{
logger.Error(ex, "Stopped web api because of exception");
throw;
}
finally
{
LogManager.Shutdown();
}
} }
public static void RegisterApplication(WebApplication webApplication) catch (Exception ex)
{ {
if (webApplication.Environment.IsDevelopment()) logger.Error(ex, "Stopped web api because of exception");
{ throw;
webApplication.UseSwagger(); }
webApplication.UseSwaggerUI(); finally
} {
webApplication.UseAuthorization(); LogManager.Shutdown();
webApplication.UseAuthentication();
webApplication.Services.GetServices<IRouteHandler>().ToList().ForEach(c => c.Register(webApplication));
} }
} }
/// <summary>
/// Using middleware, services and functions
/// </summary>
/// <param name="webApplication"></param>
public static void RegisterApplication(WebApplication webApplication)
{
if (webApplication.Environment.IsDevelopment())
{
webApplication.UseSwagger();
webApplication.UseSwaggerUI();
}
webApplication.UseAuthentication();
webApplication.UseAuthorization();
webApplication.Services.GetServices<IRouteHandler>().ToList().ForEach(c => c.Register(webApplication));
}
#endregion
} }
namespace IntegrationKSSS.WebService.Infrastructure.Cryptography;
internal static class AesConfiguration
{
#region Variables
public const string Key = "da983189246a4520a94764a751fa466a";
public static byte[] IV = new byte[16];
#endregion
}
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
namespace IntegrationKSSS.WebService.Infrastructure.Cryptography namespace IntegrationKSSS.WebService.Infrastructure.Cryptography;
internal static class AesExtension
{ {
public static class AesConfiguration #region Methods
internal static string DecryptString(this string cipherText, string key, byte[] IV)
{ {
public const string Key = "da983189246a4520a94764a751fa466a"; if (cipherText == null || cipherText.Length <= 0) throw new ArgumentNullException(nameof(cipherText));
public static byte[] IV = new byte[16]; if (key == null || key.Length <= 0) throw new ArgumentNullException(nameof(key));
} if (IV == null || IV.Length <= 0) throw new ArgumentNullException(nameof(IV));
public static class AesExtension string plaintext = null;
{ using (Aes aesAlg = Aes.Create())
public static string DecryptString(this string cipherText, string key, byte[] IV)
{ {
if (cipherText == null || cipherText.Length <= 0) throw new ArgumentNullException(nameof(cipherText)); aesAlg.Key = Encoding.UTF8.GetBytes(key);
if (key == null || key.Length <= 0) throw new ArgumentNullException(nameof(key)); aesAlg.IV = IV;
if (IV == null || IV.Length <= 0) throw new ArgumentNullException(nameof(IV));
string plaintext = null;
using (Aes aesAlg = Aes.Create())
{
aesAlg.Key = Encoding.UTF8.GetBytes(key);
aesAlg.IV = IV;
ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV); ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
using (MemoryStream msDecrypt = new MemoryStream(Convert.FromBase64String(cipherText))) using (MemoryStream msDecrypt = new MemoryStream(Convert.FromBase64String(cipherText)))
{
using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))
{ {
using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) using (StreamReader srDecrypt = new StreamReader(csDecrypt))
{ {
using (StreamReader srDecrypt = new StreamReader(csDecrypt)) plaintext = srDecrypt.ReadToEnd();
{
plaintext = srDecrypt.ReadToEnd();
}
} }
} }
} }
return plaintext;
} }
}
} return plaintext;
}
#endregion
}
\ No newline at end of file
using IntegrationKSSS.WebService.Infrastructure.Models; using IntegrationKSSS.WebService.Infrastructure.Models;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace IntegrationKSSS.WebService.Infrastructure.Data namespace IntegrationKSSS.WebService.Infrastructure.Data;
public class RDnLDbContext : DbContext
{ {
public class RDnLDbContext : DbContext #region Constructors
{ public RDnLDbContext(DbContextOptions dbContextOptions) : base(dbContextOptions) { }
public RDnLDbContext(DbContextOptions dbContextOptions) : base(dbContextOptions) {} #endregion
public DbSet<RndtSp> RndtSp => Set<RndtSp>(); #region Properties
public DbSet<RndtSpIc> RndtSpIc => Set<RndtSpIc>(); public DbSet<RndtSp> RndtSp => Set<RndtSp>();
public DbSet<RndtSpIi> RndtSpIi => Set<RndtSpIi>(); public DbSet<RndtSpIc> RndtSpIc => Set<RndtSpIc>();
public DbSet<RndtSpIi> RndtSpIi => Set<RndtSpIi>();
public DbSet<RndtIpIeAu> RndtIpIeAu => Set<RndtIpIeAu>();
#endregion
#region Methods
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasDefaultSchema("RndSuite");
protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity<RndtSp>()
{ .HasKey(c => new { c.SP, c.SP_VERSION });
modelBuilder.HasDefaultSchema("RndSuite");
modelBuilder.Entity<RndtSp>() modelBuilder.Entity<RndtSpIc>()
.HasKey(c => new { c.SP, c.SP_VERSION }); .HasKey(c => new { c.SP, c.SP_VERSION, c.IC, c.ICNODE });
modelBuilder.Entity<RndtSpIc>() modelBuilder.Entity<RndtSpIi>()
.HasKey(c => new { c.SP, c.SP_VERSION, c.IC, c.ICNODE}); .HasKey(c => new { c.SP, c.SP_VERSION, c.IC, c.ICNODE, c.IINODE });
modelBuilder.Entity<RndtSpIi>() modelBuilder.Entity<RndtIpIeAu>()
.HasKey(c => new {c.SP, c.SP_VERSION, c.IC, c.ICNODE, c.IINODE}); .HasKey(c => new { c.IP, c.SEQ, c.AUSEQ, c.AU, c.VERSION, c.IE });
} }
} #endregion
} }
\ No newline at end of file
...@@ -7,56 +7,61 @@ using System.Text.Encodings.Web; ...@@ -7,56 +7,61 @@ using System.Text.Encodings.Web;
using System.Text; using System.Text;
using IntegrationKSSS.WebService.Infrastructure.Services; using IntegrationKSSS.WebService.Infrastructure.Services;
namespace IntegrationKSSS.WebService.Infrastructure.Handlers namespace IntegrationKSSS.WebService.Infrastructure.Handlers;
/// <summary>
/// Basic authorization handler
/// </summary>
public class BasicAuthenticationHandler : AuthenticationHandler<AuthenticationSchemeOptions>
{ {
public class BasicAuthenticationHandler : AuthenticationHandler<AuthenticationSchemeOptions> private readonly IAuthService _authService;
#region Consturctors
public BasicAuthenticationHandler(
IOptionsMonitor<AuthenticationSchemeOptions> options,
ILoggerFactory logger,
UrlEncoder encoder,
ISystemClock clock,
IAuthService authService)
: base(options, logger, encoder, clock)
{
_authService = authService;
}
#endregion
#region Methods
protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
{ {
private readonly IAuthService _authService; var endpoint = Context.GetEndpoint();
if (endpoint?.Metadata?.GetMetadata<IAllowAnonymous>() != null)
public BasicAuthenticationHandler( return AuthenticateResult.NoResult();
IOptionsMonitor<AuthenticationSchemeOptions> options,
ILoggerFactory logger, if (!Request.Headers.ContainsKey("Authorization"))
UrlEncoder encoder, return AuthenticateResult.Fail("Missing Authorization Header");
ISystemClock clock, bool authResult = false;
IAuthService authService) try
: base(options, logger, encoder, clock)
{ {
_authService = authService; var authHeader = AuthenticationHeaderValue.Parse(Request.Headers["Authorization"]);
var credentialBytes = Convert.FromBase64String(authHeader.Parameter);
var credentials = Encoding.UTF8.GetString(credentialBytes).Split(new[] { ':' }, 2);
var username = credentials[0];
var password = credentials[1];
authResult = await _authService.Auth(username, password);
} }
catch
protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
{ {
// skip authentication if endpoint has [AllowAnonymous] attribute return AuthenticateResult.Fail("Invalid Authorization Header");
var endpoint = Context.GetEndpoint();
if (endpoint?.Metadata?.GetMetadata<IAllowAnonymous>() != null)
return AuthenticateResult.NoResult();
if (!Request.Headers.ContainsKey("Authorization"))
return AuthenticateResult.Fail("Missing Authorization Header");
bool authResult = false;
try
{
var authHeader = AuthenticationHeaderValue.Parse(Request.Headers["Authorization"]);
var credentialBytes = Convert.FromBase64String(authHeader.Parameter);
var credentials = Encoding.UTF8.GetString(credentialBytes).Split(new[] { ':' }, 2);
var username = credentials[0];
var password = credentials[1];
authResult = await _authService.Auth(username, password);
}
catch
{
return AuthenticateResult.Fail("Invalid Authorization Header");
}
if (authResult == false)
return AuthenticateResult.Fail("Invalid Username or Password");
List<Claim> claims = new List<Claim>();
var identity = new ClaimsIdentity(claims, Scheme.Name);
var principal = new ClaimsPrincipal(identity);
var ticket = new AuthenticationTicket(principal, Scheme.Name);
return AuthenticateResult.Success(ticket);
} }
if (authResult == false)
return AuthenticateResult.Fail("Invalid Username or Password");
List<Claim> claims = new List<Claim>();
var identity = new ClaimsIdentity(claims, Scheme.Name);
var principal = new ClaimsPrincipal(identity);
var ticket = new AuthenticationTicket(principal, Scheme.Name);
return AuthenticateResult.Success(ticket);
} }
#endregion
} }
namespace IntegrationKSSS.WebService.Infrastructure.Models;
/// <summary>
/// List of internal messages
/// </summary>
internal static class MessageList
{
#region Variables
public const string SpecificationNotFound = "Specification not found";
public const string KsssInfoCardNotFound = "KSSS info card not found";
public const string KsssInfoCardEmpty = "There are no info fields on the KSSS info card";
public const string SuccessfullyKsssInfoCardRecord = "Successfully recorded data on the KSSS info card";
public const string AcceptedDataPackage = "The data package has been accepted for processing";
#endregion
}
\ No newline at end of file
namespace IntegrationKSSS.WebService.Infrastructure.Models;
public class RndtIpIeAu
{
#region Properties
public decimal IP { get; set; }
public decimal VERSION { get; set; }
public decimal IE { get; set; }
public decimal SEQ { get; set; }
public decimal AU { get; set; }
public decimal AUSEQ { get; set; }
public string? VALUE { get; set; }
#endregion
}
\ No newline at end of file
namespace IntegrationKSSS.WebService.Infrastructure.Models namespace IntegrationKSSS.WebService.Infrastructure.Models;
public class RndtSp
{ {
public class RndtSp #region Properties
{ public decimal SP { get; set; }
public decimal SP { get; set; } public decimal SP_VERSION { get; set; }
public decimal SP_VERSION { get; set; } public string DESCRIPTION { get; set; }
public string DESCRIPTION { get; set; } public decimal? SS { get; set; }
public decimal? SS { get; set; } public char? ALLOW_MODIFY { get; set; }
public char? ALLOW_MODIFY { get; set; } public char? ACTIVE { get; set; }
public char? ACTIVE { get; set; } public string? LAST_COMMENT { get; set; }
public string? LAST_COMMENT { get; set; } #endregion
} }
} \ No newline at end of file
namespace IntegrationKSSS.WebService.Infrastructure.Models namespace IntegrationKSSS.WebService.Infrastructure.Models;
public class RndtSpIc
{ {
public class RndtSpIc #region Properties
{ public decimal SP { get; set; }
public decimal SP { get; set; } public decimal SP_VERSION { get; set; }
public decimal SP_VERSION { get; set; } public decimal IC { get; set; }
public decimal IC { get; set; } public string? IC_SHORT_DESC { get; set; }
public string? IC_SHORT_DESC { get; set; } public decimal ICNODE { get; set; }
public decimal ICNODE { get; set; } public decimal? IP_VERSION { get; set; }
public decimal? IP_VERSION { get; set; } public decimal? SS { get; set; }
public decimal? SS { get; set; } #endregion
} }
} \ No newline at end of file
namespace IntegrationKSSS.WebService.Infrastructure.Models namespace IntegrationKSSS.WebService.Infrastructure.Models;
public class RndtSpIi
{ {
public class RndtSpIi #region Properties
{ public decimal SP { get; set; }
public decimal SP { get; set; } public decimal SP_VERSION { get; set; }
public decimal SP_VERSION { get; set; } public decimal IC { get; set; }
public decimal IC { get; set; } public decimal ICNODE { get; set; }
public decimal ICNODE { get; set; } public decimal II { get; set; }
public decimal II { get; set; } public string? II_SHORT_DESC { get; set; }
public string? II_SHORT_DESC { get; set; } public decimal IINODE { get; set; }
public decimal IINODE { get; set; } public decimal? IE_VERSION { get; set; }
public decimal? IE_VERSION { get; set; } public string? IIVALUE { get; set; }
public string? IIVALUE { get; set; } public decimal? SS { get; set; }
public decimal? SS { get; set; } #endregion
} }
} \ No newline at end of file
namespace IntegrationKSSS.WebService.Infrastructure.Repositories namespace IntegrationKSSS.WebService.Infrastructure.Repositories;
/// <summary>
/// A set of repository functions
/// </summary>
public interface IKsssRepository
{ {
public interface IKsssRepository Task WriteKsssData(Dictionary<string, string> ksss);
{ }
Task<string> WriteKsssData(Dictionary<string, string> ksss); \ No newline at end of file
}
}
using IntegrationKSSS.Models; using IntegrationKSSS.WebService.Infrastructure.Data;
using IntegrationKSSS.WebService.Infrastructure.Data; using IntegrationKSSS.WebService.Infrastructure.Models;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using ILogger = NLog.ILogger; using ILogger = NLog.ILogger;
namespace IntegrationKSSS.WebService.Infrastructure.Repositories namespace IntegrationKSSS.WebService.Infrastructure.Repositories;
/// <summary>
/// A set of repository function implementations
/// </summary>
public class KsssRepository : KsssRepositoryBase, IKsssRepository
{ {
public class KsssRepository : KsssRepositoryBase, IKsssRepository #region Constructors
{ public KsssRepository(RDnLDbContext rDnLDbContext, ILogger logger) : base(rDnLDbContext, logger) { }
public KsssRepository(RDnLDbContext rDnLDbContext, ILogger logger) : base(rDnLDbContext, logger) { } #endregion
public async Task<string> WriteKsssData(Dictionary<string, string> ksssDictionary) #region Methods
/// <summary>
/// Data recording on the specification infocard
/// </summary>
/// <param name="ksssDictionary"></param>
/// <returns></returns>
public async Task WriteKsssData(Dictionary<string, string> ksssDictionary)
{
try
{ {
decimal specificationId = 0; decimal specificationId = 0;
decimal.TryParse(ksssDictionary["SP"], out specificationId); decimal.TryParse(ksssDictionary["SP"], out specificationId);
if(specificationId == 0) if (specificationId == 0)
{ {
Logger.Info("Not found specification id"); Logger.Info(MessageList.SpecificationNotFound);
return "Not found specification id"; return;
} }
decimal ssDev = 1000012; decimal ssDev = 1000012;
string nameInfoCard = "KSSS_Data"; string nameInfoCard = "KSSS_Data";
...@@ -23,12 +38,10 @@ namespace IntegrationKSSS.WebService.Infrastructure.Repositories ...@@ -23,12 +38,10 @@ namespace IntegrationKSSS.WebService.Infrastructure.Repositories
var specification = RDnLDbContext.RndtSp.FirstOrDefault(c => c.SP == specificationId && var specification = RDnLDbContext.RndtSp.FirstOrDefault(c => c.SP == specificationId &&
c.ALLOW_MODIFY == '1' && c.ALLOW_MODIFY == '1' &&
c.SS == ssDev); c.SS == ssDev);
if (specification == null) if (specification == null)
{ {
Logger.Info($"Not found specification {specificationId}"); Logger.Info(MessageList.SpecificationNotFound);
return $"Not found specification {specificationId}"; return;
} }
...@@ -36,40 +49,77 @@ namespace IntegrationKSSS.WebService.Infrastructure.Repositories ...@@ -36,40 +49,77 @@ namespace IntegrationKSSS.WebService.Infrastructure.Repositories
infoCard.IC_SHORT_DESC == nameInfoCard && infoCard.IC_SHORT_DESC == nameInfoCard &&
infoCard.SP_VERSION == specification.SP_VERSION); infoCard.SP_VERSION == specification.SP_VERSION);
if(infoCardKsss == null) if (infoCardKsss == null)
{ {
Logger.Info($"Not found info card {nameInfoCard}"); Logger.Info(MessageList.KsssInfoCardNotFound);
return $"Not found info card {nameInfoCard}"; return;
} }
var infoFields = RDnLDbContext.RndtSpIi.Where(infoField => infoField.IC == infoCardKsss.IC && var infoFields = RDnLDbContext.RndtSpIi.Where(infoField => infoField.IC == infoCardKsss.IC &&
infoField.SP == specificationId); infoField.SP == specificationId);
if(infoFields.Count() == 0) if (infoFields.Count() == 0)
{ {
Logger.Info($"There are no info fields on the info card {nameInfoCard}"); Logger.Info(MessageList.KsssInfoCardEmpty);
return $"There are no info fields on the info card {nameInfoCard}"; return;
} }
foreach (var ksssValuePair in ksssDictionary) foreach (var ksssValuePair in ksssDictionary)
{ {
if(ksssValuePair.Key == "SP") if (ksssValuePair.Key == "SP")
{ {
continue; continue;
} }
var foundedInfoField = infoFields.FirstOrDefault(infoField => infoField.II_SHORT_DESC == ksssValuePair.Key); var foundedInfoField = infoFields.FirstOrDefault(infoField => infoField.II_SHORT_DESC == ksssValuePair.Key);
if(foundedInfoField == null) if (foundedInfoField == null)
{ {
continue; continue;
} }
foundedInfoField.IIVALUE = ksssValuePair.Value; var relationValue = GetRelationValue(foundedInfoField, ksssValuePair.Value);
if (string.IsNullOrEmpty(relationValue))
{
foundedInfoField.IIVALUE = ksssValuePair.Value;
}
else
{
foundedInfoField.IIVALUE = relationValue;
}
} }
await RDnLDbContext.SaveChangesAsync(); await RDnLDbContext.SaveChangesAsync();
Logger.Info($"Successfully recorded data on the info card {nameInfoCard}"); Logger.Info(MessageList.SuccessfullyKsssInfoCardRecord);
return $"Successfully recorded data on the info card {nameInfoCard}";
} }
catch (Exception ex)
{
Logger.Error(ex);
}
}
/// <summary>
/// Getting the value relation
/// </summary>
/// <param name="rndtSpIi"></param>
/// <param name="tableValue"></param>
/// <returns></returns>
private string GetRelationValue(RndtSpIi rndtSpIi, string tableValue)
{
string result = string.Empty;
var rndvIpIeAu = RDnLDbContext.RndtIpIeAu.Where(c => c.IE == rndtSpIi.II)
.OrderByDescending(c => c.VERSION)
.FirstOrDefault();
var tableName = rndvIpIeAu?.VALUE;
if (!string.IsNullOrEmpty(tableName) && !string.IsNullOrEmpty(tableValue))
{
var sqlQuery = $"SELECT Name FROM [RndSuite].[{tableName}] WHERE [Id] = @TableId";
var tableId = new SqlParameter("@TableId", tableValue);
result = RDnLDbContext.Database.SqlQueryRaw<string>(sqlQuery, tableId)
.ToList()
.FirstOrDefault();
}
return result;
} }
#endregion
} }
using IntegrationKSSS.WebService.Infrastructure.Data; using IntegrationKSSS.WebService.Infrastructure.Data;
using ILogger = NLog.ILogger; using ILogger = NLog.ILogger;
namespace IntegrationKSSS.WebService.Infrastructure.Repositories namespace IntegrationKSSS.WebService.Infrastructure.Repositories;
/// <summary>
/// A set of variables repository
/// </summary>
public class KsssRepositoryBase
{ {
public class KsssRepositoryBase #region Variables
internal readonly RDnLDbContext RDnLDbContext;
internal readonly ILogger Logger;
#endregion
#region Constructors
public KsssRepositoryBase(RDnLDbContext rDnLDbContext, ILogger logger)
{ {
internal readonly RDnLDbContext RDnLDbContext; RDnLDbContext = rDnLDbContext;
internal readonly ILogger Logger; Logger = logger;
public KsssRepositoryBase(RDnLDbContext rDnLDbContext, ILogger logger) }
{ #endregion
RDnLDbContext = rDnLDbContext; }
Logger = logger; \ No newline at end of file
}
}
}
using IntegrationKSSS.WebService.Infrastructure.Repositories; using IntegrationKSSS.WebService.Infrastructure.Models;
using IntegrationKSSS.WebService.Infrastructure.Repositories;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
namespace IntegrationKSSS.WebService.Infrastructure.RequestHandlers namespace IntegrationKSSS.WebService.Infrastructure.RequestHandlers;
internal static class RequestHandler
{ {
internal static class KsssFunctions /// <summary>
/// KSSS data recording function
/// </summary>
/// <returns></returns>
#region Methods
internal static Func<IKsssRepository, Dictionary<string, string>, Task<IResult>> WriteKsssData()
{ {
internal static Func<IKsssRepository, Dictionary<string, string>, Task<IResult>> WriteKsssData() return [Authorize] async (IKsssRepository ksssRepository, Dictionary<string, string> ksss) =>
{ {
return /*[Authorize] */async (IKsssRepository ksssRepository, Dictionary<string,string> ksss) => await ksssRepository.WriteKsssData(ksss);
{ return Results.Accepted("/api/ksss", MessageList.AcceptedDataPackage);
};
var message = await ksssRepository.WriteKsssData(ksss)/*.ConfigureAwait(false)*/; }
if(message.Contains("Successfully")) #endregion
{ }
return Results.Ok(message); \ No newline at end of file
}
else
{
return Results.BadRequest(message);
}
};
}
}
}
namespace IntegrationKSSS.WebService.Infrastructure.RouteHandlers;
public interface IRouteHandler
{
#region Methods
void Register(WebApplication webApplication);
#endregion
}
\ No newline at end of file
using IntegrationKSSS.WebService.Infrastructure.RequestHandlers; using IntegrationKSSS.WebService.Infrastructure.RequestHandlers;
namespace IntegrationKSSS.WebService.Infrastructure.RouteHandlers namespace IntegrationKSSS.WebService.Infrastructure.RouteHandlers;
public class RouteHandler : RouteHandlerBase, IRouteHandler
{ {
public interface IRouteHandler #region Methods
{ public void Register(WebApplication webApplication)
void Register(WebApplication webApplication);
}
public abstract class KsssRouteHandlerBase
{ {
internal WebApplication WebApplication { get; set; } WebApplication = webApplication;
Creators();
} }
public class RouteHandler : KsssRouteHandlerBase, IRouteHandler private void Creators()
{ {
public void Register(WebApplication webApplication) WebApplication.MapPost("/api/ksss", RequestHandler.WriteKsssData());
{ }
WebApplication = webApplication; #endregion
Creators();
}
private void Creators()
{
WebApplication.MapPost("/api/ksss", KsssFunctions.WriteKsssData());
}
}
} }
namespace IntegrationKSSS.WebService.Infrastructure.RouteHandlers;
public abstract class RouteHandlerBase
{
#region Properties
internal WebApplication WebApplication { get; set; }
#endregion
}
\ No newline at end of file
using IntegrationKSSS.WebService.Infrastructure.Cryptography; using IntegrationKSSS.WebService.Infrastructure.Cryptography;
namespace IntegrationKSSS.WebService.Infrastructure.Services namespace IntegrationKSSS.WebService.Infrastructure.Services;
public class AuthService : IAuthService
{ {
public interface IAuthService #region Methods
public async Task<bool> Auth(string login, string password)
{ {
Task<bool> Auth(string login, string password); string _login = "5WndfpUBeL21vPl1T52S2w==",
} _password = "wK/ZViL6VAYL1FNYO10vLg==";
public class AuthService : IAuthService
{
public async Task<bool> Auth(string login, string password)
{
string _login = "5WndfpUBeL21vPl1T52S2w==",
_password = "wK/ZViL6VAYL1FNYO10vLg==";
return await Task.Run(() => return await Task.Run(() =>
(_login.DecryptString(AesConfiguration.Key, AesConfiguration.IV) == login && (_login.DecryptString(AesConfiguration.Key, AesConfiguration.IV) == login &&
_password.DecryptString(AesConfiguration.Key, AesConfiguration.IV) == password) ? _password.DecryptString(AesConfiguration.Key, AesConfiguration.IV) == password) ?
true : true :
false); false);
} }
} #endregion
} }
\ No newline at end of file
namespace IntegrationKSSS.WebService.Infrastructure.Services;
public interface IAuthService
{
#region Methods
Task<bool> Auth(string login, string password);
#endregion
}
...@@ -29,6 +29,12 @@ ...@@ -29,6 +29,12 @@
<ProjectReference Include="..\IntegrationKSSS\IntegrationKSSS.csproj" /> <ProjectReference Include="..\IntegrationKSSS\IntegrationKSSS.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="RnD.Model.EF">
<HintPath>..\..\..\..\Distr\OpcenterRDnL_9.1.0.0.3\Implementation\ABP\Opcenter_RDnL_V9.1.0.3_applied_best_practices\OpcenterRDnLLibrary_Builds\Siemens.OpcenterRDnLLibrary.Dependencies\RnD.Model.EF.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Content Update="NLog.config"> <Content Update="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
......
...@@ -72,3 +72,255 @@ ...@@ -72,3 +72,255 @@
2023-01-25 13:54:49.7916 Info Registered target FileTarget(Name=logfile) 2023-01-25 13:54:49.7916 Info Registered target FileTarget(Name=logfile)
2023-01-25 13:54:49.7916 Info Registered target ConsoleTarget(Name=logconsole) 2023-01-25 13:54:49.7916 Info Registered target ConsoleTarget(Name=logconsole)
2023-01-25 13:54:49.7916 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config 2023-01-25 13:54:49.7916 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-06 18:16:09.2803 Info Message Template Auto Format enabled
2023-02-06 18:16:09.7546 Info Registered target FileTarget(Name=logfile)
2023-02-06 18:16:09.7546 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-06 18:16:09.8666 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-06 18:16:10.8598 Info Shutdown() called. Logger closing...
2023-02-06 18:16:10.8598 Info Closing old configuration.
2023-02-06 18:16:10.9155 Info Logger has been closed down.
2023-02-06 18:16:10.9992 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-06 18:16:11.0003 Info Message Template Auto Format enabled
2023-02-06 18:16:11.0003 Info Registered target FileTarget(Name=logfile)
2023-02-06 18:16:11.0003 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-06 18:16:11.0003 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:11:43.7222 Info Message Template Auto Format enabled
2023-02-09 14:11:44.3790 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:11:44.3790 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:11:44.4383 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:11:45.5910 Info Shutdown() called. Logger closing...
2023-02-09 14:11:45.5910 Info Closing old configuration.
2023-02-09 14:11:45.6614 Info Logger has been closed down.
2023-02-09 14:11:45.7637 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:11:45.7637 Info Message Template Auto Format enabled
2023-02-09 14:11:45.7637 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:11:45.7637 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:11:45.7637 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:27:37.5933 Info Message Template Auto Format enabled
2023-02-09 14:27:37.9445 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:27:37.9445 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:27:37.9857 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:27:38.5468 Info Shutdown() called. Logger closing...
2023-02-09 14:27:38.5468 Info Closing old configuration.
2023-02-09 14:27:38.5968 Info Logger has been closed down.
2023-02-09 14:27:38.6766 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:27:38.6766 Info Message Template Auto Format enabled
2023-02-09 14:27:38.6766 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:27:38.6766 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:27:38.6766 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:53:08.9608 Info Message Template Auto Format enabled
2023-02-09 14:53:09.2373 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:53:09.2373 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:53:09.2763 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:53:09.5539 Info Shutdown() called. Logger closing...
2023-02-09 14:53:09.5539 Info Closing old configuration.
2023-02-09 14:53:09.5968 Info Logger has been closed down.
2023-02-09 14:53:09.7130 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:53:09.7130 Info Message Template Auto Format enabled
2023-02-09 14:53:09.7146 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:53:09.7146 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:53:09.7146 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:54:47.6686 Info Message Template Auto Format enabled
2023-02-09 14:54:47.8918 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:54:47.8918 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:54:47.9410 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:54:48.2355 Info Shutdown() called. Logger closing...
2023-02-09 14:54:48.2355 Info Closing old configuration.
2023-02-09 14:54:48.2839 Info Logger has been closed down.
2023-02-09 14:54:48.3626 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:54:48.3626 Info Message Template Auto Format enabled
2023-02-09 14:54:48.3626 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:54:48.3626 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:54:48.3626 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:55:43.0805 Info Message Template Auto Format enabled
2023-02-09 14:55:43.4599 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:55:43.4599 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:55:43.5546 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:55:43.9204 Info Shutdown() called. Logger closing...
2023-02-09 14:55:43.9204 Info Closing old configuration.
2023-02-09 14:55:43.9640 Info Logger has been closed down.
2023-02-09 14:55:44.0451 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:55:44.0451 Info Message Template Auto Format enabled
2023-02-09 14:55:44.0451 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:55:44.0451 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:55:44.0451 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:58:27.6023 Info Message Template Auto Format enabled
2023-02-09 14:58:27.8197 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:58:27.8197 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:58:27.8818 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:58:28.1596 Info Shutdown() called. Logger closing...
2023-02-09 14:58:28.1596 Info Closing old configuration.
2023-02-09 14:58:28.2049 Info Logger has been closed down.
2023-02-09 14:58:28.3040 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:58:28.3040 Info Message Template Auto Format enabled
2023-02-09 14:58:28.3040 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:58:28.3040 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:58:28.3040 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:58:58.0541 Info Message Template Auto Format enabled
2023-02-09 14:58:58.3094 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:58:58.3116 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:58:58.3523 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:58:58.6288 Info Shutdown() called. Logger closing...
2023-02-09 14:58:58.6288 Info Closing old configuration.
2023-02-09 14:58:58.6611 Info Logger has been closed down.
2023-02-09 14:58:58.7454 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 14:58:58.7454 Info Message Template Auto Format enabled
2023-02-09 14:58:58.7454 Info Registered target FileTarget(Name=logfile)
2023-02-09 14:58:58.7454 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 14:58:58.7491 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:00:22.7384 Info Message Template Auto Format enabled
2023-02-09 15:00:22.9656 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:00:22.9675 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:00:23.0128 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:00:23.2371 Info Shutdown() called. Logger closing...
2023-02-09 15:00:23.2371 Info Closing old configuration.
2023-02-09 15:00:23.2759 Info Logger has been closed down.
2023-02-09 15:00:23.4387 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:00:23.4387 Info Message Template Auto Format enabled
2023-02-09 15:00:23.4387 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:00:23.4387 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:00:23.4387 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:06:20.2897 Info Message Template Auto Format enabled
2023-02-09 15:06:20.5889 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:06:20.5889 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:06:20.7235 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:06:21.0132 Info Shutdown() called. Logger closing...
2023-02-09 15:06:21.0132 Info Closing old configuration.
2023-02-09 15:06:21.0558 Info Logger has been closed down.
2023-02-09 15:06:21.1848 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:06:21.1848 Info Message Template Auto Format enabled
2023-02-09 15:06:21.1848 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:06:21.1848 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:06:21.1848 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:26:57.8666 Info Message Template Auto Format enabled
2023-02-09 15:26:58.1465 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:26:58.1480 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:26:58.2018 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:26:59.2816 Info Shutdown() called. Logger closing...
2023-02-09 15:26:59.2816 Info Closing old configuration.
2023-02-09 15:26:59.3239 Info Logger has been closed down.
2023-02-09 15:26:59.4015 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:26:59.4015 Info Message Template Auto Format enabled
2023-02-09 15:26:59.4015 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:26:59.4015 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:26:59.4015 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:30:35.2798 Info Message Template Auto Format enabled
2023-02-09 15:30:35.9805 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:30:35.9805 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:30:36.0824 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:30:38.0495 Info Shutdown() called. Logger closing...
2023-02-09 15:30:38.0495 Info Closing old configuration.
2023-02-09 15:30:38.1347 Info Logger has been closed down.
2023-02-09 15:30:38.2684 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:30:38.2684 Info Message Template Auto Format enabled
2023-02-09 15:30:38.2735 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:30:38.2735 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:30:38.2735 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:47:13.0409 Info Message Template Auto Format enabled
2023-02-09 15:47:13.6974 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:47:13.6974 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:47:13.7510 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:47:14.3027 Info Shutdown() called. Logger closing...
2023-02-09 15:47:14.3027 Info Closing old configuration.
2023-02-09 15:47:14.3452 Info Logger has been closed down.
2023-02-09 15:47:14.4310 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:47:14.4310 Info Message Template Auto Format enabled
2023-02-09 15:47:14.4310 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:47:14.4310 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:47:14.4310 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:51:35.0430 Info Message Template Auto Format enabled
2023-02-09 15:51:35.7877 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:51:35.7877 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:51:35.8641 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:51:36.5470 Info Shutdown() called. Logger closing...
2023-02-09 15:51:36.5470 Info Closing old configuration.
2023-02-09 15:51:36.6674 Info Logger has been closed down.
2023-02-09 15:51:36.7554 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 15:51:36.7554 Info Message Template Auto Format enabled
2023-02-09 15:51:36.8684 Info Registered target FileTarget(Name=logfile)
2023-02-09 15:51:36.8684 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 15:51:36.8684 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 16:00:07.1389 Info Message Template Auto Format enabled
2023-02-09 16:00:07.7386 Info Registered target FileTarget(Name=logfile)
2023-02-09 16:00:07.7386 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 16:00:07.7918 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 16:00:08.5599 Info Shutdown() called. Logger closing...
2023-02-09 16:00:08.5665 Info Closing old configuration.
2023-02-09 16:00:08.8071 Info Logger has been closed down.
2023-02-09 16:00:08.8854 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 16:00:08.8854 Info Message Template Auto Format enabled
2023-02-09 16:00:08.8854 Info Registered target FileTarget(Name=logfile)
2023-02-09 16:00:08.8854 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 16:00:08.8854 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 17:50:09.1030 Info Message Template Auto Format enabled
2023-02-09 17:50:09.6618 Info Registered target FileTarget(Name=logfile)
2023-02-09 17:50:09.6618 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 17:50:09.7327 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 17:50:10.7263 Info Shutdown() called. Logger closing...
2023-02-09 17:50:10.7269 Info Closing old configuration.
2023-02-09 17:50:10.7915 Info Logger has been closed down.
2023-02-09 17:50:10.8683 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-09 17:50:10.8683 Info Message Template Auto Format enabled
2023-02-09 17:50:10.8683 Info Registered target FileTarget(Name=logfile)
2023-02-09 17:50:10.8683 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-09 17:50:10.8683 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:10:51.2905 Info Message Template Auto Format enabled
2023-02-10 14:10:51.7115 Info Registered target FileTarget(Name=logfile)
2023-02-10 14:10:51.7115 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-10 14:10:51.7677 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:10:52.7733 Info Shutdown() called. Logger closing...
2023-02-10 14:10:52.7733 Info Closing old configuration.
2023-02-10 14:10:52.8294 Info Logger has been closed down.
2023-02-10 14:10:52.9202 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:10:52.9202 Info Message Template Auto Format enabled
2023-02-10 14:10:52.9202 Info Registered target FileTarget(Name=logfile)
2023-02-10 14:10:52.9202 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-10 14:10:52.9202 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:15:41.1770 Info Message Template Auto Format enabled
2023-02-10 14:15:41.3759 Info Registered target FileTarget(Name=logfile)
2023-02-10 14:15:41.3759 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-10 14:15:41.4168 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:15:41.6594 Info Shutdown() called. Logger closing...
2023-02-10 14:15:41.6594 Info Closing old configuration.
2023-02-10 14:15:41.6971 Info Logger has been closed down.
2023-02-10 14:15:41.8044 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:15:41.8044 Info Message Template Auto Format enabled
2023-02-10 14:15:41.8044 Info Registered target FileTarget(Name=logfile)
2023-02-10 14:15:41.8044 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-10 14:15:41.8091 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:18:17.7214 Info Message Template Auto Format enabled
2023-02-10 14:18:18.1258 Info Registered target FileTarget(Name=logfile)
2023-02-10 14:18:18.1258 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-10 14:18:18.1813 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:18:18.4271 Info Shutdown() called. Logger closing...
2023-02-10 14:18:18.4271 Info Closing old configuration.
2023-02-10 14:18:18.4664 Info Logger has been closed down.
2023-02-10 14:18:18.5547 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:18:18.5547 Info Message Template Auto Format enabled
2023-02-10 14:18:18.5547 Info Registered target FileTarget(Name=logfile)
2023-02-10 14:18:18.5547 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-10 14:18:18.5547 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:26:13.8540 Info Message Template Auto Format enabled
2023-02-10 14:26:14.0652 Info Registered target FileTarget(Name=logfile)
2023-02-10 14:26:14.0652 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-10 14:26:14.1010 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:26:14.3377 Info Shutdown() called. Logger closing...
2023-02-10 14:26:14.3377 Info Closing old configuration.
2023-02-10 14:26:14.3776 Info Logger has been closed down.
2023-02-10 14:26:14.4911 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:26:14.4911 Info Message Template Auto Format enabled
2023-02-10 14:26:14.4911 Info Registered target FileTarget(Name=logfile)
2023-02-10 14:26:14.4911 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-10 14:26:14.4911 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:28:30.1937 Info Message Template Auto Format enabled
2023-02-10 14:28:30.5134 Info Registered target FileTarget(Name=logfile)
2023-02-10 14:28:30.5134 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-10 14:28:30.5533 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:28:30.7965 Info Shutdown() called. Logger closing...
2023-02-10 14:28:30.7965 Info Closing old configuration.
2023-02-10 14:28:30.8312 Info Logger has been closed down.
2023-02-10 14:28:30.9295 Info Loading NLog config from XML file: C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
2023-02-10 14:28:30.9295 Info Message Template Auto Format enabled
2023-02-10 14:28:30.9295 Info Registered target FileTarget(Name=logfile)
2023-02-10 14:28:30.9295 Info Registered target ConsoleTarget(Name=logconsole)
2023-02-10 14:28:30.9295 Info Validating config: TargetNames=logfile, logconsole, ConfigItems=25, FilePath=C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\NLog.config
...@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. ...@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<History>True|2023-01-26T11:17:24.0239724Z;True|2023-01-25T14:06:16.9243865+03:00;True|2023-01-25T14:00:39.9266437+03:00;True|2023-01-25T12:51:23.5799247+03:00;True|2023-01-25T12:35:08.8563117+03:00;False|2023-01-25T12:34:04.6686340+03:00;False|2023-01-25T12:33:57.8005398+03:00;False|2023-01-25T12:33:39.5203110+03:00;</History> <History>True|2023-02-10T11:33:33.5625719Z;True|2023-02-09T18:01:25.0874999+03:00;True|2023-02-09T16:04:11.0766065+03:00;True|2023-01-26T14:17:24.0239724+03:00;True|2023-01-25T14:06:16.9243865+03:00;True|2023-01-25T14:00:39.9266437+03:00;True|2023-01-25T12:51:23.5799247+03:00;True|2023-01-25T12:35:08.8563117+03:00;False|2023-01-25T12:34:04.6686340+03:00;False|2023-01-25T12:33:57.8005398+03:00;False|2023-01-25T12:33:39.5203110+03:00;</History>
<LastFailureDetails /> <LastFailureDetails />
<_PublishTargetUrl>C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Release\net6.0\publish\</_PublishTargetUrl> <_PublishTargetUrl>C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Release\net6.0\publish\</_PublishTargetUrl>
</PropertyGroup> </PropertyGroup>
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
"NLog.Config": "4.7.15", "NLog.Config": "4.7.15",
"NLog.Web.AspNetCore": "5.2.0", "NLog.Web.AspNetCore": "5.2.0",
"Newtonsoft.Json": "13.0.2", "Newtonsoft.Json": "13.0.2",
"Swashbuckle.AspNetCore": "6.2.3" "Swashbuckle.AspNetCore": "6.2.3",
"RnD.Model.EF": "9.1.0.0"
}, },
"runtime": { "runtime": {
"IntegrationKSSS.WebService.dll": {} "IntegrationKSSS.WebService.dll": {}
...@@ -804,6 +805,30 @@ ...@@ -804,6 +805,30 @@
"runtime": { "runtime": {
"IntegrationKSSS.dll": {} "IntegrationKSSS.dll": {}
} }
},
"RnD.Model.EF/9.1.0.0": {
"runtime": {
"RnD.Model.EF.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
},
"RnD.Common/9.1.0.0": {
"runtime": {
"RnD.Common.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
},
"RDnL.Logger/9.1.0.0": {
"runtime": {
"RDnL.Logger.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
} }
} }
}, },
...@@ -1377,6 +1402,21 @@ ...@@ -1377,6 +1402,21 @@
"type": "project", "type": "project",
"serviceable": false, "serviceable": false,
"sha512": "" "sha512": ""
},
"RnD.Model.EF/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"RnD.Common/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"RDnL.Logger/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
} }
} }
} }
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
"NLog.Config": "4.7.15", "NLog.Config": "4.7.15",
"NLog.Web.AspNetCore": "5.2.0", "NLog.Web.AspNetCore": "5.2.0",
"Newtonsoft.Json": "13.0.2", "Newtonsoft.Json": "13.0.2",
"Swashbuckle.AspNetCore": "6.2.3" "Swashbuckle.AspNetCore": "6.2.3",
"RnD.Model.EF": "9.1.0.0"
}, },
"runtime": { "runtime": {
"IntegrationKSSS.WebService.dll": {} "IntegrationKSSS.WebService.dll": {}
...@@ -804,6 +805,30 @@ ...@@ -804,6 +805,30 @@
"runtime": { "runtime": {
"IntegrationKSSS.dll": {} "IntegrationKSSS.dll": {}
} }
},
"RnD.Model.EF/9.1.0.0": {
"runtime": {
"RnD.Model.EF.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
},
"RnD.Common/9.1.0.0": {
"runtime": {
"RnD.Common.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
},
"RDnL.Logger/9.1.0.0": {
"runtime": {
"RDnL.Logger.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
} }
} }
}, },
...@@ -1377,6 +1402,21 @@ ...@@ -1377,6 +1402,21 @@
"type": "project", "type": "project",
"serviceable": false, "serviceable": false,
"sha512": "" "sha512": ""
},
"RnD.Model.EF/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"RnD.Common/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"RDnL.Logger/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
} }
} }
} }
\ No newline at end of file
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
"NLog.Config": "4.7.15", "NLog.Config": "4.7.15",
"NLog.Web.AspNetCore": "5.2.0", "NLog.Web.AspNetCore": "5.2.0",
"Newtonsoft.Json": "13.0.2", "Newtonsoft.Json": "13.0.2",
"Swashbuckle.AspNetCore": "6.2.3" "Swashbuckle.AspNetCore": "6.2.3",
"RnD.Model.EF": "9.1.0.0"
}, },
"runtime": { "runtime": {
"IntegrationKSSS.WebService.dll": {} "IntegrationKSSS.WebService.dll": {}
...@@ -772,6 +773,30 @@ ...@@ -772,6 +773,30 @@
"runtime": { "runtime": {
"IntegrationKSSS.dll": {} "IntegrationKSSS.dll": {}
} }
},
"RnD.Model.EF/9.1.0.0": {
"runtime": {
"RnD.Model.EF.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
},
"RnD.Common/9.1.0.0": {
"runtime": {
"RnD.Common.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
},
"RDnL.Logger/9.1.0.0": {
"runtime": {
"RDnL.Logger.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
} }
} }
}, },
...@@ -1345,6 +1370,21 @@ ...@@ -1345,6 +1370,21 @@
"type": "project", "type": "project",
"serviceable": false, "serviceable": false,
"sha512": "" "sha512": ""
},
"RnD.Model.EF/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"RnD.Common/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"RDnL.Logger/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
} }
} }
} }
\ No newline at end of file
...@@ -87,3 +87,9 @@ C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6. ...@@ -87,3 +87,9 @@ C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\NLog.dll C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\NLog.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\NLog.Extensions.Logging.dll C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\NLog.Extensions.Logging.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\NLog.Web.AspNetCore.dll C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\NLog.Web.AspNetCore.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\RnD.Model.EF.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\RnD.Common.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\RDnL.Logger.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\RnD.Model.EF.pdb
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\RnD.Common.pdb
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Debug\net6.0\RDnL.Logger.pdb
...@@ -87,3 +87,9 @@ C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net ...@@ -87,3 +87,9 @@ C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\IntegrationKSSS.WebService.pdb C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\IntegrationKSSS.WebService.pdb
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\IntegrationKSSS.WebService.genruntimeconfig.cache C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\IntegrationKSSS.WebService.genruntimeconfig.cache
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\ref\IntegrationKSSS.WebService.dll C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\ref\IntegrationKSSS.WebService.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Release\net6.0\RnD.Model.EF.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Release\net6.0\RnD.Common.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Release\net6.0\RDnL.Logger.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Release\net6.0\RnD.Model.EF.pdb
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Release\net6.0\RnD.Common.pdb
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\bin\Release\net6.0\RDnL.Logger.pdb
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
"NLog.Config": "4.7.15", "NLog.Config": "4.7.15",
"NLog.Web.AspNetCore": "5.2.0", "NLog.Web.AspNetCore": "5.2.0",
"Newtonsoft.Json": "13.0.2", "Newtonsoft.Json": "13.0.2",
"Swashbuckle.AspNetCore": "6.2.3" "Swashbuckle.AspNetCore": "6.2.3",
"RnD.Model.EF": "9.1.0.0"
}, },
"runtime": { "runtime": {
"IntegrationKSSS.WebService.dll": {} "IntegrationKSSS.WebService.dll": {}
...@@ -772,6 +773,30 @@ ...@@ -772,6 +773,30 @@
"runtime": { "runtime": {
"IntegrationKSSS.dll": {} "IntegrationKSSS.dll": {}
} }
},
"RnD.Model.EF/9.1.0.0": {
"runtime": {
"RnD.Model.EF.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
},
"RnD.Common/9.1.0.0": {
"runtime": {
"RnD.Common.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
},
"RDnL.Logger/9.1.0.0": {
"runtime": {
"RDnL.Logger.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
} }
} }
}, },
...@@ -1345,6 +1370,21 @@ ...@@ -1345,6 +1370,21 @@
"type": "project", "type": "project",
"serviceable": false, "serviceable": false,
"sha512": "" "sha512": ""
},
"RnD.Model.EF/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"RnD.Common/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"RDnL.Logger/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
} }
} }
} }
\ No newline at end of file
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
"NLog.Config": "4.7.15", "NLog.Config": "4.7.15",
"NLog.Web.AspNetCore": "5.2.0", "NLog.Web.AspNetCore": "5.2.0",
"Newtonsoft.Json": "13.0.2", "Newtonsoft.Json": "13.0.2",
"Swashbuckle.AspNetCore": "6.2.3" "Swashbuckle.AspNetCore": "6.2.3",
"RnD.Model.EF": "9.1.0.0"
}, },
"runtime": { "runtime": {
"IntegrationKSSS.WebService.dll": {} "IntegrationKSSS.WebService.dll": {}
...@@ -772,6 +773,30 @@ ...@@ -772,6 +773,30 @@
"runtime": { "runtime": {
"IntegrationKSSS.dll": {} "IntegrationKSSS.dll": {}
} }
},
"RnD.Model.EF/9.1.0.0": {
"runtime": {
"RnD.Model.EF.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
},
"RnD.Common/9.1.0.0": {
"runtime": {
"RnD.Common.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
},
"RDnL.Logger/9.1.0.0": {
"runtime": {
"RDnL.Logger.dll": {
"assemblyVersion": "9.1.0.0",
"fileVersion": "901.0.300.11"
}
}
} }
} }
}, },
...@@ -1345,6 +1370,21 @@ ...@@ -1345,6 +1370,21 @@
"type": "project", "type": "project",
"serviceable": false, "serviceable": false,
"sha512": "" "sha512": ""
},
"RnD.Model.EF/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"RnD.Common/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"RDnL.Logger/9.1.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
} }
} }
} }
\ No newline at end of file
...@@ -64,5 +64,11 @@ C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net ...@@ -64,5 +64,11 @@ C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\runtimes\browser\lib\net6.0\System.Text.Encodings.Web.dll C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\runtimes\browser\lib\net6.0\System.Text.Encodings.Web.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\runtimes\win\lib\netcoreapp3.0\System.Windows.Extensions.dll C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\runtimes\win\lib\netcoreapp3.0\System.Windows.Extensions.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\IntegrationKSSS.dll C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\IntegrationKSSS.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\RnD.Model.EF.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\RnD.Common.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\RDnL.Logger.dll
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\IntegrationKSSS.pdb C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\IntegrationKSSS.pdb
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\RnD.Model.EF.pdb
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\RnD.Common.pdb
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\RDnL.Logger.pdb
C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\IntegrationKSSS.WebService.deps.json C:\Bryzgalov\Projects\IntegrationKSSS\IntegrationKSSS.WebService\obj\Release\net6.0\PubTmp\Out\IntegrationKSSS.WebService.deps.json
...@@ -77,3 +77,41 @@ ...@@ -77,3 +77,41 @@
2.0 2.0
2.0 2.0
2.0 2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
...@@ -11,6 +11,9 @@ using System.Linq; ...@@ -11,6 +11,9 @@ using System.Linq;
namespace IntegrationKSSS.RDnL.ActionBarButtons namespace IntegrationKSSS.RDnL.ActionBarButtons
{ {
/// <summary>
/// Custom export KSSS button class
/// </summary>
[CustomFunction("IntegrationKSSSutomActionBar")] [CustomFunction("IntegrationKSSSutomActionBar")]
public class ExportKsssActionBarButton : AdvancedCustomFunction, ICustomActionBarButton public class ExportKsssActionBarButton : AdvancedCustomFunction, ICustomActionBarButton
{ {
...@@ -20,6 +23,11 @@ namespace IntegrationKSSS.RDnL.ActionBarButtons ...@@ -20,6 +23,11 @@ namespace IntegrationKSSS.RDnL.ActionBarButtons
#endregion #endregion
#region Methods #region Methods
/// <summary>
/// On click button event
/// </summary>
/// <param name="aCustomisationObject"></param>
/// <returns></returns>
public ActionBarButtonResult Execute(List<ICustomizationObject> aCustomisationObject) public ActionBarButtonResult Execute(List<ICustomizationObject> aCustomisationObject)
{ {
if (!(aCustomisationObject.FirstOrDefault(c => c is ISpecification) is ISpecification specificationEntity)) if (!(aCustomisationObject.FirstOrDefault(c => c is ISpecification) is ISpecification specificationEntity))
...@@ -31,9 +39,13 @@ namespace IntegrationKSSS.RDnL.ActionBarButtons ...@@ -31,9 +39,13 @@ namespace IntegrationKSSS.RDnL.ActionBarButtons
}; };
} }
var specification = API.Specification.GetSpecification(specificationEntity.ID, specificationEntity.Version); var specification = API.Specification.GetSpecification(specificationEntity.ID, specificationEntity.Version);
return KsssService.ExportKsss(specification);
return KsssService.ExportKsss(specification, DatabaseContext);
} }
/// <summary>
/// Button properties
/// </summary>
/// <returns></returns>
public ActionBarButtonMetadata GetActionBarButtonMetadata() => new ActionBarButtonMetadata public ActionBarButtonMetadata GetActionBarButtonMetadata() => new ActionBarButtonMetadata
{ {
Description = "Передать ПК в КССС", Description = "Передать ПК в КССС",
......
...@@ -3,8 +3,10 @@ using Newtonsoft.Json; ...@@ -3,8 +3,10 @@ using Newtonsoft.Json;
using NLog; using NLog;
using RnD.Common.Model.ActionBarButtons; using RnD.Common.Model.ActionBarButtons;
using RnD.Model; using RnD.Model;
using RnD.Model.EF;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data.SqlClient;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
...@@ -24,6 +26,9 @@ namespace IntegrationKSSS.Services ...@@ -24,6 +26,9 @@ namespace IntegrationKSSS.Services
private const string _ksssDataInfoCard = "KSSS_Data"; private const string _ksssDataInfoCard = "KSSS_Data";
private const string _ksssInsertInfoField = "KSSS_Insert"; private const string _ksssInsertInfoField = "KSSS_Insert";
private const string _ksssServiceInfoField = "KSSS_KSSS"; private const string _ksssServiceInfoField = "KSSS_KSSS";
private const string _ksssStatusInfoField = "KSSS_Status";
private static RnDConnection _dbConnection;
#endregion #endregion
#region Methods #region Methods
...@@ -32,14 +37,18 @@ namespace IntegrationKSSS.Services ...@@ -32,14 +37,18 @@ namespace IntegrationKSSS.Services
/// </summary> /// </summary>
/// <param name="specification"></param> /// <param name="specification"></param>
/// <returns></returns> /// <returns></returns>
internal static ActionBarButtonResult ExportKsss(ISpecification specification) internal static ActionBarButtonResult ExportKsss(ISpecification specification, RnDConnection dbConnection)
{ {
_dbConnection = dbConnection;
var logger = LogManager.GetCurrentClassLogger(); var logger = LogManager.GetCurrentClassLogger();
var infoCardKsss = specification.InfoCards.FirstOrDefault(c => c.ShortDescription.Contains(_ksssPrefix) && var infoCardKsss = specification.InfoCards.FirstOrDefault(c => c.ShortDescription.Contains(_ksssPrefix) &&
c.ShortDescription != _ksssDataInfoCard); c.ShortDescription != _ksssDataInfoCard);
var ksssStatusInfoField = infoCardKsss.InfoFields.FirstOrDefault(c => c.ShortDescription == _ksssStatusInfoField);
if (infoCardKsss == null) if (infoCardKsss == null)
{ {
logger.Error(MessageList.KsssInfoCardMissing.Eng); logger.Error(MessageList.KsssInfoCardMissing.Eng);
ksssStatusInfoField.InfoFieldValue = "Failed";
return new ActionBarButtonResult return new ActionBarButtonResult
{ {
Message = MessageList.KsssInfoCardMissing.Rus, Message = MessageList.KsssInfoCardMissing.Rus,
...@@ -47,22 +56,23 @@ namespace IntegrationKSSS.Services ...@@ -47,22 +56,23 @@ namespace IntegrationKSSS.Services
}; };
} }
var infoFieldKsssInsert = infoCardKsss.InfoFields.FirstOrDefault(c => c.ShortDescription == _ksssInsertInfoField); var ksssInsertInfoField = infoCardKsss.InfoFields.FirstOrDefault(c => c.ShortDescription == _ksssInsertInfoField);
var ksssServiceInfoField = infoCardKsss.InfoFields.FirstOrDefault(c => c.ShortDescription == _ksssServiceInfoField); var ksssServiceInfoField = infoCardKsss.InfoFields.FirstOrDefault(c => c.ShortDescription == _ksssServiceInfoField);
bool isKsssServiceEmpty = string.IsNullOrEmpty(ksssServiceInfoField?.InfoFieldValue); bool isKsssServiceEmpty = string.IsNullOrEmpty(ksssServiceInfoField?.InfoFieldValue);
bool ksssInsert = infoFieldKsssInsert?.InfoFieldValue == _trueValue; bool ksssInsert = ksssInsertInfoField?.InfoFieldValue == _trueValue;
var ksssActionValue = GetKsssActionValue(isKsssServiceEmpty, ksssInsert); var ksssActionValue = GetKsssActionValue(isKsssServiceEmpty, ksssInsert);
var ksssDictionary = new Dictionary<string, string>(); var ksssDictionary = new Dictionary<string, string>();
ksssDictionary.Add(_spKey, $"{specification.ID}"); ksssDictionary.Add(_spKey, $"{specification.ID}");
ksssDictionary.Add(_guidKey, $"{Guid.NewGuid()}"); ksssDictionary.Add(_guidKey, $"{Guid.NewGuid()}");
ksssDictionary.Add(_actionKey, ksssActionValue); ksssDictionary.Add(_actionKey, ksssActionValue);
if (isKsssServiceEmpty) if (isKsssServiceEmpty)
{ {
FillKsss(infoCardKsss, ksssDictionary); FillKsss(infoCardKsss, ref ksssDictionary);
} }
else else
{ {
if (!ksssInsert) if (!ksssInsert)
{ {
...@@ -70,7 +80,7 @@ namespace IntegrationKSSS.Services ...@@ -70,7 +80,7 @@ namespace IntegrationKSSS.Services
} }
else else
{ {
FillKsss(infoCardKsss, ksssDictionary); FillKsss(infoCardKsss, ref ksssDictionary);
} }
} }
...@@ -79,6 +89,7 @@ namespace IntegrationKSSS.Services ...@@ -79,6 +89,7 @@ namespace IntegrationKSSS.Services
var xmlFile = Serialization(ksssDictionary, saveFilePath); var xmlFile = Serialization(ksssDictionary, saveFilePath);
logger.Info(MessageList.KsssSaved.Eng); logger.Info(MessageList.KsssSaved.Eng);
ksssStatusInfoField.InfoFieldValue = "Success";
return new ActionBarButtonResult return new ActionBarButtonResult
{ {
Message = MessageList.KsssSaved.Rus, Message = MessageList.KsssSaved.Rus,
...@@ -90,14 +101,26 @@ namespace IntegrationKSSS.Services ...@@ -90,14 +101,26 @@ namespace IntegrationKSSS.Services
/// </summary> /// </summary>
/// <param name="infoCardKsss"></param> /// <param name="infoCardKsss"></param>
/// <param name="ksssDictionary"></param> /// <param name="ksssDictionary"></param>
private static void FillKsss(IInfoCard infoCardKsss, Dictionary<string, string> ksssDictionary) private static void FillKsss(IInfoCard infoCardKsss, ref Dictionary<string, string> ksssDictionary)
{ {
var exceptionInfoFields = new List<string> { "KSSS_Insert", "KSSS_Status" }; var exceptionInfoFields = new List<string> { "KSSS_Insert", "KSSS_Status", "KSSS_Density" };
var infoFields = infoCardKsss.InfoFields.Where(c => c.ShortDescription is string description &&
description.Contains(_ksssPrefix) && !exceptionInfoFields.Contains(description));
infoCardKsss.InfoFields.Where(c => c.ShortDescription is string description && foreach (var infoField in infoFields)
description.Contains(_ksssPrefix) && !exceptionInfoFields.Contains(description)) {
.ToList() var value = infoField.InfoFieldValue ?? string.Empty;
.ForEach(infoField => ksssDictionary.Add(infoField.ShortDescription, infoField.InfoFieldValue)); var relationId = GetRelationId(infoField);
if (relationId != null)
{
ksssDictionary.Add(infoField.ShortDescription, $"{relationId}");
}
else
{
ksssDictionary.Add(infoField.ShortDescription, value);
}
}
} }
/// <summary> /// <summary>
/// Choice action type /// Choice action type
...@@ -151,6 +174,22 @@ namespace IntegrationKSSS.Services ...@@ -151,6 +174,22 @@ namespace IntegrationKSSS.Services
jsonSerializer.Serialize(jw, ksss); jsonSerializer.Serialize(jw, ksss);
return new FileInfo(saveFilePath); return new FileInfo(saveFilePath);
} }
private static int? GetRelationId(IInfoField infoField)
{
int? result = null;
var rndvIpIeAu = _dbConnection.RndvIpIeAu.Where(c => c.IE == infoField.ID).OrderByDescending(c => c.VERSION).FirstOrDefault();
var tableName = rndvIpIeAu?.VALUE;
var tableValue = infoField.InfoFieldValue;
if (!string.IsNullOrEmpty(tableName) && !string.IsNullOrEmpty(tableValue))
{
var sqlQuery = $"SELECT Id FROM [RndSuite].[{tableName}] WHERE [Name] = @Name";
var sqlParam = new SqlParameter("@Name", tableValue);
result = _dbConnection.Database.SqlQuery<int>(sqlQuery, sqlParam).FirstOrDefault();
}
return result;
}
#endregion #endregion
} }
} }
666b970c4f55110dc82d69c167f510ea1ff25b8e dbffb6a084ffde9989e025e8a551a24b08a349b1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment