UI refresh fix
This commit is contained in:
parent
a49af51128
commit
ce489f4464
@ -1,3 +1,4 @@
|
|||||||
|
using System.Globalization;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using Drab.Core.Configuration;
|
using Drab.Core.Configuration;
|
||||||
using Drab.Core.Ioc;
|
using Drab.Core.Ioc;
|
||||||
@ -11,6 +12,15 @@ using NLog.Extensions.Logging;
|
|||||||
using Pcm.Db.Ioc;
|
using Pcm.Db.Ioc;
|
||||||
using Radzen;
|
using Radzen;
|
||||||
|
|
||||||
|
|
||||||
|
var culture = new CultureInfo("pl-PL");
|
||||||
|
CultureInfo.DefaultThreadCurrentCulture = culture;
|
||||||
|
CultureInfo.DefaultThreadCurrentUICulture = culture;
|
||||||
|
CultureInfo.CurrentCulture = culture;
|
||||||
|
CultureInfo.CurrentUICulture = culture;
|
||||||
|
Thread.CurrentThread.CurrentCulture = culture;
|
||||||
|
Thread.CurrentThread.CurrentUICulture = culture;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
var configurationBuilder = new ConfigurationBuilder()
|
var configurationBuilder = new ConfigurationBuilder()
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
@using Drab.LocalDb.Entities
|
@using Drab.LocalDb.Entities
|
||||||
@using Drab.Logic.Services
|
@using Drab.Logic.Services
|
||||||
@using Drab.Ui.Components
|
@using Drab.Ui.Components
|
||||||
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using Radzen
|
@using Radzen
|
||||||
@inject LocalDbContext LocalDbContext
|
@inject LocalDbContext LocalDbContext
|
||||||
@inject DialogService DialogService
|
@inject DialogService DialogService
|
||||||
@ -64,13 +65,13 @@
|
|||||||
</RadzenDataGrid>
|
</RadzenDataGrid>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
IQueryable<OrderDb> _orders;
|
List<OrderDb> _orders;
|
||||||
private RadzenDataGrid<OrderDb>? _dataGridRef;
|
private RadzenDataGrid<OrderDb>? _dataGridRef;
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
EventBus.OrdersChanged += OnOrdersChanged;
|
EventBus.OrdersChanged += OnOrdersChanged;
|
||||||
_orders = LocalDbContext.Orders;
|
_orders = LocalDbContext.Orders.AsNoTracking().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RowClick(DataGridRowMouseEventArgs<OrderDb> obj)
|
private async Task RowClick(DataGridRowMouseEventArgs<OrderDb> obj)
|
||||||
@ -92,8 +93,7 @@
|
|||||||
{
|
{
|
||||||
InvokeAsync(() =>
|
InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
_orders = LocalDbContext.Orders;
|
_orders = LocalDbContext.Orders.AsNoTracking().ToList();
|
||||||
_dataGridRef?.Reload();
|
|
||||||
_dataGridRef?.RefreshDataAsync();
|
_dataGridRef?.RefreshDataAsync();
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft": "Warning",
|
"Microsoft": "Warning",
|
||||||
"Microsoft.Hosting.Lifetime": "Information"
|
"Microsoft.Hosting.Lifetime": "Information",
|
||||||
|
"Microsoft.EntityFrameworkCore.Model.Validation": "None"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ListenPort": 80,
|
"ListenPort": 80,
|
||||||
|
|||||||
@ -25,6 +25,8 @@
|
|||||||
</targets>
|
</targets>
|
||||||
|
|
||||||
<rules>
|
<rules>
|
||||||
|
<logger name="Microsoft.EntityFrameworkCore.Model.Validation" minlevel="Info" final="true"/>
|
||||||
|
<logger name="Microsoft.EntityFrameworkCore.Query" minlevel="Info" final="true"/>
|
||||||
<logger name="Microsoft.Hosting.Lifetime" minlevel="Info" writeTo="File, Console" final="true"/>
|
<logger name="Microsoft.Hosting.Lifetime" minlevel="Info" writeTo="File, Console" final="true"/>
|
||||||
<logger name="Microsoft.*" maxlevel="Info" final="true"/>
|
<logger name="Microsoft.*" maxlevel="Info" final="true"/>
|
||||||
<logger name="System.Net.Http.*" maxlevel="Info" final="true"/>
|
<logger name="System.Net.Http.*" maxlevel="Info" final="true"/>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ namespace Pcm.Db.Ioc;
|
|||||||
|
|
||||||
public static class IocPcmDbRegister
|
public static class IocPcmDbRegister
|
||||||
{
|
{
|
||||||
public static IServiceCollection AddPcmDatabase(this IServiceCollection services, IDbConfiguration dbConfiguration)
|
public static void AddPcmDatabase(this IServiceCollection services, IDbConfiguration dbConfiguration)
|
||||||
{
|
{
|
||||||
var connectionString = $"Server={dbConfiguration.Host},{dbConfiguration.Port};Database={dbConfiguration.Database};User Id={dbConfiguration.User}; Password={dbConfiguration.Password}; TrustServerCertificate=True";
|
var connectionString = $"Server={dbConfiguration.Host},{dbConfiguration.Port};Database={dbConfiguration.Database};User Id={dbConfiguration.User}; Password={dbConfiguration.Password}; TrustServerCertificate=True";
|
||||||
|
|
||||||
@ -13,6 +13,5 @@ public static class IocPcmDbRegister
|
|||||||
{
|
{
|
||||||
options.EnableRetryOnFailure(int.MaxValue, TimeSpan.FromSeconds(10), null);
|
options.EnableRetryOnFailure(int.MaxValue, TimeSpan.FromSeconds(10), null);
|
||||||
}));
|
}));
|
||||||
return services;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user