diff --git a/GWMS.Data/Controllers/GWMSController.cs b/GWMS.Data/Controllers/GWMSController.cs index 56edfdb..cf55a19 100644 --- a/GWMS.Data/Controllers/GWMSController.cs +++ b/GWMS.Data/Controllers/GWMSController.cs @@ -46,6 +46,21 @@ namespace GWMS.Data.Controllers return roundDate; } + public bool DbForceMigrate() + { + bool answ = false; + try + { + dbCtx.DbForceMigrate(); + answ = true; + } + catch (Exception exc) + { + Log.Error($"Eccezione in DbForceMigrate"); + } + return answ; + } + public void Dispose() { // Clear database context diff --git a/GWMS.Data/GWMSContext.cs b/GWMS.Data/GWMSContext.cs index 3f8dc21..27aed6d 100644 --- a/GWMS.Data/GWMSContext.cs +++ b/GWMS.Data/GWMSContext.cs @@ -28,15 +28,6 @@ namespace GWMS.Data public GWMSContext(IConfiguration configuration) { _configuration = configuration; - try - { - // se non ci fosse... crea o migra! - Database.Migrate(); - } - catch (Exception exc) - { - Log.Error(exc, "Exception during context initialization 01"); - } } public GWMSContext(DbContextOptions options) : base(options) @@ -57,19 +48,29 @@ namespace GWMS.Data #region Public Properties public virtual DbSet DbRebootLog { get; set; } + public virtual DbSet DbSetConfig { get; set; } public virtual DbSet DbSetItems { get; set; } public virtual DbSet DbSetKeyVal { get; set; } + public virtual DbSet DbSetListVal { get; set; } + public virtual DbSet DbSetOrders { get; set; } + public virtual DbSet DbSetPlant { get; set; } + public virtual DbSet DbSetPlantLog { get; set; } + public virtual DbSet DbSetPlantStatus { get; set; } + public virtual DbSet DbSetPlantSupplWeekPlan { get; set; } + public virtual DbSet DbSetSupplier { get; set; } + public virtual DbSet DbSetTransporter { get; set; } + public virtual DbSet DbSetUser { get; set; } #endregion Public Properties @@ -133,5 +134,23 @@ namespace GWMS.Data } #endregion Protected Methods + + #region Public Methods + + public void DbForceMigrate() + { + try + { + // se non ci fosse... crea o migra! + Database.Migrate(); + Log.Info("DbForceMigrate: done!"); + } + catch (Exception exc) + { + Log.Error(exc, "DbForceMigrate: Exception during context initialization 01"); + } + } + + #endregion Public Methods } } \ No newline at end of file diff --git a/GWMS.UI/Components/PlantOverview.razor b/GWMS.UI/Components/PlantOverview.razor index 3645d38..ceabdf4 100644 --- a/GWMS.UI/Components/PlantOverview.razor +++ b/GWMS.UI/Components/PlantOverview.razor @@ -33,7 +33,7 @@
  • Alimentazione @getPressData("BHA", "N1") bar
  • -
  • PB Bassa
  • +
  • PB Media
  • Stoccaggio @getPressData("BL", "N1") bar
  • diff --git a/GWMS.UI/Data/GWMSDataService.cs b/GWMS.UI/Data/GWMSDataService.cs index 253c1f4..cdc560b 100644 --- a/GWMS.UI/Data/GWMSDataService.cs +++ b/GWMS.UI/Data/GWMSDataService.cs @@ -396,6 +396,11 @@ namespace GWMS.UI.Data return answ; } + public async Task DbForceMigrate() + { + return await Task.FromResult(dbController.DbForceMigrate()); + } + public void Dispose() { // Clear database controller diff --git a/GWMS.UI/GWMS.UI.csproj b/GWMS.UI/GWMS.UI.csproj index 8e77a20..2c51b9c 100644 --- a/GWMS.UI/GWMS.UI.csproj +++ b/GWMS.UI/GWMS.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.0.2109.2909 + 1.0.2109.2912 95c9f021-52d1-4390-a670-5810b7b777b0 true true diff --git a/GWMS.UI/Pages/Parameters.razor b/GWMS.UI/Pages/Parameters.razor index e2f57f1..a4f51bc 100644 --- a/GWMS.UI/Pages/Parameters.razor +++ b/GWMS.UI/Pages/Parameters.razor @@ -3,10 +3,6 @@ @using GWMS.UI.Data @using GWMS.UI.Components -@inject GWMSDataService DataService -@inject MessageService AppMService -@inject IJSRuntime JSRuntime -

    Setup Parametri

    @@ -24,30 +20,4 @@
    - - -@code { - - protected int numDays { get; set; } = 7; - protected int stepMin { get; set; } = 30; - protected int maxHourRate { get; set; } = 800; - - protected bool processRunning { get; set; } = false; - - protected async Task resetDB() - { - if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler risimulare l'intero set di dati?")) - return; - - processRunning = true; - //DataService.RegenDB(numDays, stepMin, maxHourRate); - processRunning = false; - } - - protected override async Task OnInitializedAsync() - { - AppMService.ShowSearch = false; - AppMService.PageName = "Setup Parametri"; - AppMService.PageIcon = "fas fa-wrench pr-2"; - } -} \ No newline at end of file + \ No newline at end of file diff --git a/GWMS.UI/Pages/Parameters.razor.cs b/GWMS.UI/Pages/Parameters.razor.cs new file mode 100644 index 0000000..6115b9b --- /dev/null +++ b/GWMS.UI/Pages/Parameters.razor.cs @@ -0,0 +1,52 @@ +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 Parameters + { + #region Protected Properties + + [Inject] + protected MessageService AppMService { get; set; } + + [Inject] + protected GWMSDataService DataService { get; set; } + + [Inject] + protected IJSRuntime JSRuntime { get; set; } + + protected int maxHourRate { get; set; } = 800; + protected int numDays { get; set; } = 7; + protected bool processRunning { get; set; } = false; + protected int stepMin { get; set; } = 30; + + #endregion Protected Properties + + #region Protected Methods + + protected override async Task OnInitializedAsync() + { + AppMService.ShowSearch = false; + AppMService.PageName = "Setup Parametri"; + AppMService.PageIcon = "fas fa-wrench pr-2"; + } + + protected async Task resetDB() + { + if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler risimulare l'intero set di dati?")) + return; + + processRunning = true; + //DataService.RegenDB(numDays, stepMin, maxHourRate); + processRunning = false; + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/GWMS.UI/Startup.cs b/GWMS.UI/Startup.cs index 58a0743..50e8d84 100644 --- a/GWMS.UI/Startup.cs +++ b/GWMS.UI/Startup.cs @@ -122,7 +122,7 @@ namespace GWMS.UI // inizializzo il DB e creo (se necessario) l'utente DbConfig.CheckUser(nKey, sKey); // verifico se serve applicazione migrazioni - //DbConfig.ExecMigrationMain(); + DbConfig.ExecMigrationMain(); //DbConfig.ExecMigrationIdentity(); // altri parametri per check vari diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 0963fbc..be499c8 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GWMS - Gas Warehouse Management System -

    Versione: 1.0.2109.2909

    +

    Versione: 1.0.2109.2912


    Note di rilascio:
    • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 9d1104d..9b3a73b 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.0.2109.2909 +1.0.2109.2912 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index b39adc7..2a06e38 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.0.2109.2909 + 1.0.2109.2912 http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html false