UI refresh fix
This commit is contained in:
parent
a49af51128
commit
ce489f4464
@ -1,3 +1,4 @@
|
||||
using System.Globalization;
|
||||
using System.Net;
|
||||
using Drab.Core.Configuration;
|
||||
using Drab.Core.Ioc;
|
||||
@ -11,6 +12,15 @@ using NLog.Extensions.Logging;
|
||||
using Pcm.Db.Ioc;
|
||||
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 configurationBuilder = new ConfigurationBuilder()
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
@using Drab.LocalDb.Entities
|
||||
@using Drab.Logic.Services
|
||||
@using Drab.Ui.Components
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Radzen
|
||||
@inject LocalDbContext LocalDbContext
|
||||
@inject DialogService DialogService
|
||||
@ -64,13 +65,13 @@
|
||||
</RadzenDataGrid>
|
||||
|
||||
@code {
|
||||
IQueryable<OrderDb> _orders;
|
||||
List<OrderDb> _orders;
|
||||
private RadzenDataGrid<OrderDb>? _dataGridRef;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
EventBus.OrdersChanged += OnOrdersChanged;
|
||||
_orders = LocalDbContext.Orders;
|
||||
_orders = LocalDbContext.Orders.AsNoTracking().ToList();
|
||||
}
|
||||
|
||||
private async Task RowClick(DataGridRowMouseEventArgs<OrderDb> obj)
|
||||
@ -92,8 +93,7 @@
|
||||
{
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
_orders = LocalDbContext.Orders;
|
||||
_dataGridRef?.Reload();
|
||||
_orders = LocalDbContext.Orders.AsNoTracking().ToList();
|
||||
_dataGridRef?.RefreshDataAsync();
|
||||
StateHasChanged();
|
||||
return Task.CompletedTask;
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"Microsoft.EntityFrameworkCore.Model.Validation": "None"
|
||||
}
|
||||
},
|
||||
"ListenPort": 80,
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
</targets>
|
||||
|
||||
<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.*" 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 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";
|
||||
|
||||
@ -13,6 +13,5 @@ public static class IocPcmDbRegister
|
||||
{
|
||||
options.EnableRetryOnFailure(int.MaxValue, TimeSpan.FromSeconds(10), null);
|
||||
}));
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user