Корректировка имен колонок в АИХ ИТ
This commit is contained in:
@@ -3,5 +3,6 @@
|
||||
public interface ISyncher
|
||||
{
|
||||
Task InvokeAsync();
|
||||
Task InvokeFromDatabase();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -3,10 +3,11 @@ using MailKit.Search;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MimeKit;
|
||||
using PARR.AIHIT.Context;
|
||||
using PARR.AIHIT.Settings;
|
||||
using PARR.DAL.Contracts;
|
||||
using PARR.DAL.Extensions;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
using PARR.Mail.Services;
|
||||
using System.Text;
|
||||
@@ -209,6 +210,31 @@ namespace PARR.AIHIT
|
||||
}
|
||||
}
|
||||
|
||||
public async Task InvokeFromDatabase()
|
||||
{
|
||||
//call procedure
|
||||
using (AIHContext db = new AIHContext())
|
||||
{
|
||||
var zo = new Microsoft.Data.SqlClient.SqlParameter
|
||||
{
|
||||
ParameterName = "@зо",
|
||||
SqlDbType = System.Data.SqlDbType.NVarChar,
|
||||
Direction = System.Data.ParameterDirection.Input,
|
||||
Size = 60,
|
||||
Value = "96-ДВС"
|
||||
};
|
||||
//.EKs.FromSql("exec sp_IPP_PARR_PTK_get_EK '88-КРАСН'");
|
||||
//.ToList();
|
||||
//db.Database.ExecuteSqlRaw("mao2.dbo.sp_IPP_PARR_PTK_get_EK @userName", param);
|
||||
//var isConExist = db.ex
|
||||
//var result = await db.Database.ExecuteSqlRawAsync("mao2.dbo.sp_IPP_PARR_PTK_get_EK @зо", zo);
|
||||
//WORK!!!!db.EKs.FromSql($"EXEC mao2.dbo.sp_IPP_PARR_PTK_get_EK '88-КРАСН'").ToList();
|
||||
var result = db.EKs.FromSqlRaw($"EXEC mao2.dbo.sp_IPP_PARR_PTK_get_EK @зо", zo).ToList();
|
||||
}
|
||||
|
||||
//get raw data
|
||||
//save data
|
||||
}
|
||||
private async Task SyncApplicationAndHostAsync(V1_Host? host, List<V1_Application> hostApplications, bool isUpdateDateModified = false)
|
||||
{
|
||||
var isUpdated = false;
|
||||
@@ -346,7 +372,7 @@ namespace PARR.AIHIT
|
||||
return null;
|
||||
}
|
||||
|
||||
var app = new DAL.Models.V1_Application
|
||||
var app = new DAL.Models.V1.V1_Application
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Name = appName.Trim(),
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using PARR.AIHIT.Context;
|
||||
using PARR.AIHIT.Settings;
|
||||
|
||||
namespace PARR.AIHIT
|
||||
@@ -15,6 +17,11 @@ namespace PARR.AIHIT
|
||||
services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
|
||||
|
||||
services.AddTransient<ISyncher, Syncher>();
|
||||
|
||||
//services.AddDbContext <AIHContext> (options =>
|
||||
//{
|
||||
// options.UseSqlServer("server=(10.248.19.97);uid=awhit-ipp-parr;pwd=ET3h$9y1LH#D");
|
||||
//});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user