From ab0cb001a498b972f7fba644490006ffa78e507d Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 22 Jun 2021 09:40:20 +0200 Subject: [PATCH 1/8] update nav menu --- GWMS.UI/Shared/NavMenu.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GWMS.UI/Shared/NavMenu.razor b/GWMS.UI/Shared/NavMenu.razor index 5e671bc..678df4d 100644 --- a/GWMS.UI/Shared/NavMenu.razor +++ b/GWMS.UI/Shared/NavMenu.razor @@ -43,7 +43,7 @@ From 449ba86a53c136a5667fda058b819066bcaaa558 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 22 Jun 2021 09:40:32 +0200 Subject: [PATCH 2/8] Bozza pagina impianto --- GWMS.UI/GWMS.UI.csproj | 9 + GWMS.UI/Pages/GasStation.razor | 136 +++++++++++++ GWMS.UI/Pages/GasStation.razor.cs | 314 ++++++++++++++++++++++++++++++ 3 files changed, 459 insertions(+) create mode 100644 GWMS.UI/Pages/GasStation.razor create mode 100644 GWMS.UI/Pages/GasStation.razor.cs diff --git a/GWMS.UI/GWMS.UI.csproj b/GWMS.UI/GWMS.UI.csproj index 7a1c719..353cd6c 100644 --- a/GWMS.UI/GWMS.UI.csproj +++ b/GWMS.UI/GWMS.UI.csproj @@ -30,6 +30,15 @@ + + + Transporters - Copy.razor.cs + + + Transporters.razor.cs + + + diff --git a/GWMS.UI/Pages/GasStation.razor b/GWMS.UI/Pages/GasStation.razor new file mode 100644 index 0000000..1cf6783 --- /dev/null +++ b/GWMS.UI/Pages/GasStation.razor @@ -0,0 +1,136 @@ +@page "/GasStation" + +@using Blazorise.Components +@using GWMS.UI.Components + +
+
+
+
+
+
+ In Consegna +
+
+ +
+
+ +
+
+
+
+ @if (showFiltTime) + { +
+
+
+ +
+
+
+
+ +
+
+
+ } + + @if (showFiltDest) + { +
+
+
+
+ + + +
+ +
+
+ @*
+
+
+ + + +
+ +
+
*@ +
+ } +
+
+
+
+ @if (currRecord != null) + { + + } + @if (ListRecords == null) + { + + } + else if (totalCount == 0) + { +
Nessun record trovato
+ } + else + { +
+
+ + + + + + + + + + @foreach (var record in ListRecords) + { + + + + + + } + +
ImpiantoQta
+
@record.Plant.PlantCode | @record.Plant.PlantDesc
+
@record.OrderDesc
+
+
+ @record.OrderQty.ToString("N0") +
+
@record.DtETA.ToString("yyyy.MM.dd")
+
@record.DtETA.ToString("ddd HH:mm.ss")
+
+
+
+ } +
+ +
\ No newline at end of file diff --git a/GWMS.UI/Pages/GasStation.razor.cs b/GWMS.UI/Pages/GasStation.razor.cs new file mode 100644 index 0000000..b066102 --- /dev/null +++ b/GWMS.UI/Pages/GasStation.razor.cs @@ -0,0 +1,314 @@ +using GWMS.Data.DatabaseModels; +using GWMS.Data.DTO; +using GWMS.UI.Data; +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace GWMS.UI.Pages +{ + public partial class GasStation : ComponentBase, IDisposable + { + #region Private Fields + + private OrderModel currRecord = null; + + private List ListRecords; + private List PlantsList; + private List SearchRecords; + private List TransportersList; + + #endregion Private Fields + + #region Private Properties + + private int _currPage { get; set; } = 1; + + private int _numRecord { get; set; } = 10; + + private int currPage + { + get => _currPage; + set + { + if (_currPage != value) + { + _currPage = value; + var pUpd = Task.Run(async () => await ReloadData()); + pUpd.Wait(); + } + } + } + + private bool isLoading { get; set; } = false; + + private int numRecord + { + get => _numRecord; + set + { + if (_numRecord != value) + { + _numRecord = value; + var pUpd = Task.Run(async () => await ReloadData()); + pUpd.Wait(); + } + } + } + + private int SelPlantId + { + get + { + int answ = 0; + if (MessageService.Order_Filter != null) + { + answ = MessageService.Order_Filter.PlantId; + } + return answ; + } + set + { + if (!MessageService.Order_Filter.PlantId.Equals(value)) + { + MessageService.Order_Filter.PlantId = value; + var pUpd = Task.Run(async () => await ReloadData()); + pUpd.Wait(); + } + } + } + + private int SelTranspId + { + get + { + int answ = 0; + if (MessageService.Order_Filter != null) + { + answ = MessageService.Order_Filter.TransporterId; + } + return answ; + } + set + { + if (!MessageService.Order_Filter.TransporterId.Equals(value)) + { + MessageService.Order_Filter.TransporterId = value; + var pUpd = Task.Run(async () => await ReloadData()); + pUpd.Wait(); + } + } + } + + private bool ShowCharts { get; set; } = false; + + #endregion Private Properties + + #region Protected Properties + + [Inject] + protected GWMSDataService DataService { get; set; } + + protected DateTime DateEnd + { + get + { + DateTime answ = DateTime.Today.AddDays(1); + if (MessageService.Order_Filter != null) + { + answ = MessageService.Order_Filter.DateEnd; + } + return answ; + } + set + { + if (!MessageService.Order_Filter.DateEnd.Equals(value)) + { + MessageService.Order_Filter.DateEnd = value; + var pUpd = Task.Run(async () => await ReloadData()); + pUpd.Wait(); + } + } + } + + protected DateTime DateStart + { + get + { + DateTime answ = DateTime.Today.AddDays(-1); + if (MessageService.Order_Filter != null) + { + answ = MessageService.Order_Filter.DateStart; + } + return answ; + } + set + { + if (!MessageService.Order_Filter.DateStart.Equals(value)) + { + MessageService.Order_Filter.DateStart = value; + var pUpd = Task.Run(async () => await ReloadData()); + pUpd.Wait(); + } + } + } + + [Inject] + protected IJSRuntime JSRuntime { get; set; } + + [Inject] + protected MessageService MessageService { get; set; } + + [Inject] + protected NavigationManager NavManager { get; set; } + + protected bool showFiltDest { get; set; } = false; + + protected bool showFiltTime { get; set; } = false; + + protected int totalCount + { + get + { + int answ = 0; + if (SearchRecords != null) + { + answ = SearchRecords.Count; + } + return answ; + } + } + + #endregion Protected Properties + + #region Private Methods + + private void OnDateEndChanged(DateTime? date) + { + DateEnd = (DateTime)date; + } + + private void OnDateStartChanged(DateTime? date) + { + DateStart = (DateTime)date; + } + + private async Task ReloadData() + { + isLoading = true; + SearchRecords = await DataService.OrdersGetFilt(MessageService.Order_Filter); + ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + isLoading = false; + } + + #endregion Private Methods + + #region Protected Methods + + protected void Edit(OrderModel selRecord) + { + currRecord = selRecord; + } + + protected void ForceReload(int newNum) + { + numRecord = newNum; + } + + protected void ForceReloadPage(int newNum) + { + currPage = newNum; + } + + protected override async Task OnInitializedAsync() + { + MessageService.ShowSearch = false; + MessageService.PageName = "Fornitore"; + MessageService.PageIcon = "fas fa-industry pr-2"; + MessageService.EA_SearchUpdated += OnSeachUpdated; + await ReloadAllData(); + } + + protected async Task ReloadAllData() + { + PlantsList = await DataService.PlantsGetAll(); + TransportersList = await DataService.TransportersGetFilt(0); + await ReloadData(); + } + + protected void ResetData() + { + DataService.rollBackEdit(currRecord); + currRecord = null; + } + + protected async Task ResetFilter(SelectOrderData newFilter) + { + currRecord = null; + SearchRecords = null; + ListRecords = null; + MessageService.Order_Filter = SelectOrderData.Init(5, 7); + await ReloadAllData(); + } + + protected void Select(OrderModel selRecord) + { + // applico filtro da selezione + currRecord = selRecord; + } + + protected void ToggleFiltDest() + { + showFiltDest = !showFiltDest; + } + + protected void ToggleFiltPeriod() + { + showFiltTime = !showFiltTime; + } + + protected async Task UpdateData() + { + currRecord = null; + await ReloadData(); + } + + #endregion Protected Methods + + #region Public Methods + + public string checkSelect(int OrderId) + { + string answ = ""; + if (currRecord != null) + { + try + { + answ = (currRecord.OrderId == OrderId) ? "table-info" : ""; + } + catch + { } + } + return answ; + } + + public void Dispose() + { + MessageService.EA_SearchUpdated -= OnSeachUpdated; + } + + public async void OnSeachUpdated() + { + await InvokeAsync(() => + { + Task task = UpdateData(); + StateHasChanged(); + }); + } + + #endregion Public Methods + } +} \ No newline at end of file From 392a7832e7b6b015181c733f52f36f75dce21180 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 22 Jun 2021 13:22:09 +0200 Subject: [PATCH 3/8] Bozza pagina, manca da includere vero elemento barcode --- GWMS.UI/Pages/GasStation.razor | 130 +++++------------------------- GWMS.UI/Pages/GasStation.razor.cs | 13 +-- 2 files changed, 23 insertions(+), 120 deletions(-) diff --git a/GWMS.UI/Pages/GasStation.razor b/GWMS.UI/Pages/GasStation.razor index 1cf6783..28d0443 100644 --- a/GWMS.UI/Pages/GasStation.razor +++ b/GWMS.UI/Pages/GasStation.razor @@ -8,129 +8,39 @@
-
- In Consegna +
+ Registrazione
- -
-
- +
- @if (showFiltTime) - { -
-
-
- -
-
-
-
- -
-
-
- } - - @if (showFiltDest) - { -
-
-
-
- - - -
- -
-
- @*
-
-
- - - -
- -
-
*@ -
- }
- @if (currRecord != null) - { - - } - @if (ListRecords == null) - { - - } - else if (totalCount == 0) - { -
Nessun record trovato
- } - else - { -
-
- - - - - - - - - - @foreach (var record in ListRecords) - { - - - - - - } - -
ImpiantoQta
-
@record.Plant.PlantCode | @record.Plant.PlantDesc
-
@record.OrderDesc
-
-
- @record.OrderQty.ToString("N0") -
-
@record.DtETA.ToString("yyyy.MM.dd")
-
@record.DtETA.ToString("ddd HH:mm.ss")
-
+
+
+ Acquisizione barcode +
+
- } +
+ +

+ + Work IN progress, links: +

    +
  • https://github.com/sabitertan/BlazorBarcodeScanner
  • +
  • https://github.com/tallichet/ZXingBlazor
  • +
  • https://github.com/LorsSilvermort/BlazorBarcodeReader
  • +
  • https://www.bing.com/search?q=blazor+server+qrcode+scanner&qs=n&form=QBRE&sp=-1&pq=blazor+server+qrcode+scanner&sc=0-28&sk=&cvid=D827470C199B47BDB39F277EFC72A266
  • +
+

\ No newline at end of file diff --git a/GWMS.UI/Pages/GasStation.razor.cs b/GWMS.UI/Pages/GasStation.razor.cs index b066102..68c411c 100644 --- a/GWMS.UI/Pages/GasStation.razor.cs +++ b/GWMS.UI/Pages/GasStation.razor.cs @@ -165,9 +165,7 @@ namespace GWMS.UI.Pages [Inject] protected NavigationManager NavManager { get; set; } - protected bool showFiltDest { get; set; } = false; - - protected bool showFiltTime { get; set; } = false; + protected bool showBcodeScan { get; set; } = false; protected int totalCount { @@ -260,14 +258,9 @@ namespace GWMS.UI.Pages currRecord = selRecord; } - protected void ToggleFiltDest() + protected void ToggleBCode() { - showFiltDest = !showFiltDest; - } - - protected void ToggleFiltPeriod() - { - showFiltTime = !showFiltTime; + showBcodeScan = !showBcodeScan; } protected async Task UpdateData() From 69e4f2ea991b580fbef64848391f798e99a6a039 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 22 Jun 2021 13:22:27 +0200 Subject: [PATCH 4/8] RImodulaizone completa MsSql --> MySql --- GWMS.Data/GWMS.Data.csproj | 2 +- GWMS.Data/GWMSContext.cs | 27 +- .../20210531154814_InitDb.Designer.cs | 236 ----- GWMS.Data/Migrations/20210531154814_InitDb.cs | 157 ---- .../20210531154829_SeedAuthDemo.Designer.cs | 386 --------- .../Migrations/20210531154829_SeedAuthDemo.cs | 142 --- .../20210601103725_PlantData.Designer.cs | 510 ----------- .../Migrations/20210601103725_PlantData.cs | 101 --- .../20210601104131_SupplierData.Designer.cs | 616 ------------- .../Migrations/20210601104131_SupplierData.cs | 97 --- .../20210601105323_OrderModel.Designer.cs | 693 --------------- .../Migrations/20210601105323_OrderModel.cs | 240 ------ ...0210601163441_UpdatePlantModel.Designer.cs | 707 --------------- .../20210601163441_UpdatePlantModel.cs | 39 - ...20210607112525_UpdatePlantData.Designer.cs | 763 ----------------- .../20210607112525_UpdatePlantData.cs | 120 --- .../20210607140427_UpdatePlantData2.cs | 164 ---- .../20210619150155_OrderETA.Designer.cs | 808 ------------------ .../Migrations/20210619150155_OrderETA.cs | 81 -- ...r.cs => 20210622112111_InitDb.Designer.cs} | 171 ++-- GWMS.Data/Migrations/20210622112111_InitDb.cs | 507 +++++++++++ .../Migrations/GWMSContextModelSnapshot.cs | 166 ++-- GWMS.Data/ModelBuilderExtensions.cs | 4 +- 23 files changed, 692 insertions(+), 6045 deletions(-) delete mode 100644 GWMS.Data/Migrations/20210531154814_InitDb.Designer.cs delete mode 100644 GWMS.Data/Migrations/20210531154814_InitDb.cs delete mode 100644 GWMS.Data/Migrations/20210531154829_SeedAuthDemo.Designer.cs delete mode 100644 GWMS.Data/Migrations/20210531154829_SeedAuthDemo.cs delete mode 100644 GWMS.Data/Migrations/20210601103725_PlantData.Designer.cs delete mode 100644 GWMS.Data/Migrations/20210601103725_PlantData.cs delete mode 100644 GWMS.Data/Migrations/20210601104131_SupplierData.Designer.cs delete mode 100644 GWMS.Data/Migrations/20210601104131_SupplierData.cs delete mode 100644 GWMS.Data/Migrations/20210601105323_OrderModel.Designer.cs delete mode 100644 GWMS.Data/Migrations/20210601105323_OrderModel.cs delete mode 100644 GWMS.Data/Migrations/20210601163441_UpdatePlantModel.Designer.cs delete mode 100644 GWMS.Data/Migrations/20210601163441_UpdatePlantModel.cs delete mode 100644 GWMS.Data/Migrations/20210607112525_UpdatePlantData.Designer.cs delete mode 100644 GWMS.Data/Migrations/20210607112525_UpdatePlantData.cs delete mode 100644 GWMS.Data/Migrations/20210607140427_UpdatePlantData2.cs delete mode 100644 GWMS.Data/Migrations/20210619150155_OrderETA.Designer.cs delete mode 100644 GWMS.Data/Migrations/20210619150155_OrderETA.cs rename GWMS.Data/Migrations/{20210607140427_UpdatePlantData2.Designer.cs => 20210622112111_InitDb.Designer.cs} (82%) create mode 100644 GWMS.Data/Migrations/20210622112111_InitDb.cs diff --git a/GWMS.Data/GWMS.Data.csproj b/GWMS.Data/GWMS.Data.csproj index 825d969..bf17a18 100644 --- a/GWMS.Data/GWMS.Data.csproj +++ b/GWMS.Data/GWMS.Data.csproj @@ -22,10 +22,10 @@ + - \ No newline at end of file diff --git a/GWMS.Data/GWMSContext.cs b/GWMS.Data/GWMSContext.cs index 39f124d..7f65278 100644 --- a/GWMS.Data/GWMSContext.cs +++ b/GWMS.Data/GWMSContext.cs @@ -16,6 +16,8 @@ namespace GWMS.Data private IConfiguration _configuration; + private bool useMysql = true; + #endregion Private Fields #region Public Constructors @@ -66,12 +68,24 @@ namespace GWMS.Data protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - //string connString = ""; + string connString = ""; if (!optionsBuilder.IsConfigured) { - //connString = _configuration.GetConnectionString("GWMS.Data"); - //optionsBuilder.UseSqlServer(connString); - optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=GWMS;Trusted_Connection=True;"); + // caso MySql + if (useMysql) + { + //connString = _configuration.GetConnectionString("GWMS.Data"); + connString = "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"; + var serverVersion = ServerVersion.AutoDetect(connString); + optionsBuilder.UseMySql(connString, serverVersion); + } + // caso MsSql + else + { + //connString = _configuration.GetConnectionString("GWMS.Data"); + //optionsBuilder.UseSqlServer(connString); + optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=GWMS;Trusted_Connection=True;"); + } } } @@ -82,7 +96,10 @@ namespace GWMS.Data relationship.DeleteBehavior = DeleteBehavior.Restrict; } - modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS"); + if (!useMysql) + { + modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS"); + } modelBuilder.Entity(entity => { diff --git a/GWMS.Data/Migrations/20210531154814_InitDb.Designer.cs b/GWMS.Data/Migrations/20210531154814_InitDb.Designer.cs deleted file mode 100644 index 8d5e58c..0000000 --- a/GWMS.Data/Migrations/20210531154814_InitDb.Designer.cs +++ /dev/null @@ -1,236 +0,0 @@ -// -using GWMS.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace GWMS.Data.Migrations -{ - [DbContext(typeof(GWMSContext))] - [Migration("20210531154814_InitDb")] - partial class InitDb - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasComment("Descrizione dell'item"); - - b.Property("ValFloat") - .HasColumnType("int"); - - b.Property("ValInt") - .HasColumnType("int"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("KeyName"); - - b.ToTable("AnKeyVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AuthModel", b => - { - b.Property("AuthRole") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("AuthRole"); - - b.Property("Description") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Description"); - - b.HasKey("AuthRole"); - - b.ToTable("Auths"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ValStd") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasComment("Valore di default/riferimento per la variabile"); - - b.HasKey("KeyName"); - - b.ToTable("Config"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b => - { - b.Property("ItemId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ItemCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ItemDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ItemType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UM") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("ItemId"); - - b.ToTable("Items"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b => - { - b.Property("TabName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("TabName"); - - b.Property("FieldName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("FieldName"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("Val"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Descript"); - - b.Property("Ordinal") - .HasColumnType("int") - .HasColumnName("Ordinal"); - - b.HasKey("TabName", "FieldName", "Val"); - - b.ToTable("ListVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.Property("UserId") - .HasColumnType("int"); - - b.Property("AuthRole") - .HasColumnType("nvarchar(50)"); - - b.Property("AuthLevel") - .HasColumnType("int"); - - b.HasKey("UserId", "AuthRole"); - - b.HasIndex("AuthRole"); - - b.ToTable("UserAuth"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AuthKey") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Domain") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ExtCode") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Firstname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Lang") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("Lastname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UserName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("UserId"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.AuthModel", "Role") - .WithMany() - .HasForeignKey("AuthRole") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.UserModel", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/GWMS.Data/Migrations/20210531154814_InitDb.cs b/GWMS.Data/Migrations/20210531154814_InitDb.cs deleted file mode 100644 index 0e5b99d..0000000 --- a/GWMS.Data/Migrations/20210531154814_InitDb.cs +++ /dev/null @@ -1,157 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace GWMS.Data.Migrations -{ - public partial class InitDb : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AnKeyVal", - columns: table => new - { - KeyName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - ValInt = table.Column(type: "int", nullable: false), - ValFloat = table.Column(type: "int", nullable: false), - ValString = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - Descript = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true, comment: "Descrizione dell'item") - }, - constraints: table => - { - table.PrimaryKey("PK_AnKeyVal", x => x.KeyName); - }); - - migrationBuilder.CreateTable( - name: "Auths", - columns: table => new - { - AuthRole = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - Description = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Auths", x => x.AuthRole); - }); - - migrationBuilder.CreateTable( - name: "Config", - columns: table => new - { - KeyName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - Val = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - ValStd = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "Valore di default/riferimento per la variabile"), - Note = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Config", x => x.KeyName); - }); - - migrationBuilder.CreateTable( - name: "Items", - columns: table => new - { - ItemId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ItemCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - ItemDesc = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - ItemType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - UM = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Items", x => x.ItemId); - }); - - migrationBuilder.CreateTable( - name: "ListVal", - columns: table => new - { - TabName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - FieldName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - Val = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - Descript = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - Ordinal = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ListVal", x => new { x.TabName, x.FieldName, x.Val }); - }); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - UserId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Domain = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - UserName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - Lastname = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - Firstname = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - Email = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - Lang = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), - AuthKey = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - IsActive = table.Column(type: "bit", nullable: false), - ExtCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.UserId); - }); - - migrationBuilder.CreateTable( - name: "UserAuth", - columns: table => new - { - UserId = table.Column(type: "int", nullable: false), - AuthRole = table.Column(type: "nvarchar(50)", nullable: false), - AuthLevel = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_UserAuth", x => new { x.UserId, x.AuthRole }); - table.ForeignKey( - name: "FK_UserAuth_Auths_AuthRole", - column: x => x.AuthRole, - principalTable: "Auths", - principalColumn: "AuthRole", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_UserAuth_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "UserId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_UserAuth_AuthRole", - table: "UserAuth", - column: "AuthRole"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AnKeyVal"); - - migrationBuilder.DropTable( - name: "Config"); - - migrationBuilder.DropTable( - name: "Items"); - - migrationBuilder.DropTable( - name: "ListVal"); - - migrationBuilder.DropTable( - name: "UserAuth"); - - migrationBuilder.DropTable( - name: "Auths"); - - migrationBuilder.DropTable( - name: "Users"); - } - } -} diff --git a/GWMS.Data/Migrations/20210531154829_SeedAuthDemo.Designer.cs b/GWMS.Data/Migrations/20210531154829_SeedAuthDemo.Designer.cs deleted file mode 100644 index dcf6aa6..0000000 --- a/GWMS.Data/Migrations/20210531154829_SeedAuthDemo.Designer.cs +++ /dev/null @@ -1,386 +0,0 @@ -// -using GWMS.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace GWMS.Data.Migrations -{ - [DbContext(typeof(GWMSContext))] - [Migration("20210531154829_SeedAuthDemo")] - partial class SeedAuthDemo - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasComment("Descrizione dell'item"); - - b.Property("ValFloat") - .HasColumnType("int"); - - b.Property("ValInt") - .HasColumnType("int"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("KeyName"); - - b.ToTable("AnKeyVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AuthModel", b => - { - b.Property("AuthRole") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("AuthRole"); - - b.Property("Description") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Description"); - - b.HasKey("AuthRole"); - - b.ToTable("Auths"); - - b.HasData( - new - { - AuthRole = "User", - Description = "Base User" - }, - new - { - AuthRole = "AppAdmin", - Description = "App Admin User" - }, - new - { - AuthRole = "Supervisor", - Description = "Supervisor User" - }, - new - { - AuthRole = "PlantUser", - Description = "Plant User" - }, - new - { - AuthRole = "SupplSuperUser", - Description = "Supplier Super User" - }, - new - { - AuthRole = "SupplUser", - Description = "Supplier Standard User" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ValStd") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasComment("Valore di default/riferimento per la variabile"); - - b.HasKey("KeyName"); - - b.ToTable("Config"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b => - { - b.Property("ItemId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ItemCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ItemDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ItemType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UM") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("ItemId"); - - b.ToTable("Items"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b => - { - b.Property("TabName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("TabName"); - - b.Property("FieldName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("FieldName"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("Val"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Descript"); - - b.Property("Ordinal") - .HasColumnType("int") - .HasColumnName("Ordinal"); - - b.HasKey("TabName", "FieldName", "Val"); - - b.ToTable("ListVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.Property("UserId") - .HasColumnType("int"); - - b.Property("AuthRole") - .HasColumnType("nvarchar(50)"); - - b.Property("AuthLevel") - .HasColumnType("int"); - - b.HasKey("UserId", "AuthRole"); - - b.HasIndex("AuthRole"); - - b.ToTable("UserAuth"); - - b.HasData( - new - { - UserId = 1, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 2, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 3, - AuthRole = "Supervisor", - AuthLevel = 0 - }, - new - { - UserId = 4, - AuthRole = "PlantUser", - AuthLevel = 0 - }, - new - { - UserId = 5, - AuthRole = "SupplSuperUser", - AuthLevel = 0 - }, - new - { - UserId = 6, - AuthRole = "SupplUser", - AuthLevel = 0 - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AuthKey") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Domain") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ExtCode") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Firstname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Lang") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("Lastname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UserName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("UserId"); - - b.ToTable("Users"); - - b.HasData( - new - { - UserId = 1, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "samuele@steamware.net", - ExtCode = "", - Firstname = "Samuele", - IsActive = true, - Lang = "IT", - Lastname = "Locatelli", - UserName = "samuele" - }, - new - { - UserId = 2, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "giancarlo@steamware.net", - ExtCode = "", - Firstname = "Giancarlo", - IsActive = true, - Lang = "IT", - Lastname = "Rottoli", - UserName = "giancarlo" - }, - new - { - UserId = 3, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User03", - UserName = "user03" - }, - new - { - UserId = 4, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User04", - UserName = "user04" - }, - new - { - UserId = 5, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User05", - UserName = "user05" - }, - new - { - UserId = 6, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User06", - UserName = "user06" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.AuthModel", "Role") - .WithMany() - .HasForeignKey("AuthRole") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.UserModel", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/GWMS.Data/Migrations/20210531154829_SeedAuthDemo.cs b/GWMS.Data/Migrations/20210531154829_SeedAuthDemo.cs deleted file mode 100644 index 4e5f0b5..0000000 --- a/GWMS.Data/Migrations/20210531154829_SeedAuthDemo.cs +++ /dev/null @@ -1,142 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace GWMS.Data.Migrations -{ - public partial class SeedAuthDemo : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "Auths", - columns: new[] { "AuthRole", "Description" }, - values: new object[,] - { - { "User", "Base User" }, - { "AppAdmin", "App Admin User" }, - { "Supervisor", "Supervisor User" }, - { "PlantUser", "Plant User" }, - { "SupplSuperUser", "Supplier Super User" }, - { "SupplUser", "Supplier Standard User" } - }); - - migrationBuilder.InsertData( - table: "Users", - columns: new[] { "UserId", "AuthKey", "Domain", "Email", "ExtCode", "Firstname", "IsActive", "Lang", "Lastname", "UserName" }, - values: new object[,] - { - { 1, "thisIsTh3R1verOfTheNight90", "", "samuele@steamware.net", "", "Samuele", true, "IT", "Locatelli", "samuele" }, - { 2, "thisIsTh3R1verOfTheNight90", "", "giancarlo@steamware.net", "", "Giancarlo", true, "IT", "Rottoli", "giancarlo" }, - { 3, "thisIsTh3R1verOfTheNight90", "", "info@steamware.net", "", "Steamware", true, "IT", "User03", "user03" }, - { 4, "thisIsTh3R1verOfTheNight90", "", "info@steamware.net", "", "Steamware", true, "IT", "User04", "user04" }, - { 5, "thisIsTh3R1verOfTheNight90", "", "info@steamware.net", "", "Steamware", true, "IT", "User05", "user05" }, - { 6, "thisIsTh3R1verOfTheNight90", "", "info@steamware.net", "", "Steamware", true, "IT", "User06", "user06" } - }); - - migrationBuilder.InsertData( - table: "UserAuth", - columns: new[] { "AuthRole", "UserId", "AuthLevel" }, - values: new object[,] - { - { "AppAdmin", 1, 0 }, - { "AppAdmin", 2, 0 }, - { "Supervisor", 3, 0 }, - { "PlantUser", 4, 0 }, - { "SupplSuperUser", 5, 0 }, - { "SupplUser", 6, 0 } - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "Auths", - keyColumn: "AuthRole", - keyValue: "User"); - - migrationBuilder.DeleteData( - table: "UserAuth", - keyColumns: new[] { "AuthRole", "UserId" }, - keyValues: new object[] { "AppAdmin", 1 }); - - migrationBuilder.DeleteData( - table: "UserAuth", - keyColumns: new[] { "AuthRole", "UserId" }, - keyValues: new object[] { "AppAdmin", 2 }); - - migrationBuilder.DeleteData( - table: "UserAuth", - keyColumns: new[] { "AuthRole", "UserId" }, - keyValues: new object[] { "Supervisor", 3 }); - - migrationBuilder.DeleteData( - table: "UserAuth", - keyColumns: new[] { "AuthRole", "UserId" }, - keyValues: new object[] { "PlantUser", 4 }); - - migrationBuilder.DeleteData( - table: "UserAuth", - keyColumns: new[] { "AuthRole", "UserId" }, - keyValues: new object[] { "SupplSuperUser", 5 }); - - migrationBuilder.DeleteData( - table: "UserAuth", - keyColumns: new[] { "AuthRole", "UserId" }, - keyValues: new object[] { "SupplUser", 6 }); - - migrationBuilder.DeleteData( - table: "Auths", - keyColumn: "AuthRole", - keyValue: "AppAdmin"); - - migrationBuilder.DeleteData( - table: "Auths", - keyColumn: "AuthRole", - keyValue: "PlantUser"); - - migrationBuilder.DeleteData( - table: "Auths", - keyColumn: "AuthRole", - keyValue: "Supervisor"); - - migrationBuilder.DeleteData( - table: "Auths", - keyColumn: "AuthRole", - keyValue: "SupplSuperUser"); - - migrationBuilder.DeleteData( - table: "Auths", - keyColumn: "AuthRole", - keyValue: "SupplUser"); - - migrationBuilder.DeleteData( - table: "Users", - keyColumn: "UserId", - keyValue: 1); - - migrationBuilder.DeleteData( - table: "Users", - keyColumn: "UserId", - keyValue: 2); - - migrationBuilder.DeleteData( - table: "Users", - keyColumn: "UserId", - keyValue: 3); - - migrationBuilder.DeleteData( - table: "Users", - keyColumn: "UserId", - keyValue: 4); - - migrationBuilder.DeleteData( - table: "Users", - keyColumn: "UserId", - keyValue: 5); - - migrationBuilder.DeleteData( - table: "Users", - keyColumn: "UserId", - keyValue: 6); - } - } -} diff --git a/GWMS.Data/Migrations/20210601103725_PlantData.Designer.cs b/GWMS.Data/Migrations/20210601103725_PlantData.Designer.cs deleted file mode 100644 index c1d47d2..0000000 --- a/GWMS.Data/Migrations/20210601103725_PlantData.Designer.cs +++ /dev/null @@ -1,510 +0,0 @@ -// -using System; -using GWMS.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace GWMS.Data.Migrations -{ - [DbContext(typeof(GWMSContext))] - [Migration("20210601103725_PlantData")] - partial class PlantData - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasComment("Descrizione dell'item"); - - b.Property("ValFloat") - .HasColumnType("int"); - - b.Property("ValInt") - .HasColumnType("int"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("KeyName"); - - b.ToTable("AnKeyVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AuthModel", b => - { - b.Property("AuthRole") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("AuthRole"); - - b.Property("Description") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Description"); - - b.HasKey("AuthRole"); - - b.ToTable("Auths"); - - b.HasData( - new - { - AuthRole = "User", - Description = "Base User" - }, - new - { - AuthRole = "AppAdmin", - Description = "App Admin User" - }, - new - { - AuthRole = "Supervisor", - Description = "Supervisor User" - }, - new - { - AuthRole = "PlantUser", - Description = "Plant User" - }, - new - { - AuthRole = "SupplSuperUser", - Description = "Supplier Super User" - }, - new - { - AuthRole = "SupplUser", - Description = "Supplier Standard User" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ValStd") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasComment("Valore di default/riferimento per la variabile"); - - b.HasKey("KeyName"); - - b.ToTable("Config"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b => - { - b.Property("ItemId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ItemCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ItemDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ItemType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UM") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("ItemId"); - - b.ToTable("Items"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b => - { - b.Property("TabName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("TabName"); - - b.Property("FieldName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("FieldName"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("Val"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Descript"); - - b.Property("Ordinal") - .HasColumnType("int") - .HasColumnName("Ordinal"); - - b.HasKey("TabName", "FieldName", "Val"); - - b.ToTable("ListVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b => - { - b.Property("PlantId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("PlantCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PlantDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId"); - - b.ToTable("PlantDetail"); - - b.HasData( - new - { - PlantId = 1, - PlantCode = "PSIM01", - PlantDesc = "Impianto SIM 01" - }, - new - { - PlantId = 2, - PlantCode = "PSIM02", - PlantDesc = "Impianto SIM 02" - }, - new - { - PlantId = 3, - PlantCode = "PSIM03", - PlantDesc = "Impianto SIM 03" - }, - new - { - PlantId = 4, - PlantCode = "PSIM04", - PlantDesc = "Impianto SIM 04" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.Property("PlantDataId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantDataId"); - - b.HasIndex("PlantId"); - - b.ToTable("PlantLog"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId", "FluxType"); - - b.ToTable("PlantStatus"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.Property("UserId") - .HasColumnType("int"); - - b.Property("AuthRole") - .HasColumnType("nvarchar(50)"); - - b.Property("AuthLevel") - .HasColumnType("int"); - - b.HasKey("UserId", "AuthRole"); - - b.HasIndex("AuthRole"); - - b.ToTable("UserAuth"); - - b.HasData( - new - { - UserId = 1, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 2, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 3, - AuthRole = "Supervisor", - AuthLevel = 0 - }, - new - { - UserId = 4, - AuthRole = "PlantUser", - AuthLevel = 0 - }, - new - { - UserId = 5, - AuthRole = "SupplSuperUser", - AuthLevel = 0 - }, - new - { - UserId = 6, - AuthRole = "SupplUser", - AuthLevel = 0 - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AuthKey") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Domain") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ExtCode") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Firstname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Lang") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("Lastname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UserName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("UserId"); - - b.ToTable("Users"); - - b.HasData( - new - { - UserId = 1, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "samuele@steamware.net", - ExtCode = "", - Firstname = "Samuele", - IsActive = true, - Lang = "IT", - Lastname = "Locatelli", - UserName = "samuele" - }, - new - { - UserId = 2, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "giancarlo@steamware.net", - ExtCode = "", - Firstname = "Giancarlo", - IsActive = true, - Lang = "IT", - Lastname = "Rottoli", - UserName = "giancarlo" - }, - new - { - UserId = 3, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User03", - UserName = "user03" - }, - new - { - UserId = 4, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User04", - UserName = "user04" - }, - new - { - UserId = 5, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User05", - UserName = "user05" - }, - new - { - UserId = 6, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User06", - UserName = "user06" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.AuthModel", "Role") - .WithMany() - .HasForeignKey("AuthRole") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.UserModel", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/GWMS.Data/Migrations/20210601103725_PlantData.cs b/GWMS.Data/Migrations/20210601103725_PlantData.cs deleted file mode 100644 index 5c9f849..0000000 --- a/GWMS.Data/Migrations/20210601103725_PlantData.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace GWMS.Data.Migrations -{ - public partial class PlantData : Migration - { - #region Protected Methods - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "PlantLog"); - - migrationBuilder.DropTable( - name: "PlantStatus"); - - migrationBuilder.DropTable( - name: "PlantDetail"); - } - - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "PlantDetail", - columns: table => new - { - PlantId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - PlantCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - PlantDesc = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PlantDetail", x => x.PlantId); - }); - - migrationBuilder.CreateTable( - name: "PlantLog", - columns: table => new - { - PlantDataId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - DtEvent = table.Column(type: "datetime2", nullable: false), - FluxType = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - PlantId = table.Column(type: "int", nullable: false), - ValNumber = table.Column(type: "float", nullable: false), - ValString = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PlantLog", x => x.PlantDataId); - table.ForeignKey( - name: "FK_PlantLog_PlantDetail_PlantId", - column: x => x.PlantId, - principalTable: "PlantDetail", - principalColumn: "PlantId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "PlantStatus", - columns: table => new - { - PlantId = table.Column(type: "int", nullable: false), - FluxType = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), - DtEvent = table.Column(type: "datetime2", nullable: false), - ValNumber = table.Column(type: "float", nullable: false), - ValString = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PlantStatus", x => new { x.PlantId, x.FluxType }); - table.ForeignKey( - name: "FK_PlantStatus_PlantDetail_PlantId", - column: x => x.PlantId, - principalTable: "PlantDetail", - principalColumn: "PlantId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.InsertData( - table: "PlantDetail", - columns: new[] { "PlantId", "PlantCode", "PlantDesc" }, - values: new object[,] - { - { 1, "PSIM01", "Impianto SIM 01" }, - { 2, "PSIM02", "Impianto SIM 02" }, - { 3, "PSIM03", "Impianto SIM 03" }, - { 4, "PSIM04", "Impianto SIM 04" } - }); - - migrationBuilder.CreateIndex( - name: "IX_PlantLog_PlantId", - table: "PlantLog", - column: "PlantId"); - } - - #endregion Protected Methods - } -} \ No newline at end of file diff --git a/GWMS.Data/Migrations/20210601104131_SupplierData.Designer.cs b/GWMS.Data/Migrations/20210601104131_SupplierData.Designer.cs deleted file mode 100644 index 0f9434a..0000000 --- a/GWMS.Data/Migrations/20210601104131_SupplierData.Designer.cs +++ /dev/null @@ -1,616 +0,0 @@ -// -using System; -using GWMS.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace GWMS.Data.Migrations -{ - [DbContext(typeof(GWMSContext))] - [Migration("20210601104131_SupplierData")] - partial class SupplierData - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasComment("Descrizione dell'item"); - - b.Property("ValFloat") - .HasColumnType("int"); - - b.Property("ValInt") - .HasColumnType("int"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("KeyName"); - - b.ToTable("AnKeyVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AuthModel", b => - { - b.Property("AuthRole") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("AuthRole"); - - b.Property("Description") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Description"); - - b.HasKey("AuthRole"); - - b.ToTable("Auths"); - - b.HasData( - new - { - AuthRole = "User", - Description = "Base User" - }, - new - { - AuthRole = "AppAdmin", - Description = "App Admin User" - }, - new - { - AuthRole = "Supervisor", - Description = "Supervisor User" - }, - new - { - AuthRole = "PlantUser", - Description = "Plant User" - }, - new - { - AuthRole = "SupplSuperUser", - Description = "Supplier Super User" - }, - new - { - AuthRole = "SupplUser", - Description = "Supplier Standard User" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ValStd") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasComment("Valore di default/riferimento per la variabile"); - - b.HasKey("KeyName"); - - b.ToTable("Config"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b => - { - b.Property("ItemId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ItemCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ItemDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ItemType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UM") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("ItemId"); - - b.ToTable("Items"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b => - { - b.Property("TabName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("TabName"); - - b.Property("FieldName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("FieldName"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("Val"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Descript"); - - b.Property("Ordinal") - .HasColumnType("int") - .HasColumnName("Ordinal"); - - b.HasKey("TabName", "FieldName", "Val"); - - b.ToTable("ListVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b => - { - b.Property("PlantId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("PlantCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PlantDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId"); - - b.ToTable("PlantDetail"); - - b.HasData( - new - { - PlantId = 1, - PlantCode = "PSIM01", - PlantDesc = "Impianto SIM 01" - }, - new - { - PlantId = 2, - PlantCode = "PSIM02", - PlantDesc = "Impianto SIM 02" - }, - new - { - PlantId = 3, - PlantCode = "PSIM03", - PlantDesc = "Impianto SIM 03" - }, - new - { - PlantId = 4, - PlantCode = "PSIM04", - PlantDesc = "Impianto SIM 04" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.Property("PlantDataId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantDataId"); - - b.HasIndex("PlantId"); - - b.ToTable("PlantLog"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId", "FluxType"); - - b.ToTable("PlantStatus"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantSupplWeekPlanModel", b => - { - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("DayNum") - .HasColumnType("int"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId", "SupplierId", "DayNum"); - - b.HasIndex("SupplierId"); - - b.ToTable("PlantSupplWeekPlan"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b => - { - b.Property("SupplierId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("SupplierCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("SupplierDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("SupplierId"); - - b.ToTable("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b => - { - b.Property("TransporterId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("PositionLatitude") - .HasColumnType("float"); - - b.Property("PositionLongitude") - .HasColumnType("float"); - - b.Property("PositionUpdated") - .HasColumnType("datetime2"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("TransporterCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("TransporterDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("TransporterId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Transporter"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.Property("UserId") - .HasColumnType("int"); - - b.Property("AuthRole") - .HasColumnType("nvarchar(50)"); - - b.Property("AuthLevel") - .HasColumnType("int"); - - b.HasKey("UserId", "AuthRole"); - - b.HasIndex("AuthRole"); - - b.ToTable("UserAuth"); - - b.HasData( - new - { - UserId = 1, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 2, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 3, - AuthRole = "Supervisor", - AuthLevel = 0 - }, - new - { - UserId = 4, - AuthRole = "PlantUser", - AuthLevel = 0 - }, - new - { - UserId = 5, - AuthRole = "SupplSuperUser", - AuthLevel = 0 - }, - new - { - UserId = 6, - AuthRole = "SupplUser", - AuthLevel = 0 - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AuthKey") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Domain") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ExtCode") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Firstname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Lang") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("Lastname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UserName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("UserId"); - - b.ToTable("Users"); - - b.HasData( - new - { - UserId = 1, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "samuele@steamware.net", - ExtCode = "", - Firstname = "Samuele", - IsActive = true, - Lang = "IT", - Lastname = "Locatelli", - UserName = "samuele" - }, - new - { - UserId = 2, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "giancarlo@steamware.net", - ExtCode = "", - Firstname = "Giancarlo", - IsActive = true, - Lang = "IT", - Lastname = "Rottoli", - UserName = "giancarlo" - }, - new - { - UserId = 3, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User03", - UserName = "user03" - }, - new - { - UserId = 4, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User04", - UserName = "user04" - }, - new - { - UserId = 5, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User05", - UserName = "user05" - }, - new - { - UserId = 6, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User06", - UserName = "user06" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantSupplWeekPlanModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Plant"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.AuthModel", "Role") - .WithMany() - .HasForeignKey("AuthRole") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.UserModel", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/GWMS.Data/Migrations/20210601104131_SupplierData.cs b/GWMS.Data/Migrations/20210601104131_SupplierData.cs deleted file mode 100644 index 70d56cc..0000000 --- a/GWMS.Data/Migrations/20210601104131_SupplierData.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace GWMS.Data.Migrations -{ - public partial class SupplierData : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Supplier", - columns: table => new - { - SupplierId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - SupplierCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - SupplierDesc = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Supplier", x => x.SupplierId); - }); - - migrationBuilder.CreateTable( - name: "PlantSupplWeekPlan", - columns: table => new - { - PlantId = table.Column(type: "int", nullable: false), - SupplierId = table.Column(type: "int", nullable: false), - DayNum = table.Column(type: "int", nullable: false), - Note = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PlantSupplWeekPlan", x => new { x.PlantId, x.SupplierId, x.DayNum }); - table.ForeignKey( - name: "FK_PlantSupplWeekPlan_PlantDetail_PlantId", - column: x => x.PlantId, - principalTable: "PlantDetail", - principalColumn: "PlantId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_PlantSupplWeekPlan_Supplier_SupplierId", - column: x => x.SupplierId, - principalTable: "Supplier", - principalColumn: "SupplierId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Transporter", - columns: table => new - { - TransporterId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - TransporterCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - TransporterDesc = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - PositionLatitude = table.Column(type: "float", nullable: false), - PositionLongitude = table.Column(type: "float", nullable: false), - PositionUpdated = table.Column(type: "datetime2", nullable: false), - SupplierId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Transporter", x => x.TransporterId); - table.ForeignKey( - name: "FK_Transporter_Supplier_SupplierId", - column: x => x.SupplierId, - principalTable: "Supplier", - principalColumn: "SupplierId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_PlantSupplWeekPlan_SupplierId", - table: "PlantSupplWeekPlan", - column: "SupplierId"); - - migrationBuilder.CreateIndex( - name: "IX_Transporter_SupplierId", - table: "Transporter", - column: "SupplierId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "PlantSupplWeekPlan"); - - migrationBuilder.DropTable( - name: "Transporter"); - - migrationBuilder.DropTable( - name: "Supplier"); - } - } -} diff --git a/GWMS.Data/Migrations/20210601105323_OrderModel.Designer.cs b/GWMS.Data/Migrations/20210601105323_OrderModel.Designer.cs deleted file mode 100644 index 775919b..0000000 --- a/GWMS.Data/Migrations/20210601105323_OrderModel.Designer.cs +++ /dev/null @@ -1,693 +0,0 @@ -// -using System; -using GWMS.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace GWMS.Data.Migrations -{ - [DbContext(typeof(GWMSContext))] - [Migration("20210601105323_OrderModel")] - partial class OrderModel - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasComment("Descrizione dell'item"); - - b.Property("ValFloat") - .HasColumnType("int"); - - b.Property("ValInt") - .HasColumnType("int"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("KeyName"); - - b.ToTable("AnKeyVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AuthModel", b => - { - b.Property("AuthRole") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("AuthRole"); - - b.Property("Description") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Description"); - - b.HasKey("AuthRole"); - - b.ToTable("Auths"); - - b.HasData( - new - { - AuthRole = "User", - Description = "Base User" - }, - new - { - AuthRole = "AppAdmin", - Description = "App Admin User" - }, - new - { - AuthRole = "Supervisor", - Description = "Supervisor User" - }, - new - { - AuthRole = "PlantUser", - Description = "Plant User" - }, - new - { - AuthRole = "SupplSuperUser", - Description = "Supplier Super User" - }, - new - { - AuthRole = "SupplUser", - Description = "Supplier Standard User" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ValStd") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasComment("Valore di default/riferimento per la variabile"); - - b.HasKey("KeyName"); - - b.ToTable("Config"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b => - { - b.Property("ItemId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ItemCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ItemDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ItemType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UM") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("ItemId"); - - b.ToTable("Items"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b => - { - b.Property("TabName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("TabName"); - - b.Property("FieldName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("FieldName"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("Val"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Descript"); - - b.Property("Ordinal") - .HasColumnType("int") - .HasColumnName("Ordinal"); - - b.HasKey("TabName", "FieldName", "Val"); - - b.ToTable("ListVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b => - { - b.Property("OrderId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("DtExecEnd") - .HasColumnType("datetime2"); - - b.Property("DtExecStart") - .HasColumnType("datetime2"); - - b.Property("DtOrder") - .HasColumnType("datetime2"); - - b.Property("ExecutionQty") - .HasColumnType("float"); - - b.Property("OrderCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("OrderDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OrderQty") - .HasColumnType("float"); - - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("TransporterId") - .HasColumnType("int"); - - b.HasKey("OrderId"); - - b.HasIndex("PlantId"); - - b.HasIndex("SupplierId"); - - b.HasIndex("TransporterId"); - - b.ToTable("Order"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b => - { - b.Property("PlantId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("PlantCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PlantDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId"); - - b.ToTable("PlantDetail"); - - b.HasData( - new - { - PlantId = 1, - PlantCode = "PSIM01", - PlantDesc = "Impianto SIM 01" - }, - new - { - PlantId = 2, - PlantCode = "PSIM02", - PlantDesc = "Impianto SIM 02" - }, - new - { - PlantId = 3, - PlantCode = "PSIM03", - PlantDesc = "Impianto SIM 03" - }, - new - { - PlantId = 4, - PlantCode = "PSIM04", - PlantDesc = "Impianto SIM 04" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.Property("PlantDataId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantDataId"); - - b.HasIndex("PlantId"); - - b.ToTable("PlantLog"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId", "FluxType"); - - b.ToTable("PlantStatus"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantSupplWeekPlanModel", b => - { - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("DayNum") - .HasColumnType("int"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId", "SupplierId", "DayNum"); - - b.HasIndex("SupplierId"); - - b.ToTable("PlantSupplWeekPlan"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b => - { - b.Property("SupplierId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("SupplierCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("SupplierDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("SupplierId"); - - b.ToTable("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b => - { - b.Property("TransporterId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("PositionLatitude") - .HasColumnType("float"); - - b.Property("PositionLongitude") - .HasColumnType("float"); - - b.Property("PositionUpdated") - .HasColumnType("datetime2"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("TransporterCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("TransporterDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("TransporterId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Transporter"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.Property("UserId") - .HasColumnType("int"); - - b.Property("AuthRole") - .HasColumnType("nvarchar(50)"); - - b.Property("AuthLevel") - .HasColumnType("int"); - - b.HasKey("UserId", "AuthRole"); - - b.HasIndex("AuthRole"); - - b.ToTable("UserAuth"); - - b.HasData( - new - { - UserId = 1, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 2, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 3, - AuthRole = "Supervisor", - AuthLevel = 0 - }, - new - { - UserId = 4, - AuthRole = "PlantUser", - AuthLevel = 0 - }, - new - { - UserId = 5, - AuthRole = "SupplSuperUser", - AuthLevel = 0 - }, - new - { - UserId = 6, - AuthRole = "SupplUser", - AuthLevel = 0 - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AuthKey") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Domain") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ExtCode") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Firstname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Lang") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("Lastname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UserName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("UserId"); - - b.ToTable("Users"); - - b.HasData( - new - { - UserId = 1, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "samuele@steamware.net", - ExtCode = "", - Firstname = "Samuele", - IsActive = true, - Lang = "IT", - Lastname = "Locatelli", - UserName = "samuele" - }, - new - { - UserId = 2, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "giancarlo@steamware.net", - ExtCode = "", - Firstname = "Giancarlo", - IsActive = true, - Lang = "IT", - Lastname = "Rottoli", - UserName = "giancarlo" - }, - new - { - UserId = 3, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User03", - UserName = "user03" - }, - new - { - UserId = 4, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User04", - UserName = "user04" - }, - new - { - UserId = 5, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User05", - UserName = "user05" - }, - new - { - UserId = 6, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User06", - UserName = "user06" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter") - .WithMany() - .HasForeignKey("TransporterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - - b.Navigation("Supplier"); - - b.Navigation("Transporter"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantSupplWeekPlanModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.AuthModel", "Role") - .WithMany() - .HasForeignKey("AuthRole") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.UserModel", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/GWMS.Data/Migrations/20210601105323_OrderModel.cs b/GWMS.Data/Migrations/20210601105323_OrderModel.cs deleted file mode 100644 index d08b800..0000000 --- a/GWMS.Data/Migrations/20210601105323_OrderModel.cs +++ /dev/null @@ -1,240 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace GWMS.Data.Migrations -{ - public partial class OrderModel : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_PlantLog_PlantDetail_PlantId", - table: "PlantLog"); - - migrationBuilder.DropForeignKey( - name: "FK_PlantStatus_PlantDetail_PlantId", - table: "PlantStatus"); - - migrationBuilder.DropForeignKey( - name: "FK_PlantSupplWeekPlan_PlantDetail_PlantId", - table: "PlantSupplWeekPlan"); - - migrationBuilder.DropForeignKey( - name: "FK_PlantSupplWeekPlan_Supplier_SupplierId", - table: "PlantSupplWeekPlan"); - - migrationBuilder.DropForeignKey( - name: "FK_Transporter_Supplier_SupplierId", - table: "Transporter"); - - migrationBuilder.DropForeignKey( - name: "FK_UserAuth_Auths_AuthRole", - table: "UserAuth"); - - migrationBuilder.DropForeignKey( - name: "FK_UserAuth_Users_UserId", - table: "UserAuth"); - - migrationBuilder.CreateTable( - name: "Order", - columns: table => new - { - OrderId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - DtOrder = table.Column(type: "datetime2", nullable: false), - PlantId = table.Column(type: "int", nullable: false), - SupplierId = table.Column(type: "int", nullable: false), - TransporterId = table.Column(type: "int", nullable: false), - OrderCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - OrderDesc = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - OrderQty = table.Column(type: "float", nullable: false), - DtExecStart = table.Column(type: "datetime2", nullable: false), - DtExecEnd = table.Column(type: "datetime2", nullable: false), - ExecutionQty = table.Column(type: "float", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Order", x => x.OrderId); - table.ForeignKey( - name: "FK_Order_PlantDetail_PlantId", - column: x => x.PlantId, - principalTable: "PlantDetail", - principalColumn: "PlantId", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Order_Supplier_SupplierId", - column: x => x.SupplierId, - principalTable: "Supplier", - principalColumn: "SupplierId", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Order_Transporter_TransporterId", - column: x => x.TransporterId, - principalTable: "Transporter", - principalColumn: "TransporterId", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_Order_PlantId", - table: "Order", - column: "PlantId"); - - migrationBuilder.CreateIndex( - name: "IX_Order_SupplierId", - table: "Order", - column: "SupplierId"); - - migrationBuilder.CreateIndex( - name: "IX_Order_TransporterId", - table: "Order", - column: "TransporterId"); - - migrationBuilder.AddForeignKey( - name: "FK_PlantLog_PlantDetail_PlantId", - table: "PlantLog", - column: "PlantId", - principalTable: "PlantDetail", - principalColumn: "PlantId", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_PlantStatus_PlantDetail_PlantId", - table: "PlantStatus", - column: "PlantId", - principalTable: "PlantDetail", - principalColumn: "PlantId", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_PlantSupplWeekPlan_PlantDetail_PlantId", - table: "PlantSupplWeekPlan", - column: "PlantId", - principalTable: "PlantDetail", - principalColumn: "PlantId", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_PlantSupplWeekPlan_Supplier_SupplierId", - table: "PlantSupplWeekPlan", - column: "SupplierId", - principalTable: "Supplier", - principalColumn: "SupplierId", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Transporter_Supplier_SupplierId", - table: "Transporter", - column: "SupplierId", - principalTable: "Supplier", - principalColumn: "SupplierId", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_UserAuth_Auths_AuthRole", - table: "UserAuth", - column: "AuthRole", - principalTable: "Auths", - principalColumn: "AuthRole", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_UserAuth_Users_UserId", - table: "UserAuth", - column: "UserId", - principalTable: "Users", - principalColumn: "UserId", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_PlantLog_PlantDetail_PlantId", - table: "PlantLog"); - - migrationBuilder.DropForeignKey( - name: "FK_PlantStatus_PlantDetail_PlantId", - table: "PlantStatus"); - - migrationBuilder.DropForeignKey( - name: "FK_PlantSupplWeekPlan_PlantDetail_PlantId", - table: "PlantSupplWeekPlan"); - - migrationBuilder.DropForeignKey( - name: "FK_PlantSupplWeekPlan_Supplier_SupplierId", - table: "PlantSupplWeekPlan"); - - migrationBuilder.DropForeignKey( - name: "FK_Transporter_Supplier_SupplierId", - table: "Transporter"); - - migrationBuilder.DropForeignKey( - name: "FK_UserAuth_Auths_AuthRole", - table: "UserAuth"); - - migrationBuilder.DropForeignKey( - name: "FK_UserAuth_Users_UserId", - table: "UserAuth"); - - migrationBuilder.DropTable( - name: "Order"); - - migrationBuilder.AddForeignKey( - name: "FK_PlantLog_PlantDetail_PlantId", - table: "PlantLog", - column: "PlantId", - principalTable: "PlantDetail", - principalColumn: "PlantId", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_PlantStatus_PlantDetail_PlantId", - table: "PlantStatus", - column: "PlantId", - principalTable: "PlantDetail", - principalColumn: "PlantId", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_PlantSupplWeekPlan_PlantDetail_PlantId", - table: "PlantSupplWeekPlan", - column: "PlantId", - principalTable: "PlantDetail", - principalColumn: "PlantId", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_PlantSupplWeekPlan_Supplier_SupplierId", - table: "PlantSupplWeekPlan", - column: "SupplierId", - principalTable: "Supplier", - principalColumn: "SupplierId", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Transporter_Supplier_SupplierId", - table: "Transporter", - column: "SupplierId", - principalTable: "Supplier", - principalColumn: "SupplierId", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_UserAuth_Auths_AuthRole", - table: "UserAuth", - column: "AuthRole", - principalTable: "Auths", - principalColumn: "AuthRole", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_UserAuth_Users_UserId", - table: "UserAuth", - column: "UserId", - principalTable: "Users", - principalColumn: "UserId", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/GWMS.Data/Migrations/20210601163441_UpdatePlantModel.Designer.cs b/GWMS.Data/Migrations/20210601163441_UpdatePlantModel.Designer.cs deleted file mode 100644 index b1be548..0000000 --- a/GWMS.Data/Migrations/20210601163441_UpdatePlantModel.Designer.cs +++ /dev/null @@ -1,707 +0,0 @@ -// -using System; -using GWMS.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace GWMS.Data.Migrations -{ - [DbContext(typeof(GWMSContext))] - [Migration("20210601163441_UpdatePlantModel")] - partial class UpdatePlantModel - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasComment("Descrizione dell'item"); - - b.Property("ValFloat") - .HasColumnType("int"); - - b.Property("ValInt") - .HasColumnType("int"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("KeyName"); - - b.ToTable("AnKeyVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AuthModel", b => - { - b.Property("AuthRole") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("AuthRole"); - - b.Property("Description") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Description"); - - b.HasKey("AuthRole"); - - b.ToTable("Auths"); - - b.HasData( - new - { - AuthRole = "User", - Description = "Base User" - }, - new - { - AuthRole = "AppAdmin", - Description = "App Admin User" - }, - new - { - AuthRole = "Supervisor", - Description = "Supervisor User" - }, - new - { - AuthRole = "PlantUser", - Description = "Plant User" - }, - new - { - AuthRole = "SupplSuperUser", - Description = "Supplier Super User" - }, - new - { - AuthRole = "SupplUser", - Description = "Supplier Standard User" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ValStd") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasComment("Valore di default/riferimento per la variabile"); - - b.HasKey("KeyName"); - - b.ToTable("Config"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b => - { - b.Property("ItemId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ItemCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ItemDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ItemType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UM") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("ItemId"); - - b.ToTable("Items"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b => - { - b.Property("TabName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("TabName"); - - b.Property("FieldName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("FieldName"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("Val"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Descript"); - - b.Property("Ordinal") - .HasColumnType("int") - .HasColumnName("Ordinal"); - - b.HasKey("TabName", "FieldName", "Val"); - - b.ToTable("ListVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b => - { - b.Property("OrderId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("DtExecEnd") - .HasColumnType("datetime2"); - - b.Property("DtExecStart") - .HasColumnType("datetime2"); - - b.Property("DtOrder") - .HasColumnType("datetime2"); - - b.Property("ExecutionQty") - .HasColumnType("float"); - - b.Property("OrderCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("OrderDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OrderQty") - .HasColumnType("float"); - - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("TransporterId") - .HasColumnType("int"); - - b.HasKey("OrderId"); - - b.HasIndex("PlantId"); - - b.HasIndex("SupplierId"); - - b.HasIndex("TransporterId"); - - b.ToTable("Order"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b => - { - b.Property("PlantId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("LevelAct") - .HasColumnType("float"); - - b.Property("LevelMax") - .HasColumnType("float"); - - b.Property("PlantCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PlantDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId"); - - b.ToTable("PlantDetail"); - - b.HasData( - new - { - PlantId = 1, - LevelAct = 0.0, - LevelMax = 9999.0, - PlantCode = "PSIM01", - PlantDesc = "Impianto SIM 01" - }, - new - { - PlantId = 2, - LevelAct = 0.0, - LevelMax = 9999.0, - PlantCode = "PSIM02", - PlantDesc = "Impianto SIM 02" - }, - new - { - PlantId = 3, - LevelAct = 0.0, - LevelMax = 9999.0, - PlantCode = "PSIM03", - PlantDesc = "Impianto SIM 03" - }, - new - { - PlantId = 4, - LevelAct = 0.0, - LevelMax = 9999.0, - PlantCode = "PSIM04", - PlantDesc = "Impianto SIM 04" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.Property("PlantDataId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantDataId"); - - b.HasIndex("PlantId"); - - b.ToTable("PlantLog"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId", "FluxType"); - - b.ToTable("PlantStatus"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantSupplWeekPlanModel", b => - { - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("DayNum") - .HasColumnType("int"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId", "SupplierId", "DayNum"); - - b.HasIndex("SupplierId"); - - b.ToTable("PlantSupplWeekPlan"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b => - { - b.Property("SupplierId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("SupplierCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("SupplierDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("SupplierId"); - - b.ToTable("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b => - { - b.Property("TransporterId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("PositionLatitude") - .HasColumnType("float"); - - b.Property("PositionLongitude") - .HasColumnType("float"); - - b.Property("PositionUpdated") - .HasColumnType("datetime2"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("TransporterCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("TransporterDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("TransporterId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Transporter"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.Property("UserId") - .HasColumnType("int"); - - b.Property("AuthRole") - .HasColumnType("nvarchar(50)"); - - b.Property("AuthLevel") - .HasColumnType("int"); - - b.HasKey("UserId", "AuthRole"); - - b.HasIndex("AuthRole"); - - b.ToTable("UserAuth"); - - b.HasData( - new - { - UserId = 1, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 2, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 3, - AuthRole = "Supervisor", - AuthLevel = 0 - }, - new - { - UserId = 4, - AuthRole = "PlantUser", - AuthLevel = 0 - }, - new - { - UserId = 5, - AuthRole = "SupplSuperUser", - AuthLevel = 0 - }, - new - { - UserId = 6, - AuthRole = "SupplUser", - AuthLevel = 0 - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AuthKey") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Domain") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ExtCode") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Firstname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Lang") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("Lastname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UserName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("UserId"); - - b.ToTable("Users"); - - b.HasData( - new - { - UserId = 1, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "samuele@steamware.net", - ExtCode = "", - Firstname = "Samuele", - IsActive = true, - Lang = "IT", - Lastname = "Locatelli", - UserName = "samuele" - }, - new - { - UserId = 2, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "giancarlo@steamware.net", - ExtCode = "", - Firstname = "Giancarlo", - IsActive = true, - Lang = "IT", - Lastname = "Rottoli", - UserName = "giancarlo" - }, - new - { - UserId = 3, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User03", - UserName = "user03" - }, - new - { - UserId = 4, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User04", - UserName = "user04" - }, - new - { - UserId = 5, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User05", - UserName = "user05" - }, - new - { - UserId = 6, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User06", - UserName = "user06" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter") - .WithMany() - .HasForeignKey("TransporterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - - b.Navigation("Supplier"); - - b.Navigation("Transporter"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantSupplWeekPlanModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.AuthModel", "Role") - .WithMany() - .HasForeignKey("AuthRole") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.UserModel", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/GWMS.Data/Migrations/20210601163441_UpdatePlantModel.cs b/GWMS.Data/Migrations/20210601163441_UpdatePlantModel.cs deleted file mode 100644 index 0305dac..0000000 --- a/GWMS.Data/Migrations/20210601163441_UpdatePlantModel.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace GWMS.Data.Migrations -{ - public partial class UpdatePlantModel : Migration - { - #region Protected Methods - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "LevelAct", - table: "PlantDetail"); - - migrationBuilder.DropColumn( - name: "LevelMax", - table: "PlantDetail"); - } - - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "LevelAct", - table: "PlantDetail", - type: "float", - nullable: false, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "LevelMax", - table: "PlantDetail", - type: "float", - nullable: false, - defaultValue: 9999.0); - } - - #endregion Protected Methods - } -} \ No newline at end of file diff --git a/GWMS.Data/Migrations/20210607112525_UpdatePlantData.Designer.cs b/GWMS.Data/Migrations/20210607112525_UpdatePlantData.Designer.cs deleted file mode 100644 index 7975894..0000000 --- a/GWMS.Data/Migrations/20210607112525_UpdatePlantData.Designer.cs +++ /dev/null @@ -1,763 +0,0 @@ -// -using System; -using GWMS.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace GWMS.Data.Migrations -{ - [DbContext(typeof(GWMSContext))] - [Migration("20210607112525_UpdatePlantData")] - partial class UpdatePlantData - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasComment("Descrizione dell'item"); - - b.Property("ValFloat") - .HasColumnType("int"); - - b.Property("ValInt") - .HasColumnType("int"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("KeyName"); - - b.ToTable("AnKeyVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AuthModel", b => - { - b.Property("AuthRole") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("AuthRole"); - - b.Property("Description") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Description"); - - b.HasKey("AuthRole"); - - b.ToTable("Auths"); - - b.HasData( - new - { - AuthRole = "User", - Description = "Base User" - }, - new - { - AuthRole = "AppAdmin", - Description = "App Admin User" - }, - new - { - AuthRole = "Supervisor", - Description = "Supervisor User" - }, - new - { - AuthRole = "PlantUser", - Description = "Plant User" - }, - new - { - AuthRole = "SupplSuperUser", - Description = "Supplier Super User" - }, - new - { - AuthRole = "SupplUser", - Description = "Supplier Standard User" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ValStd") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasComment("Valore di default/riferimento per la variabile"); - - b.HasKey("KeyName"); - - b.ToTable("Config"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b => - { - b.Property("ItemId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ItemCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ItemDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ItemType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UM") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("ItemId"); - - b.ToTable("Items"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b => - { - b.Property("TabName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("TabName"); - - b.Property("FieldName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("FieldName"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("Val"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Descript"); - - b.Property("Ordinal") - .HasColumnType("int") - .HasColumnName("Ordinal"); - - b.HasKey("TabName", "FieldName", "Val"); - - b.ToTable("ListVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b => - { - b.Property("OrderId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("DtExecEnd") - .HasColumnType("datetime2"); - - b.Property("DtExecStart") - .HasColumnType("datetime2"); - - b.Property("DtOrder") - .HasColumnType("datetime2"); - - b.Property("ExecutionQty") - .HasColumnType("float"); - - b.Property("OrderCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("OrderDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OrderQty") - .HasColumnType("float"); - - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("TransporterId") - .HasColumnType("int"); - - b.HasKey("OrderId"); - - b.HasIndex("PlantId"); - - b.HasIndex("SupplierId"); - - b.HasIndex("TransporterId"); - - b.ToTable("Order"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b => - { - b.Property("PlantId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("LevelAct") - .HasColumnType("float"); - - b.Property("LevelMax") - .HasColumnType("float"); - - b.Property("PlantCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PlantDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId"); - - b.ToTable("PlantDetail"); - - b.HasData( - new - { - PlantId = 1, - LevelAct = 0.0, - LevelMax = 28000.0, - PlantCode = "PIZ03", - PlantDesc = "Collecchio" - }, - new - { - PlantId = 2, - LevelAct = 0.0, - LevelMax = 28000.0, - PlantCode = "PIZ04", - PlantDesc = "Noceto" - }, - new - { - PlantId = 3, - LevelAct = 0.0, - LevelMax = 24000.0, - PlantCode = "PIZ05", - PlantDesc = "Baganzola" - }, - new - { - PlantId = 4, - LevelAct = 0.0, - LevelMax = 24000.0, - PlantCode = "PIZ08", - PlantDesc = "Pilastrello" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.Property("PlantDataId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantDataId"); - - b.HasIndex("PlantId"); - - b.ToTable("PlantLog"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId", "FluxType"); - - b.ToTable("PlantStatus"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantSupplWeekPlanModel", b => - { - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("DayNum") - .HasColumnType("int"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId", "SupplierId", "DayNum"); - - b.HasIndex("SupplierId"); - - b.ToTable("PlantSupplWeekPlan"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b => - { - b.Property("SupplierId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("SupplierCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("SupplierDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("SupplierId"); - - b.ToTable("Supplier"); - - b.HasData( - new - { - SupplierId = 1, - SupplierCode = "SUPSIM01", - SupplierDesc = "Fornitore 01" - }, - new - { - SupplierId = 2, - SupplierCode = "SUPSIM02", - SupplierDesc = "Fornitore 02" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b => - { - b.Property("TransporterId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("PositionLatitude") - .HasColumnType("float"); - - b.Property("PositionLongitude") - .HasColumnType("float"); - - b.Property("PositionUpdated") - .HasColumnType("datetime2"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("TransporterCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("TransporterDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("TransporterId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Transporter"); - - b.HasData( - new - { - TransporterId = 1, - PositionLatitude = 0.0, - PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(985), - SupplierId = 1, - TransporterCode = "TSIM01", - TransporterDesc = "Trasportatore SIM 01" - }, - new - { - TransporterId = 2, - PositionLatitude = 0.0, - PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(1704), - SupplierId = 1, - TransporterCode = "TSIM02", - TransporterDesc = "Trasportatore SIM 02" - }, - new - { - TransporterId = 3, - PositionLatitude = 0.0, - PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(1715), - SupplierId = 2, - TransporterCode = "TSIM03", - TransporterDesc = "Trasportatore SIM 03" - }, - new - { - TransporterId = 4, - PositionLatitude = 0.0, - PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(1717), - SupplierId = 2, - TransporterCode = "TSIM04", - TransporterDesc = "Trasportatore SIM 04" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.Property("UserId") - .HasColumnType("int"); - - b.Property("AuthRole") - .HasColumnType("nvarchar(50)"); - - b.Property("AuthLevel") - .HasColumnType("int"); - - b.HasKey("UserId", "AuthRole"); - - b.HasIndex("AuthRole"); - - b.ToTable("UserAuth"); - - b.HasData( - new - { - UserId = 1, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 2, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 3, - AuthRole = "Supervisor", - AuthLevel = 0 - }, - new - { - UserId = 4, - AuthRole = "PlantUser", - AuthLevel = 0 - }, - new - { - UserId = 5, - AuthRole = "SupplSuperUser", - AuthLevel = 0 - }, - new - { - UserId = 6, - AuthRole = "SupplUser", - AuthLevel = 0 - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AuthKey") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Domain") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ExtCode") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Firstname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Lang") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("Lastname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UserName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("UserId"); - - b.ToTable("Users"); - - b.HasData( - new - { - UserId = 1, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "samuele@steamware.net", - ExtCode = "", - Firstname = "Samuele", - IsActive = true, - Lang = "IT", - Lastname = "Locatelli", - UserName = "samuele" - }, - new - { - UserId = 2, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "giancarlo@steamware.net", - ExtCode = "", - Firstname = "Giancarlo", - IsActive = true, - Lang = "IT", - Lastname = "Rottoli", - UserName = "giancarlo" - }, - new - { - UserId = 3, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User03", - UserName = "user03" - }, - new - { - UserId = 4, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User04", - UserName = "user04" - }, - new - { - UserId = 5, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User05", - UserName = "user05" - }, - new - { - UserId = 6, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User06", - UserName = "user06" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter") - .WithMany() - .HasForeignKey("TransporterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - - b.Navigation("Supplier"); - - b.Navigation("Transporter"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantSupplWeekPlanModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.AuthModel", "Role") - .WithMany() - .HasForeignKey("AuthRole") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.UserModel", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/GWMS.Data/Migrations/20210607112525_UpdatePlantData.cs b/GWMS.Data/Migrations/20210607112525_UpdatePlantData.cs deleted file mode 100644 index bebd995..0000000 --- a/GWMS.Data/Migrations/20210607112525_UpdatePlantData.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace GWMS.Data.Migrations -{ - public partial class UpdatePlantData : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 1, - columns: new[] { "LevelMax", "PlantCode", "PlantDesc" }, - values: new object[] { 28000.0, "PIZ03", "Collecchio" }); - - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 2, - columns: new[] { "LevelMax", "PlantCode", "PlantDesc" }, - values: new object[] { 28000.0, "PIZ04", "Noceto" }); - - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 3, - columns: new[] { "LevelMax", "PlantCode", "PlantDesc" }, - values: new object[] { 24000.0, "PIZ05", "Baganzola" }); - - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 4, - columns: new[] { "LevelMax", "PlantCode", "PlantDesc" }, - values: new object[] { 24000.0, "PIZ08", "Pilastrello" }); - - migrationBuilder.InsertData( - table: "Supplier", - columns: new[] { "SupplierId", "SupplierCode", "SupplierDesc" }, - values: new object[,] - { - { 1, "SUPSIM01", "Fornitore 01" }, - { 2, "SUPSIM02", "Fornitore 02" } - }); - - migrationBuilder.InsertData( - table: "Transporter", - columns: new[] { "TransporterId", "PositionLatitude", "PositionLongitude", "PositionUpdated", "SupplierId", "TransporterCode", "TransporterDesc" }, - values: new object[,] - { - { 1, 0.0, 0.0, new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(985), 1, "TSIM01", "Trasportatore SIM 01" }, - { 2, 0.0, 0.0, new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(1704), 1, "TSIM02", "Trasportatore SIM 02" }, - { 3, 0.0, 0.0, new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(1715), 2, "TSIM03", "Trasportatore SIM 03" }, - { 4, 0.0, 0.0, new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(1717), 2, "TSIM04", "Trasportatore SIM 04" } - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 1); - - migrationBuilder.DeleteData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 2); - - migrationBuilder.DeleteData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 3); - - migrationBuilder.DeleteData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 4); - - migrationBuilder.DeleteData( - table: "Supplier", - keyColumn: "SupplierId", - keyValue: 1); - - migrationBuilder.DeleteData( - table: "Supplier", - keyColumn: "SupplierId", - keyValue: 2); - - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 1, - columns: new[] { "LevelMax", "PlantCode", "PlantDesc" }, - values: new object[] { 9999.0, "PSIM01", "Impianto SIM 01" }); - - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 2, - columns: new[] { "LevelMax", "PlantCode", "PlantDesc" }, - values: new object[] { 9999.0, "PSIM02", "Impianto SIM 02" }); - - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 3, - columns: new[] { "LevelMax", "PlantCode", "PlantDesc" }, - values: new object[] { 9999.0, "PSIM03", "Impianto SIM 03" }); - - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 4, - columns: new[] { "LevelMax", "PlantCode", "PlantDesc" }, - values: new object[] { 9999.0, "PSIM04", "Impianto SIM 04" }); - } - } -} diff --git a/GWMS.Data/Migrations/20210607140427_UpdatePlantData2.cs b/GWMS.Data/Migrations/20210607140427_UpdatePlantData2.cs deleted file mode 100644 index 77dd04c..0000000 --- a/GWMS.Data/Migrations/20210607140427_UpdatePlantData2.cs +++ /dev/null @@ -1,164 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace GWMS.Data.Migrations -{ - public partial class UpdatePlantData2 : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "PressAct", - table: "PlantDetail", - type: "float", - nullable: false, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "PressBHAct", - table: "PlantDetail", - type: "float", - nullable: false, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "PressBHMax", - table: "PlantDetail", - type: "float", - nullable: false, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "PressBLAct", - table: "PlantDetail", - type: "float", - nullable: false, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "PressBLMax", - table: "PlantDetail", - type: "float", - nullable: false, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "PressMax", - table: "PlantDetail", - type: "float", - nullable: false, - defaultValue: 0.0); - - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 1, - columns: new[] { "PressBHMax", "PressBLMax", "PressMax" }, - values: new object[] { 270.0, 270.0, 19.0 }); - - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 2, - columns: new[] { "PressBHMax", "PressBLMax", "PressMax" }, - values: new object[] { 270.0, 270.0, 19.0 }); - - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 3, - columns: new[] { "PressBHMax", "PressBLMax", "PressMax" }, - values: new object[] { 270.0, 270.0, 19.0 }); - - migrationBuilder.UpdateData( - table: "PlantDetail", - keyColumn: "PlantId", - keyValue: 4, - columns: new[] { "PressBHMax", "PressBLMax", "PressMax" }, - values: new object[] { 270.0, 270.0, 19.0 }); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 1, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2116)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 2, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2799)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 3, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2809)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 4, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2811)); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "PressAct", - table: "PlantDetail"); - - migrationBuilder.DropColumn( - name: "PressBHAct", - table: "PlantDetail"); - - migrationBuilder.DropColumn( - name: "PressBHMax", - table: "PlantDetail"); - - migrationBuilder.DropColumn( - name: "PressBLAct", - table: "PlantDetail"); - - migrationBuilder.DropColumn( - name: "PressBLMax", - table: "PlantDetail"); - - migrationBuilder.DropColumn( - name: "PressMax", - table: "PlantDetail"); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 1, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(985)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 2, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(1704)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 3, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(1715)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 4, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 13, 25, 25, 232, DateTimeKind.Local).AddTicks(1717)); - } - } -} diff --git a/GWMS.Data/Migrations/20210619150155_OrderETA.Designer.cs b/GWMS.Data/Migrations/20210619150155_OrderETA.Designer.cs deleted file mode 100644 index 9c393f4..0000000 --- a/GWMS.Data/Migrations/20210619150155_OrderETA.Designer.cs +++ /dev/null @@ -1,808 +0,0 @@ -// -using System; -using GWMS.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace GWMS.Data.Migrations -{ - [DbContext(typeof(GWMSContext))] - [Migration("20210619150155_OrderETA")] - partial class OrderETA - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasComment("Descrizione dell'item"); - - b.Property("ValFloat") - .HasColumnType("int"); - - b.Property("ValInt") - .HasColumnType("int"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("KeyName"); - - b.ToTable("AnKeyVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.AuthModel", b => - { - b.Property("AuthRole") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("AuthRole"); - - b.Property("Description") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Description"); - - b.HasKey("AuthRole"); - - b.ToTable("Auths"); - - b.HasData( - new - { - AuthRole = "User", - Description = "Base User" - }, - new - { - AuthRole = "AppAdmin", - Description = "App Admin User" - }, - new - { - AuthRole = "Supervisor", - Description = "Supervisor User" - }, - new - { - AuthRole = "PlantUser", - Description = "Plant User" - }, - new - { - AuthRole = "SupplSuperUser", - Description = "Supplier Super User" - }, - new - { - AuthRole = "SupplUser", - Description = "Supplier Standard User" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b => - { - b.Property("KeyName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ValStd") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasComment("Valore di default/riferimento per la variabile"); - - b.HasKey("KeyName"); - - b.ToTable("Config"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b => - { - b.Property("ItemId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ItemCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ItemDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ItemType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UM") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("ItemId"); - - b.ToTable("Items"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b => - { - b.Property("TabName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("TabName"); - - b.Property("FieldName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("FieldName"); - - b.Property("Val") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("Val"); - - b.Property("Descript") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)") - .HasColumnName("Descript"); - - b.Property("Ordinal") - .HasColumnType("int") - .HasColumnName("Ordinal"); - - b.HasKey("TabName", "FieldName", "Val"); - - b.ToTable("ListVal"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b => - { - b.Property("OrderId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("DtETA") - .HasColumnType("datetime2"); - - b.Property("DtExecEnd") - .HasColumnType("datetime2"); - - b.Property("DtExecStart") - .HasColumnType("datetime2"); - - b.Property("DtOrder") - .HasColumnType("datetime2"); - - b.Property("ExecutionQty") - .HasColumnType("float"); - - b.Property("OrderCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("OrderDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OrderQty") - .HasColumnType("float"); - - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("TransporterId") - .HasColumnType("int"); - - b.HasKey("OrderId"); - - b.HasIndex("PlantId"); - - b.HasIndex("SupplierId"); - - b.HasIndex("TransporterId"); - - b.ToTable("Order"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b => - { - b.Property("PlantId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("LevelAct") - .HasColumnType("float"); - - b.Property("LevelMax") - .HasColumnType("float"); - - b.Property("PlantCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PlantDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("PressAct") - .HasColumnType("float"); - - b.Property("PressBHAct") - .HasColumnType("float"); - - b.Property("PressBHMax") - .HasColumnType("float"); - - b.Property("PressBLAct") - .HasColumnType("float"); - - b.Property("PressBLMax") - .HasColumnType("float"); - - b.Property("PressMax") - .HasColumnType("float"); - - b.HasKey("PlantId"); - - b.ToTable("PlantDetail"); - - b.HasData( - new - { - PlantId = 1, - LevelAct = 0.0, - LevelMax = 28000.0, - PlantCode = "PIZ03", - PlantDesc = "Collecchio", - PressAct = 0.0, - PressBHAct = 0.0, - PressBHMax = 270.0, - PressBLAct = 0.0, - PressBLMax = 270.0, - PressMax = 19.0 - }, - new - { - PlantId = 2, - LevelAct = 0.0, - LevelMax = 28000.0, - PlantCode = "PIZ04", - PlantDesc = "Noceto", - PressAct = 0.0, - PressBHAct = 0.0, - PressBHMax = 270.0, - PressBLAct = 0.0, - PressBLMax = 270.0, - PressMax = 19.0 - }, - new - { - PlantId = 3, - LevelAct = 0.0, - LevelMax = 24000.0, - PlantCode = "PIZ05", - PlantDesc = "Baganzola", - PressAct = 0.0, - PressBHAct = 0.0, - PressBHMax = 270.0, - PressBLAct = 0.0, - PressBLMax = 270.0, - PressMax = 19.0 - }, - new - { - PlantId = 4, - LevelAct = 0.0, - LevelMax = 24000.0, - PlantCode = "PIZ08", - PlantDesc = "Pilastrello", - PressAct = 0.0, - PressBHAct = 0.0, - PressBHMax = 270.0, - PressBLAct = 0.0, - PressBLMax = 270.0, - PressMax = 19.0 - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.Property("PlantDataId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantDataId"); - - b.HasIndex("PlantId"); - - b.ToTable("PlantLog"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("FluxType") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("DtEvent") - .HasColumnType("datetime2"); - - b.Property("ValNumber") - .HasColumnType("float"); - - b.Property("ValString") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId", "FluxType"); - - b.ToTable("PlantStatus"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantSupplWeekPlanModel", b => - { - b.Property("PlantId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("DayNum") - .HasColumnType("int"); - - b.Property("Note") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("PlantId", "SupplierId", "DayNum"); - - b.HasIndex("SupplierId"); - - b.ToTable("PlantSupplWeekPlan"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b => - { - b.Property("SupplierId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("SupplierCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("SupplierDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("SupplierId"); - - b.ToTable("Supplier"); - - b.HasData( - new - { - SupplierId = 1, - SupplierCode = "SUPSIM01", - SupplierDesc = "Fornitore 01" - }, - new - { - SupplierId = 2, - SupplierCode = "SUPSIM02", - SupplierDesc = "Fornitore 02" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b => - { - b.Property("TransporterId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("PositionLatitude") - .HasColumnType("float"); - - b.Property("PositionLongitude") - .HasColumnType("float"); - - b.Property("PositionUpdated") - .HasColumnType("datetime2"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("TransporterCode") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("TransporterDesc") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.HasKey("TransporterId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Transporter"); - - b.HasData( - new - { - TransporterId = 1, - PositionLatitude = 0.0, - PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(17), - SupplierId = 1, - TransporterCode = "TSIM01", - TransporterDesc = "Trasportatore SIM 01" - }, - new - { - TransporterId = 2, - PositionLatitude = 0.0, - PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(684), - SupplierId = 1, - TransporterCode = "TSIM02", - TransporterDesc = "Trasportatore SIM 02" - }, - new - { - TransporterId = 3, - PositionLatitude = 0.0, - PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(694), - SupplierId = 2, - TransporterCode = "TSIM03", - TransporterDesc = "Trasportatore SIM 03" - }, - new - { - TransporterId = 4, - PositionLatitude = 0.0, - PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(696), - SupplierId = 2, - TransporterCode = "TSIM04", - TransporterDesc = "Trasportatore SIM 04" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.Property("UserId") - .HasColumnType("int"); - - b.Property("AuthRole") - .HasColumnType("nvarchar(50)"); - - b.Property("AuthLevel") - .HasColumnType("int"); - - b.HasKey("UserId", "AuthRole"); - - b.HasIndex("AuthRole"); - - b.ToTable("UserAuth"); - - b.HasData( - new - { - UserId = 1, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 2, - AuthRole = "AppAdmin", - AuthLevel = 0 - }, - new - { - UserId = 3, - AuthRole = "Supervisor", - AuthLevel = 0 - }, - new - { - UserId = 4, - AuthRole = "PlantUser", - AuthLevel = 0 - }, - new - { - UserId = 5, - AuthRole = "SupplSuperUser", - AuthLevel = 0 - }, - new - { - UserId = 6, - AuthRole = "SupplUser", - AuthLevel = 0 - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AuthKey") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Domain") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ExtCode") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Firstname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Lang") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("Lastname") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UserName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("UserId"); - - b.ToTable("Users"); - - b.HasData( - new - { - UserId = 1, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "samuele@steamware.net", - ExtCode = "", - Firstname = "Samuele", - IsActive = true, - Lang = "IT", - Lastname = "Locatelli", - UserName = "samuele" - }, - new - { - UserId = 2, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "giancarlo@steamware.net", - ExtCode = "", - Firstname = "Giancarlo", - IsActive = true, - Lang = "IT", - Lastname = "Rottoli", - UserName = "giancarlo" - }, - new - { - UserId = 3, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User03", - UserName = "user03" - }, - new - { - UserId = 4, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User04", - UserName = "user04" - }, - new - { - UserId = 5, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User05", - UserName = "user05" - }, - new - { - UserId = 6, - AuthKey = "thisIsTh3R1verOfTheNight90", - Domain = "", - Email = "info@steamware.net", - ExtCode = "", - Firstname = "Steamware", - IsActive = true, - Lang = "IT", - Lastname = "User06", - UserName = "user06" - }); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter") - .WithMany() - .HasForeignKey("TransporterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - - b.Navigation("Supplier"); - - b.Navigation("Transporter"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantSupplWeekPlanModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Plant"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("GWMS.Data.DatabaseModels.UserAuthModel", b => - { - b.HasOne("GWMS.Data.DatabaseModels.AuthModel", "Role") - .WithMany() - .HasForeignKey("AuthRole") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("GWMS.Data.DatabaseModels.UserModel", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/GWMS.Data/Migrations/20210619150155_OrderETA.cs b/GWMS.Data/Migrations/20210619150155_OrderETA.cs deleted file mode 100644 index aa263ba..0000000 --- a/GWMS.Data/Migrations/20210619150155_OrderETA.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace GWMS.Data.Migrations -{ - public partial class OrderETA : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "DtETA", - table: "Order", - type: "datetime2", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 1, - column: "PositionUpdated", - value: new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(17)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 2, - column: "PositionUpdated", - value: new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(684)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 3, - column: "PositionUpdated", - value: new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(694)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 4, - column: "PositionUpdated", - value: new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(696)); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "DtETA", - table: "Order"); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 1, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2116)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 2, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2799)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 3, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2809)); - - migrationBuilder.UpdateData( - table: "Transporter", - keyColumn: "TransporterId", - keyValue: 4, - column: "PositionUpdated", - value: new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2811)); - } - } -} diff --git a/GWMS.Data/Migrations/20210607140427_UpdatePlantData2.Designer.cs b/GWMS.Data/Migrations/20210622112111_InitDb.Designer.cs similarity index 82% rename from GWMS.Data/Migrations/20210607140427_UpdatePlantData2.Designer.cs rename to GWMS.Data/Migrations/20210622112111_InitDb.Designer.cs index dfec2bf..42fc648 100644 --- a/GWMS.Data/Migrations/20210607140427_UpdatePlantData2.Designer.cs +++ b/GWMS.Data/Migrations/20210622112111_InitDb.Designer.cs @@ -3,34 +3,31 @@ using System; using GWMS.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace GWMS.Data.Migrations { [DbContext(typeof(GWMSContext))] - [Migration("20210607140427_UpdatePlantData2")] - partial class UpdatePlantData2 + [Migration("20210622112111_InitDb")] + partial class InitDb { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasAnnotation("Relational:MaxIdentifierLength", 64) + .HasAnnotation("ProductVersion", "5.0.6"); modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b => { b.Property("KeyName") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("Descript") .HasMaxLength(250) - .HasColumnType("nvarchar(250)") + .HasColumnType("varchar(250)") .HasComment("Descrizione dell'item"); b.Property("ValFloat") @@ -41,7 +38,7 @@ namespace GWMS.Data.Migrations b.Property("ValString") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("KeyName"); @@ -52,12 +49,12 @@ namespace GWMS.Data.Migrations { b.Property("AuthRole") .HasMaxLength(50) - .HasColumnType("nvarchar(50)") + .HasColumnType("varchar(50)") .HasColumnName("AuthRole"); b.Property("Description") .HasMaxLength(250) - .HasColumnType("nvarchar(250)") + .HasColumnType("varchar(250)") .HasColumnName("Description"); b.HasKey("AuthRole"); @@ -101,19 +98,19 @@ namespace GWMS.Data.Migrations { b.Property("KeyName") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("Note") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("Val") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("ValStd") .HasMaxLength(50) - .HasColumnType("nvarchar(50)") + .HasColumnType("varchar(50)") .HasComment("Valore di default/riferimento per la variabile"); b.HasKey("KeyName"); @@ -125,24 +122,23 @@ namespace GWMS.Data.Migrations { b.Property("ItemId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("ItemCode") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("ItemDesc") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("ItemType") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("UM") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.HasKey("ItemId"); @@ -153,22 +149,22 @@ namespace GWMS.Data.Migrations { b.Property("TabName") .HasMaxLength(50) - .HasColumnType("nvarchar(50)") + .HasColumnType("varchar(50)") .HasColumnName("TabName"); b.Property("FieldName") .HasMaxLength(50) - .HasColumnType("nvarchar(50)") + .HasColumnType("varchar(50)") .HasColumnName("FieldName"); b.Property("Val") .HasMaxLength(50) - .HasColumnType("nvarchar(50)") + .HasColumnType("varchar(50)") .HasColumnName("Val"); b.Property("Descript") .HasMaxLength(250) - .HasColumnType("nvarchar(250)") + .HasColumnType("varchar(250)") .HasColumnName("Descript"); b.Property("Ordinal") @@ -184,31 +180,33 @@ namespace GWMS.Data.Migrations { b.Property("OrderId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); + + b.Property("DtETA") + .HasColumnType("datetime(6)"); b.Property("DtExecEnd") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("DtExecStart") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("DtOrder") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("ExecutionQty") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("OrderCode") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("OrderDesc") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("OrderQty") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PlantId") .HasColumnType("int"); @@ -234,40 +232,39 @@ namespace GWMS.Data.Migrations { b.Property("PlantId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("LevelAct") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("LevelMax") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PlantCode") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("PlantDesc") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("PressAct") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PressBHAct") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PressBHMax") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PressBLAct") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PressBLMax") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PressMax") - .HasColumnType("float"); + .HasColumnType("double"); b.HasKey("PlantId"); @@ -336,25 +333,24 @@ namespace GWMS.Data.Migrations { b.Property("PlantDataId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("DtEvent") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("FluxType") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("PlantId") .HasColumnType("int"); b.Property("ValNumber") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("ValString") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("PlantDataId"); @@ -370,17 +366,17 @@ namespace GWMS.Data.Migrations b.Property("FluxType") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("DtEvent") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("ValNumber") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("ValString") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("PlantId", "FluxType"); @@ -400,7 +396,7 @@ namespace GWMS.Data.Migrations b.Property("Note") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("PlantId", "SupplierId", "DayNum"); @@ -413,16 +409,15 @@ namespace GWMS.Data.Migrations { b.Property("SupplierId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("SupplierCode") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("SupplierDesc") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("SupplierId"); @@ -432,14 +427,14 @@ namespace GWMS.Data.Migrations new { SupplierId = 1, - SupplierCode = "SUPSIM01", - SupplierDesc = "Fornitore 01" + SupplierCode = "LIQUIGAS", + SupplierDesc = "Fornitore Liquigas" }, new { SupplierId = 2, - SupplierCode = "SUPSIM02", - SupplierDesc = "Fornitore 02" + SupplierCode = "VULKANGAS", + SupplierDesc = "Fornitore Vulkangas" }); }); @@ -447,28 +442,27 @@ namespace GWMS.Data.Migrations { b.Property("TransporterId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("PositionLatitude") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PositionLongitude") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PositionUpdated") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("SupplierId") .HasColumnType("int"); b.Property("TransporterCode") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("TransporterDesc") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("TransporterId"); @@ -482,7 +476,7 @@ namespace GWMS.Data.Migrations TransporterId = 1, PositionLatitude = 0.0, PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2116), + PositionUpdated = new DateTime(2021, 6, 22, 13, 21, 10, 762, DateTimeKind.Local).AddTicks(9452), SupplierId = 1, TransporterCode = "TSIM01", TransporterDesc = "Trasportatore SIM 01" @@ -492,7 +486,7 @@ namespace GWMS.Data.Migrations TransporterId = 2, PositionLatitude = 0.0, PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2799), + PositionUpdated = new DateTime(2021, 6, 22, 13, 21, 10, 763, DateTimeKind.Local).AddTicks(152), SupplierId = 1, TransporterCode = "TSIM02", TransporterDesc = "Trasportatore SIM 02" @@ -502,7 +496,7 @@ namespace GWMS.Data.Migrations TransporterId = 3, PositionLatitude = 0.0, PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2809), + PositionUpdated = new DateTime(2021, 6, 22, 13, 21, 10, 763, DateTimeKind.Local).AddTicks(162), SupplierId = 2, TransporterCode = "TSIM03", TransporterDesc = "Trasportatore SIM 03" @@ -512,7 +506,7 @@ namespace GWMS.Data.Migrations TransporterId = 4, PositionLatitude = 0.0, PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 7, 16, 4, 27, 345, DateTimeKind.Local).AddTicks(2811), + PositionUpdated = new DateTime(2021, 6, 22, 13, 21, 10, 763, DateTimeKind.Local).AddTicks(165), SupplierId = 2, TransporterCode = "TSIM04", TransporterDesc = "Trasportatore SIM 04" @@ -525,7 +519,7 @@ namespace GWMS.Data.Migrations .HasColumnType("int"); b.Property("AuthRole") - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("AuthLevel") .HasColumnType("int"); @@ -579,43 +573,42 @@ namespace GWMS.Data.Migrations { b.Property("UserId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("AuthKey") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("Domain") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("Email") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("ExtCode") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("Firstname") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("IsActive") - .HasColumnType("bit"); + .HasColumnType("tinyint(1)"); b.Property("Lang") .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); + .HasColumnType("varchar(10)"); b.Property("Lastname") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("UserName") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.HasKey("UserId"); diff --git a/GWMS.Data/Migrations/20210622112111_InitDb.cs b/GWMS.Data/Migrations/20210622112111_InitDb.cs new file mode 100644 index 0000000..45ad26e --- /dev/null +++ b/GWMS.Data/Migrations/20210622112111_InitDb.cs @@ -0,0 +1,507 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace GWMS.Data.Migrations +{ + public partial class InitDb : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AnKeyVal", + columns: table => new + { + KeyName = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ValInt = table.Column(type: "int", nullable: false), + ValFloat = table.Column(type: "int", nullable: false), + ValString = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Descript = table.Column(type: "varchar(250)", maxLength: 250, nullable: true, comment: "Descrizione dell'item") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AnKeyVal", x => x.KeyName); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Auths", + columns: table => new + { + AuthRole = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_Auths", x => x.AuthRole); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Config", + columns: table => new + { + KeyName = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Val = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ValStd = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "Valore di default/riferimento per la variabile") + .Annotation("MySql:CharSet", "utf8mb4"), + Note = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_Config", x => x.KeyName); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Items", + columns: table => new + { + ItemId = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ItemCode = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemDesc = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemType = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UM = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_Items", x => x.ItemId); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ListVal", + columns: table => new + { + TabName = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + FieldName = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Val = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Descript = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Ordinal = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ListVal", x => new { x.TabName, x.FieldName, x.Val }); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PlantDetail", + columns: table => new + { + PlantId = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + PlantCode = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PlantDesc = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + LevelMax = table.Column(type: "double", nullable: false), + LevelAct = table.Column(type: "double", nullable: false), + PressMax = table.Column(type: "double", nullable: false), + PressAct = table.Column(type: "double", nullable: false), + PressBHMax = table.Column(type: "double", nullable: false), + PressBHAct = table.Column(type: "double", nullable: false), + PressBLMax = table.Column(type: "double", nullable: false), + PressBLAct = table.Column(type: "double", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PlantDetail", x => x.PlantId); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Supplier", + columns: table => new + { + SupplierId = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + SupplierCode = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SupplierDesc = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_Supplier", x => x.SupplierId); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + UserId = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Domain = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UserName = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Lastname = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Firstname = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Email = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Lang = table.Column(type: "varchar(10)", maxLength: 10, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AuthKey = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false), + ExtCode = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_Users", x => x.UserId); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PlantLog", + columns: table => new + { + PlantDataId = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + DtEvent = table.Column(type: "datetime(6)", nullable: false), + FluxType = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PlantId = table.Column(type: "int", nullable: false), + ValNumber = table.Column(type: "double", nullable: false), + ValString = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_PlantLog", x => x.PlantDataId); + table.ForeignKey( + name: "FK_PlantLog_PlantDetail_PlantId", + column: x => x.PlantId, + principalTable: "PlantDetail", + principalColumn: "PlantId", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PlantStatus", + columns: table => new + { + PlantId = table.Column(type: "int", nullable: false), + FluxType = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DtEvent = table.Column(type: "datetime(6)", nullable: false), + ValNumber = table.Column(type: "double", nullable: false), + ValString = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_PlantStatus", x => new { x.PlantId, x.FluxType }); + table.ForeignKey( + name: "FK_PlantStatus_PlantDetail_PlantId", + column: x => x.PlantId, + principalTable: "PlantDetail", + principalColumn: "PlantId", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PlantSupplWeekPlan", + columns: table => new + { + PlantId = table.Column(type: "int", nullable: false), + SupplierId = table.Column(type: "int", nullable: false), + DayNum = table.Column(type: "int", nullable: false), + Note = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_PlantSupplWeekPlan", x => new { x.PlantId, x.SupplierId, x.DayNum }); + table.ForeignKey( + name: "FK_PlantSupplWeekPlan_PlantDetail_PlantId", + column: x => x.PlantId, + principalTable: "PlantDetail", + principalColumn: "PlantId", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_PlantSupplWeekPlan_Supplier_SupplierId", + column: x => x.SupplierId, + principalTable: "Supplier", + principalColumn: "SupplierId", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Transporter", + columns: table => new + { + TransporterId = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + TransporterCode = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TransporterDesc = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PositionLatitude = table.Column(type: "double", nullable: false), + PositionLongitude = table.Column(type: "double", nullable: false), + PositionUpdated = table.Column(type: "datetime(6)", nullable: false), + SupplierId = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Transporter", x => x.TransporterId); + table.ForeignKey( + name: "FK_Transporter_Supplier_SupplierId", + column: x => x.SupplierId, + principalTable: "Supplier", + principalColumn: "SupplierId", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "UserAuth", + columns: table => new + { + UserId = table.Column(type: "int", nullable: false), + AuthRole = table.Column(type: "varchar(50)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + AuthLevel = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UserAuth", x => new { x.UserId, x.AuthRole }); + table.ForeignKey( + name: "FK_UserAuth_Auths_AuthRole", + column: x => x.AuthRole, + principalTable: "Auths", + principalColumn: "AuthRole", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UserAuth_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "UserId", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Order", + columns: table => new + { + OrderId = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + DtOrder = table.Column(type: "datetime(6)", nullable: false), + PlantId = table.Column(type: "int", nullable: false), + SupplierId = table.Column(type: "int", nullable: false), + TransporterId = table.Column(type: "int", nullable: false), + OrderCode = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OrderDesc = table.Column(type: "varchar(250)", maxLength: 250, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OrderQty = table.Column(type: "double", nullable: false), + DtETA = table.Column(type: "datetime(6)", nullable: false), + DtExecStart = table.Column(type: "datetime(6)", nullable: false), + DtExecEnd = table.Column(type: "datetime(6)", nullable: false), + ExecutionQty = table.Column(type: "double", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Order", x => x.OrderId); + table.ForeignKey( + name: "FK_Order_PlantDetail_PlantId", + column: x => x.PlantId, + principalTable: "PlantDetail", + principalColumn: "PlantId", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Order_Supplier_SupplierId", + column: x => x.SupplierId, + principalTable: "Supplier", + principalColumn: "SupplierId", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Order_Transporter_TransporterId", + column: x => x.TransporterId, + principalTable: "Transporter", + principalColumn: "TransporterId", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.InsertData( + table: "Auths", + columns: new[] { "AuthRole", "Description" }, + values: new object[,] + { + { "User", "Base User" }, + { "AppAdmin", "App Admin User" }, + { "Supervisor", "Supervisor User" }, + { "PlantUser", "Plant User" }, + { "SupplSuperUser", "Supplier Super User" }, + { "SupplUser", "Supplier Standard User" } + }); + + migrationBuilder.InsertData( + table: "PlantDetail", + columns: new[] { "PlantId", "LevelAct", "LevelMax", "PlantCode", "PlantDesc", "PressAct", "PressBHAct", "PressBHMax", "PressBLAct", "PressBLMax", "PressMax" }, + values: new object[,] + { + { 4, 0.0, 24000.0, "PIZ08", "Pilastrello", 0.0, 0.0, 270.0, 0.0, 270.0, 19.0 }, + { 3, 0.0, 24000.0, "PIZ05", "Baganzola", 0.0, 0.0, 270.0, 0.0, 270.0, 19.0 }, + { 1, 0.0, 28000.0, "PIZ03", "Collecchio", 0.0, 0.0, 270.0, 0.0, 270.0, 19.0 }, + { 2, 0.0, 28000.0, "PIZ04", "Noceto", 0.0, 0.0, 270.0, 0.0, 270.0, 19.0 } + }); + + migrationBuilder.InsertData( + table: "Supplier", + columns: new[] { "SupplierId", "SupplierCode", "SupplierDesc" }, + values: new object[,] + { + { 1, "LIQUIGAS", "Fornitore Liquigas" }, + { 2, "VULKANGAS", "Fornitore Vulkangas" } + }); + + migrationBuilder.InsertData( + table: "Users", + columns: new[] { "UserId", "AuthKey", "Domain", "Email", "ExtCode", "Firstname", "IsActive", "Lang", "Lastname", "UserName" }, + values: new object[,] + { + { 5, "thisIsTh3R1verOfTheNight90", "", "info@steamware.net", "", "Steamware", true, "IT", "User05", "user05" }, + { 1, "thisIsTh3R1verOfTheNight90", "", "samuele@steamware.net", "", "Samuele", true, "IT", "Locatelli", "samuele" }, + { 2, "thisIsTh3R1verOfTheNight90", "", "giancarlo@steamware.net", "", "Giancarlo", true, "IT", "Rottoli", "giancarlo" }, + { 3, "thisIsTh3R1verOfTheNight90", "", "info@steamware.net", "", "Steamware", true, "IT", "User03", "user03" }, + { 4, "thisIsTh3R1verOfTheNight90", "", "info@steamware.net", "", "Steamware", true, "IT", "User04", "user04" }, + { 6, "thisIsTh3R1verOfTheNight90", "", "info@steamware.net", "", "Steamware", true, "IT", "User06", "user06" } + }); + + migrationBuilder.InsertData( + table: "Transporter", + columns: new[] { "TransporterId", "PositionLatitude", "PositionLongitude", "PositionUpdated", "SupplierId", "TransporterCode", "TransporterDesc" }, + values: new object[,] + { + { 1, 0.0, 0.0, new DateTime(2021, 6, 22, 13, 21, 10, 762, DateTimeKind.Local).AddTicks(9452), 1, "TSIM01", "Trasportatore SIM 01" }, + { 2, 0.0, 0.0, new DateTime(2021, 6, 22, 13, 21, 10, 763, DateTimeKind.Local).AddTicks(152), 1, "TSIM02", "Trasportatore SIM 02" }, + { 3, 0.0, 0.0, new DateTime(2021, 6, 22, 13, 21, 10, 763, DateTimeKind.Local).AddTicks(162), 2, "TSIM03", "Trasportatore SIM 03" }, + { 4, 0.0, 0.0, new DateTime(2021, 6, 22, 13, 21, 10, 763, DateTimeKind.Local).AddTicks(165), 2, "TSIM04", "Trasportatore SIM 04" } + }); + + migrationBuilder.InsertData( + table: "UserAuth", + columns: new[] { "AuthRole", "UserId", "AuthLevel" }, + values: new object[,] + { + { "AppAdmin", 1, 0 }, + { "AppAdmin", 2, 0 }, + { "Supervisor", 3, 0 }, + { "PlantUser", 4, 0 }, + { "SupplSuperUser", 5, 0 }, + { "SupplUser", 6, 0 } + }); + + migrationBuilder.CreateIndex( + name: "IX_Order_PlantId", + table: "Order", + column: "PlantId"); + + migrationBuilder.CreateIndex( + name: "IX_Order_SupplierId", + table: "Order", + column: "SupplierId"); + + migrationBuilder.CreateIndex( + name: "IX_Order_TransporterId", + table: "Order", + column: "TransporterId"); + + migrationBuilder.CreateIndex( + name: "IX_PlantLog_PlantId", + table: "PlantLog", + column: "PlantId"); + + migrationBuilder.CreateIndex( + name: "IX_PlantSupplWeekPlan_SupplierId", + table: "PlantSupplWeekPlan", + column: "SupplierId"); + + migrationBuilder.CreateIndex( + name: "IX_Transporter_SupplierId", + table: "Transporter", + column: "SupplierId"); + + migrationBuilder.CreateIndex( + name: "IX_UserAuth_AuthRole", + table: "UserAuth", + column: "AuthRole"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AnKeyVal"); + + migrationBuilder.DropTable( + name: "Config"); + + migrationBuilder.DropTable( + name: "Items"); + + migrationBuilder.DropTable( + name: "ListVal"); + + migrationBuilder.DropTable( + name: "Order"); + + migrationBuilder.DropTable( + name: "PlantLog"); + + migrationBuilder.DropTable( + name: "PlantStatus"); + + migrationBuilder.DropTable( + name: "PlantSupplWeekPlan"); + + migrationBuilder.DropTable( + name: "UserAuth"); + + migrationBuilder.DropTable( + name: "Transporter"); + + migrationBuilder.DropTable( + name: "PlantDetail"); + + migrationBuilder.DropTable( + name: "Auths"); + + migrationBuilder.DropTable( + name: "Users"); + + migrationBuilder.DropTable( + name: "Supplier"); + } + } +} diff --git a/GWMS.Data/Migrations/GWMSContextModelSnapshot.cs b/GWMS.Data/Migrations/GWMSContextModelSnapshot.cs index 8193313..53b86b1 100644 --- a/GWMS.Data/Migrations/GWMSContextModelSnapshot.cs +++ b/GWMS.Data/Migrations/GWMSContextModelSnapshot.cs @@ -3,7 +3,6 @@ using System; using GWMS.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace GWMS.Data.Migrations @@ -15,20 +14,18 @@ namespace GWMS.Data.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasAnnotation("Relational:MaxIdentifierLength", 64) + .HasAnnotation("ProductVersion", "5.0.6"); modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b => { b.Property("KeyName") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("Descript") .HasMaxLength(250) - .HasColumnType("nvarchar(250)") + .HasColumnType("varchar(250)") .HasComment("Descrizione dell'item"); b.Property("ValFloat") @@ -39,7 +36,7 @@ namespace GWMS.Data.Migrations b.Property("ValString") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("KeyName"); @@ -50,12 +47,12 @@ namespace GWMS.Data.Migrations { b.Property("AuthRole") .HasMaxLength(50) - .HasColumnType("nvarchar(50)") + .HasColumnType("varchar(50)") .HasColumnName("AuthRole"); b.Property("Description") .HasMaxLength(250) - .HasColumnType("nvarchar(250)") + .HasColumnType("varchar(250)") .HasColumnName("Description"); b.HasKey("AuthRole"); @@ -99,19 +96,19 @@ namespace GWMS.Data.Migrations { b.Property("KeyName") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("Note") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("Val") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("ValStd") .HasMaxLength(50) - .HasColumnType("nvarchar(50)") + .HasColumnType("varchar(50)") .HasComment("Valore di default/riferimento per la variabile"); b.HasKey("KeyName"); @@ -123,24 +120,23 @@ namespace GWMS.Data.Migrations { b.Property("ItemId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("ItemCode") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("ItemDesc") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("ItemType") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("UM") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.HasKey("ItemId"); @@ -151,22 +147,22 @@ namespace GWMS.Data.Migrations { b.Property("TabName") .HasMaxLength(50) - .HasColumnType("nvarchar(50)") + .HasColumnType("varchar(50)") .HasColumnName("TabName"); b.Property("FieldName") .HasMaxLength(50) - .HasColumnType("nvarchar(50)") + .HasColumnType("varchar(50)") .HasColumnName("FieldName"); b.Property("Val") .HasMaxLength(50) - .HasColumnType("nvarchar(50)") + .HasColumnType("varchar(50)") .HasColumnName("Val"); b.Property("Descript") .HasMaxLength(250) - .HasColumnType("nvarchar(250)") + .HasColumnType("varchar(250)") .HasColumnName("Descript"); b.Property("Ordinal") @@ -182,34 +178,33 @@ namespace GWMS.Data.Migrations { b.Property("OrderId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("DtETA") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("DtExecEnd") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("DtExecStart") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("DtOrder") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("ExecutionQty") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("OrderCode") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("OrderDesc") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("OrderQty") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PlantId") .HasColumnType("int"); @@ -235,40 +230,39 @@ namespace GWMS.Data.Migrations { b.Property("PlantId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("LevelAct") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("LevelMax") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PlantCode") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("PlantDesc") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("PressAct") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PressBHAct") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PressBHMax") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PressBLAct") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PressBLMax") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PressMax") - .HasColumnType("float"); + .HasColumnType("double"); b.HasKey("PlantId"); @@ -337,25 +331,24 @@ namespace GWMS.Data.Migrations { b.Property("PlantDataId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("DtEvent") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("FluxType") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("PlantId") .HasColumnType("int"); b.Property("ValNumber") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("ValString") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("PlantDataId"); @@ -371,17 +364,17 @@ namespace GWMS.Data.Migrations b.Property("FluxType") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("DtEvent") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("ValNumber") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("ValString") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("PlantId", "FluxType"); @@ -401,7 +394,7 @@ namespace GWMS.Data.Migrations b.Property("Note") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("PlantId", "SupplierId", "DayNum"); @@ -414,16 +407,15 @@ namespace GWMS.Data.Migrations { b.Property("SupplierId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("SupplierCode") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("SupplierDesc") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("SupplierId"); @@ -433,14 +425,14 @@ namespace GWMS.Data.Migrations new { SupplierId = 1, - SupplierCode = "SUPSIM01", - SupplierDesc = "Fornitore 01" + SupplierCode = "LIQUIGAS", + SupplierDesc = "Fornitore Liquigas" }, new { SupplierId = 2, - SupplierCode = "SUPSIM02", - SupplierDesc = "Fornitore 02" + SupplierCode = "VULKANGAS", + SupplierDesc = "Fornitore Vulkangas" }); }); @@ -448,28 +440,27 @@ namespace GWMS.Data.Migrations { b.Property("TransporterId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("PositionLatitude") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PositionLongitude") - .HasColumnType("float"); + .HasColumnType("double"); b.Property("PositionUpdated") - .HasColumnType("datetime2"); + .HasColumnType("datetime(6)"); b.Property("SupplierId") .HasColumnType("int"); b.Property("TransporterCode") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("TransporterDesc") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.HasKey("TransporterId"); @@ -483,7 +474,7 @@ namespace GWMS.Data.Migrations TransporterId = 1, PositionLatitude = 0.0, PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(17), + PositionUpdated = new DateTime(2021, 6, 22, 13, 21, 10, 762, DateTimeKind.Local).AddTicks(9452), SupplierId = 1, TransporterCode = "TSIM01", TransporterDesc = "Trasportatore SIM 01" @@ -493,7 +484,7 @@ namespace GWMS.Data.Migrations TransporterId = 2, PositionLatitude = 0.0, PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(684), + PositionUpdated = new DateTime(2021, 6, 22, 13, 21, 10, 763, DateTimeKind.Local).AddTicks(152), SupplierId = 1, TransporterCode = "TSIM02", TransporterDesc = "Trasportatore SIM 02" @@ -503,7 +494,7 @@ namespace GWMS.Data.Migrations TransporterId = 3, PositionLatitude = 0.0, PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(694), + PositionUpdated = new DateTime(2021, 6, 22, 13, 21, 10, 763, DateTimeKind.Local).AddTicks(162), SupplierId = 2, TransporterCode = "TSIM03", TransporterDesc = "Trasportatore SIM 03" @@ -513,7 +504,7 @@ namespace GWMS.Data.Migrations TransporterId = 4, PositionLatitude = 0.0, PositionLongitude = 0.0, - PositionUpdated = new DateTime(2021, 6, 19, 17, 1, 54, 616, DateTimeKind.Local).AddTicks(696), + PositionUpdated = new DateTime(2021, 6, 22, 13, 21, 10, 763, DateTimeKind.Local).AddTicks(165), SupplierId = 2, TransporterCode = "TSIM04", TransporterDesc = "Trasportatore SIM 04" @@ -526,7 +517,7 @@ namespace GWMS.Data.Migrations .HasColumnType("int"); b.Property("AuthRole") - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("AuthLevel") .HasColumnType("int"); @@ -580,43 +571,42 @@ namespace GWMS.Data.Migrations { b.Property("UserId") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("int"); b.Property("AuthKey") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("varchar(100)"); b.Property("Domain") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("Email") .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); + .HasColumnType("varchar(250)"); b.Property("ExtCode") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("Firstname") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("IsActive") - .HasColumnType("bit"); + .HasColumnType("tinyint(1)"); b.Property("Lang") .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); + .HasColumnType("varchar(10)"); b.Property("Lastname") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.Property("UserName") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("varchar(50)"); b.HasKey("UserId"); diff --git a/GWMS.Data/ModelBuilderExtensions.cs b/GWMS.Data/ModelBuilderExtensions.cs index 08a3c4e..bc79676 100644 --- a/GWMS.Data/ModelBuilderExtensions.cs +++ b/GWMS.Data/ModelBuilderExtensions.cs @@ -58,8 +58,8 @@ namespace GWMS.Data // inizializzazione dei valori di default x Fornitori modelBuilder.Entity().HasData( - new SupplierModel { SupplierId = 1, SupplierCode = "SUPSIM01", SupplierDesc = "Fornitore 01" }, - new SupplierModel { SupplierId = 2, SupplierCode = "SUPSIM02", SupplierDesc = "Fornitore 02" } + new SupplierModel { SupplierId = 1, SupplierCode = "LIQUIGAS", SupplierDesc = "Fornitore Liquigas" }, + new SupplierModel { SupplierId = 2, SupplierCode = "VULKANGAS", SupplierDesc = "Fornitore Vulkangas" } ); // inizializzazione dei valori di default x Trasportatori From e3e10bdd74d9810ed3260b74e778efd851bf6f77 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 22 Jun 2021 13:22:33 +0200 Subject: [PATCH 5/8] refresh --- GWMS.UI/Pages/UserManager.razor | 11 +++++++++++ GWMS.UI/Startup.cs | 3 +++ Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 GWMS.UI/Pages/UserManager.razor diff --git a/GWMS.UI/Pages/UserManager.razor b/GWMS.UI/Pages/UserManager.razor new file mode 100644 index 0000000..50316ec --- /dev/null +++ b/GWMS.UI/Pages/UserManager.razor @@ -0,0 +1,11 @@ +

UserManager

+ +Da definire: +
    +
  • username anonimo / email? email duplicate ammesse?
  • +
  • mappatura ruoli
  • +
+ +@code { + +} \ No newline at end of file diff --git a/GWMS.UI/Startup.cs b/GWMS.UI/Startup.cs index 41d736f..fe379b8 100644 --- a/GWMS.UI/Startup.cs +++ b/GWMS.UI/Startup.cs @@ -111,10 +111,13 @@ namespace GWMS.UI services.AddSingleton(); services.AddScoped(); +#if false // aggiunta quartz scheduler var scheduler = StdSchedulerFactory.GetDefaultScheduler().GetAwaiter().GetResult(); services.AddSingleton(scheduler); services.AddHostedService(); + +#endif } #endregion Public Methods diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 09c5ca3..4e003a0 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo statistiche MAPO -

Versione: 1.0.2106.2209

+

Versione: 1.0.2106.2213


Note di rilascio: