-
-
-
-
+
+
+
+ Danmark
+
+
+ Kunder, Prisliste
+
+
Danmark ....
-
-
-
-
-
+
+
+
+
+
+ Norge
+
+
+ Kunder, Prisliste
+
+
Norge ....
-
-
-
-
-
+
+
+
\ No newline at end of file
+
diff --git a/Wonky.Client/Components/LandingComponentAdmin.razor.cs b/Wonky.Client/Components/LandingComponentAdmin.razor.cs
index 03b0c2d1..ecc05952 100644
--- a/Wonky.Client/Components/LandingComponentAdmin.razor.cs
+++ b/Wonky.Client/Components/LandingComponentAdmin.razor.cs
@@ -44,13 +44,20 @@ public partial class LandingComponentAdmin
private string WorkDate { get; set; } = $"{DateTime.Now:yyyy-MM-dd}";
private string Today { get; set; } = $"{DateTime.Now:yyyy-MM-dd}";
-
protected override async Task OnInitializedAsync()
{
+ ProfileService.OnChange += ProfileChanged;
Prefs = await ProfileService.GetPreferences();
- if(!string.IsNullOrWhiteSpace(Prefs.WorkDate))
- WorkDate = Prefs.WorkDate;
+ if (string.IsNullOrWhiteSpace(Prefs.WorkDate))
+ {
+ await ProfileService.SetWorkDate(DateTime.Now);
+ }
+ }
+
+ private void ProfileChanged(UserPref newPrefs)
+ {
+ Prefs = newPrefs;
+ WorkDate = Prefs.WorkDate;
}
-
}
diff --git a/Wonky.Client/Components/LandingComponentAdmin.razor.css b/Wonky.Client/Components/LandingComponentAdmin.razor.css
deleted file mode 100644
index 6d753f3d..00000000
--- a/Wonky.Client/Components/LandingComponentAdmin.razor.css
+++ /dev/null
@@ -1,6 +0,0 @@
-
-.workDate {
- font-size: 1.2em;
- font-weight: bold;
- font-variant: small-caps;
-}
\ No newline at end of file
diff --git a/Wonky.Client/Components/QuoteListComponent.razor b/Wonky.Client/Components/QuoteListComponent.razor
index 31c3ffc8..ef741305 100644
--- a/Wonky.Client/Components/QuoteListComponent.razor
+++ b/Wonky.Client/Components/QuoteListComponent.razor
@@ -64,7 +64,7 @@
@quote.ESalesNumber
+ href="/customers/@quote.Company.CompanyId/quotes/@quote.ActivityId">@quote.ESalesNumber
@if (!string.IsNullOrWhiteSpace(quote.OfficeNote))
{
diff --git a/Wonky.Client/Components/TaskItemTableComponent.razor b/Wonky.Client/Components/TaskItemTableComponent.razor
index 6ad590c8..43068588 100644
--- a/Wonky.Client/Components/TaskItemTableComponent.razor
+++ b/Wonky.Client/Components/TaskItemTableComponent.razor
@@ -64,7 +64,7 @@
@if (task.TaskTypeEnum is "Recall")
{
-
+
}
diff --git a/Wonky.Client/Components/WarehouseListComponent.razor b/Wonky.Client/Components/WarehouseListComponent.razor
index ecfebb74..552bb7ef 100644
--- a/Wonky.Client/Components/WarehouseListComponent.razor
+++ b/Wonky.Client/Components/WarehouseListComponent.razor
@@ -1,3 +1,4 @@
+@using Wonky.Client.Models
@*
// Copyright (C) 2022 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify
@@ -15,101 +16,86 @@
//
*@
-
-
-
-
-
Ubehandlet
+@if (OrderList != null)
+{
+
+
-
-
- @Header
- @OrderList.Count
- ordrer i listen
-
-
-
- @if (ReadyToShip && OrderList.Any())
- {
- Sæt alle afsendt
- }
-
-
-
-
-
-
-
Ordredato
-
-
-
Kundenavn
-
-
-
Postnr. Bynavn
-
-
-
-
-
-
-
-
Status
+ GetWithStatus(PStatus.Packed)" autocomplete="off"/>
+ Pakket
+
+
+ @Header
+ @Orders.Count
+ ordrer i listen
+
+
+
+ @if (ReadyToShip && Orders.Any())
+ {
+ Sæt alle afsendt
+ }
+
- @if (OrderList.Any())
- {
- @foreach (var order in OrderList)
+
diff --git a/Wonky.Client/Pages/AdvisorCustomerListPage.razor.cs b/Wonky.Client/Pages/AdvisorCustomerListPage.razor.cs
index 233d55a1..96d68f32 100644
--- a/Wonky.Client/Pages/AdvisorCustomerListPage.razor.cs
+++ b/Wonky.Client/Pages/AdvisorCustomerListPage.razor.cs
@@ -60,8 +60,7 @@ namespace Wonky.Client.Pages
Paging.SearchColumn = Prefs.CompanySearch;
Paging.PageSize = Convert.ToInt32(Prefs.PageSize);
Paging.HasFolded = IncludeFolded ? 1 : 0;
- Paging.CountryCode = UserInfo.CountryCode;
-
+
// load saved search
SavedSearch = string.IsNullOrWhiteSpace(Prefs.CompanyFilterPhrase) ? "" : Prefs.CompanyFilterPhrase;
Paging.SearchTerm = SavedSearch;
diff --git a/Wonky.Client/Pages/AdvisorCustomerViewPage.razor b/Wonky.Client/Pages/AdvisorCustomerViewPage.razor
index fb9a987a..bcf63fd6 100644
--- a/Wonky.Client/Pages/AdvisorCustomerViewPage.razor
+++ b/Wonky.Client/Pages/AdvisorCustomerViewPage.razor
@@ -19,7 +19,7 @@
@using Microsoft.AspNetCore.Components
@using Wonky.Client.Components
@attribute [Authorize(Roles = "Advisor")]
-@page "/companies/{CompanyId}"
+@page "/customers/{CompanyId}"
@if (!string.IsNullOrWhiteSpace(Company.Account))
@@ -128,13 +128,13 @@
@* activity buttons *@
diff --git a/Wonky.Client/Pages/AdvisorViewActivityPage.razor b/Wonky.Client/Pages/AdvisorViewActivityPage.razor
index 17b3a784..9fa87e67 100644
--- a/Wonky.Client/Pages/AdvisorViewActivityPage.razor
+++ b/Wonky.Client/Pages/AdvisorViewActivityPage.razor
@@ -19,8 +19,8 @@
@using Wonky.Client.Components
@attribute [Authorize(Roles = "Admin,Advisor,Warehouse")]
-@page "/companies/{CompanyId}/orders/{OrderId}"
-@page "/companies/{CompanyId}/quotes/{OrderId}"
+@page "/customers/{CompanyId}/orders/{OrderId}"
+@page "/customers/{CompanyId}/quotes/{OrderId}"
@* *@
diff --git a/Wonky.Client/Pages/AdvisorWorkplaceDocumentListPage.razor b/Wonky.Client/Pages/AdvisorWorkplaceDocumentListPage.razor
index 37db7090..15f157e5 100644
--- a/Wonky.Client/Pages/AdvisorWorkplaceDocumentListPage.razor
+++ b/Wonky.Client/Pages/AdvisorWorkplaceDocumentListPage.razor
@@ -17,8 +17,8 @@
@using Microsoft.AspNetCore.Authorization
@using Wonky.Client.Components
-@attribute [Authorize(Roles = "Admin,Warehouse,Office")]
-@page "/companies/{CompanyId}/workplaces/{WorkplaceId}/documents"
+@attribute [Authorize(Roles = "Advisor")]
+@page "/customers/{CompanyId}/workplaces/{WorkplaceId}/documents"
Dokumenter
diff --git a/Wonky.Client/Pages/AdvisorWorkplaceListPage.razor b/Wonky.Client/Pages/AdvisorWorkplaceListPage.razor
index c31ee858..e26c8218 100644
--- a/Wonky.Client/Pages/AdvisorWorkplaceListPage.razor
+++ b/Wonky.Client/Pages/AdvisorWorkplaceListPage.razor
@@ -18,7 +18,7 @@
@using Microsoft.AspNetCore.Authorization
@using Wonky.Client.Components
@attribute [Authorize(Roles = "Advisor")]
-@page "/companies/{CompanyId}/workplaces"
+@page "/customers/{CompanyId}/workplaces"
diff --git a/Wonky.Client/Pages/AdvisorWorkplaceViewPage.razor b/Wonky.Client/Pages/AdvisorWorkplaceViewPage.razor
index d95453d3..9c920599 100644
--- a/Wonky.Client/Pages/AdvisorWorkplaceViewPage.razor
+++ b/Wonky.Client/Pages/AdvisorWorkplaceViewPage.razor
@@ -19,7 +19,7 @@
@using Microsoft.AspNetCore.Authorization
@using Wonky.Client.Components
@attribute [Authorize(Roles = "Advisor")]
-@page "/companies/{CompanyId}/workplaces/{WorkplaceId}"
+@page "/customers/{CompanyId}/workplaces/{WorkplaceId}"
diff --git a/Wonky.Client/Pages/AdvisorWorkplaceViewPage.razor.cs b/Wonky.Client/Pages/AdvisorWorkplaceViewPage.razor.cs
index 75962c0b..7f1bac00 100644
--- a/Wonky.Client/Pages/AdvisorWorkplaceViewPage.razor.cs
+++ b/Wonky.Client/Pages/AdvisorWorkplaceViewPage.razor.cs
@@ -62,7 +62,7 @@ public partial class AdvisorWorkplaceViewPage : IDisposable
{
Working = true;
await WorkplaceCrmRepo.DeleteWorkplace(CompanyId, _workplace.WorkplaceId);
- _navigator.NavigateTo($"/companies/{CompanyId}/workplaces");
+ _navigator.NavigateTo($"/customers/{CompanyId}/workplaces");
}
public void Dispose()
diff --git a/Wonky.Client/Pages/CountryCatalogPage.razor b/Wonky.Client/Pages/CountryCatalogPage.razor
index 4ae355d8..31a64d03 100644
--- a/Wonky.Client/Pages/CountryCatalogPage.razor
+++ b/Wonky.Client/Pages/CountryCatalogPage.razor
@@ -18,7 +18,7 @@
@using Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization
@attribute [Authorize(Roles = "Admin,Warehouse")]
-@page "/price-catalog/{CountryCode}"
+@page "/office/catalog/{CountryCode}"
diff --git a/Wonky.Client/Pages/CountryCatalogPage.razor.cs b/Wonky.Client/Pages/CountryCatalogPage.razor.cs
index ccc5a01c..2be19ada 100644
--- a/Wonky.Client/Pages/CountryCatalogPage.razor.cs
+++ b/Wonky.Client/Pages/CountryCatalogPage.razor.cs
@@ -26,7 +26,7 @@ namespace Wonky.Client.Pages;
public partial class CountryCatalogPage : IDisposable
{
[Inject] public ILocalStorageService Storage { get; set; }
- [Inject] public IAdvisorCatalogRepository ItemRepo { get; set; }
+ [Inject] public ICountryCatalogRepository Catalog { get; set; }
[Inject] public HttpInterceptorService Interceptor { get; set; }
[Inject] public UserProfileService ProfileService { get; set; }
@@ -43,14 +43,11 @@ public partial class CountryCatalogPage : IDisposable
{
Prefs = await ProfileService.GetPreferences();
UserInfo = await Storage.GetItemAsync
("_xu");
-
- Paging.CountryCode = UserInfo.CountryCode;
Paging.OrderBy = Prefs.ItemSort;
Paging.SearchColumn = Prefs.ItemSearch;
Paging.PageSize = Convert.ToInt32(Prefs.PageSize);
- Paging.CountryCode = CountryCode.ToLower();
-
+
Interceptor.RegisterEvent();
Interceptor.RegisterBeforeSendEvent();
@@ -106,13 +103,12 @@ public partial class CountryCatalogPage : IDisposable
private async Task FetchSalesItems()
{
Working = true;
- var pagingResponse = await ItemRepo.GetSalesItemsPaged(Paging);
+ var pagingResponse = await Catalog.GetSalesItemsPaged(CountryCode, Paging);
Working = false;
Items = pagingResponse.Items!;
- MetaInfo = pagingResponse.MetaData;
+ MetaInfo = pagingResponse.MetaData!;
}
-
-
+
public void Dispose() => Interceptor.DisposeEvent();
}
\ No newline at end of file
diff --git a/Wonky.Client/Pages/CountryCustomerListPage.razor b/Wonky.Client/Pages/CountryCustomerListPage.razor
index f5a5cd4a..1b0df42b 100644
--- a/Wonky.Client/Pages/CountryCustomerListPage.razor
+++ b/Wonky.Client/Pages/CountryCustomerListPage.razor
@@ -18,9 +18,7 @@
@using Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization
@attribute [Authorize(Roles = "Admin,Warehouse")]
-@page "/office/{countryCode}/customers"
-
-
+@page "/office/customers/{countryCode}"
+
+
@if (Working)
{
diff --git a/Wonky.Client/Pages/CountryCustomerListPage.razor.cs b/Wonky.Client/Pages/CountryCustomerListPage.razor.cs
index bec7d63d..43562e4d 100644
--- a/Wonky.Client/Pages/CountryCustomerListPage.razor.cs
+++ b/Wonky.Client/Pages/CountryCustomerListPage.razor.cs
@@ -33,7 +33,7 @@ namespace Wonky.Client.Pages
[Parameter] public string CountryCode { get; set; } = "";
[Inject] public ILocalStorageService Storage { get; set; }
[Inject] public UserProfileService ProfileService { get; set; }
- [Inject] public ICountryCustomerRepository CompanyRepo { get; set; }
+ [Inject] public ICountryCustomerRepository Customers { get; set; }
[Inject] public HttpInterceptorService Interceptor { get; set; }
[Inject] public NavigationManager Navigator { get; set; }
private List
Companies { get; set; } = new();
@@ -42,13 +42,14 @@ namespace Wonky.Client.Pages
private string SavedSearch { get; set; } = "";
private bool IncludeFolded { get; set; }
private bool Working { get; set; } = true;
- private MetaData PageData { get; set; } = new();
+ private MetaData ResponseMeta { get; set; } = new();
private CustomerPaging Paging { get; set; } = new();
protected override async Task OnParametersSetAsync()
{
Interceptor.RegisterEvent();
Interceptor.RegisterBeforeSendEvent();
+
// set preferences
Prefs = await ProfileService.GetPreferences();
UserInfo = await Storage.GetItemAsync("_xu");
@@ -56,8 +57,7 @@ namespace Wonky.Client.Pages
Paging.SearchColumn = Prefs.CompanySearch;
Paging.PageSize = Convert.ToInt32(Prefs.PageSize);
Paging.HasFolded = IncludeFolded ? 1 : 0;
- Paging.CountryCode = CountryCode.ToLower();
-
+
// load saved search
SavedSearch = string.IsNullOrWhiteSpace(Prefs.CompanyFilterPhrase) ? "" : Prefs.CompanyFilterPhrase;
Paging.SearchTerm = SavedSearch;
@@ -117,18 +117,10 @@ namespace Wonky.Client.Pages
private async Task FetchCustomers()
{
Working = true;
- var pageRes = await CompanyRepo.GetCompaniesPaged(Paging);
+ var pageRes = await Customers.GetCompaniesPaged(CountryCode, Paging);
Working = false;
- if (pageRes.Items.Any())
- {
- Companies = pageRes.Items;
- PageData = pageRes.MetaData;
- }
- else
- {
- Companies = new List();
- PageData = new MetaData();
- }
+ Companies = pageRes.Items;
+ ResponseMeta = pageRes.MetaData;
}
public void Dispose() => Interceptor.DisposeEvent();
diff --git a/Wonky.Client/Pages/CountryCustomerViewPage.razor b/Wonky.Client/Pages/CountryCustomerViewPage.razor
new file mode 100644
index 00000000..e1372503
--- /dev/null
+++ b/Wonky.Client/Pages/CountryCustomerViewPage.razor
@@ -0,0 +1,28 @@
+@*
+// Copyright (C) 2022 FCS Frede's Computer Services.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
+//
+*@
+
+@using Microsoft.AspNetCore.Authorization
+@using Microsoft.AspNetCore.Components
+@using Wonky.Client.Components
+@attribute [Authorize(Roles = "Admin,Warehouse")]
+@page "/office/customers/{CountryCode}/{CompanyId}/view"
+
+
+
+
Data for @CountryCode.ToUpper() Id '@CompanyId' er ikke klar
+
+
diff --git a/Wonky.Client/Pages/KrvItemViewAdminPage.razor.cs b/Wonky.Client/Pages/CountryCustomerViewPage.razor.cs
similarity index 53%
rename from Wonky.Client/Pages/KrvItemViewAdminPage.razor.cs
rename to Wonky.Client/Pages/CountryCustomerViewPage.razor.cs
index 9bcea523..13341fb2 100644
--- a/Wonky.Client/Pages/KrvItemViewAdminPage.razor.cs
+++ b/Wonky.Client/Pages/CountryCustomerViewPage.razor.cs
@@ -13,37 +13,26 @@
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
//
-using System;
-using System.Threading.Tasks;
+using System.Text.Json;
+using System.Text.RegularExpressions;
+using Blazored.LocalStorage;
+using Blazored.Toast.Services;
using Wonky.Client.HttpInterceptors;
-using Wonky.Client.HttpRepository;
using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.Components.Forms;
+using Wonky.Client.Helpers;
using Wonky.Client.HttpInterfaces;
+using Wonky.Client.Models;
+using Wonky.Client.Services;
+using Wonky.Client.Shared;
using Wonky.Entity.DTO;
+using Wonky.Entity.Models;
using Wonky.Entity.Views;
namespace Wonky.Client.Pages;
-public partial class KrvItemViewAdminPage : IDisposable
+public partial class CountryCustomerViewPage
{
- [Parameter] public string SalesItemId { get; set; } = "";
- private SalesItemView _item { get; set; } = new ();
- [Inject] public IAdvisorCatalogRepository _itemRepo { get; set; }
- [Inject] public HttpInterceptorService _interceptor { get; set; }
-
-
- protected override async Task OnInitializedAsync()
- {
- _interceptor.RegisterEvent();
- _interceptor.RegisterBeforeSendEvent();
- _item = await _itemRepo.GetSalesVariantId(SalesItemId);
- }
-
- ///
- /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- ///
- public void Dispose()
- {
- _interceptor!.DisposeEvent();
- }
+ [Parameter] public string CompanyId { get; set; } = "";
+ [Parameter] public string CountryCode { get; set; } = "";
}
\ No newline at end of file
diff --git a/Wonky.Client/Pages/CountryLandingPage.razor b/Wonky.Client/Pages/CountryLandingPage.razor
index 1b15878e..1e06bd51 100644
--- a/Wonky.Client/Pages/CountryLandingPage.razor
+++ b/Wonky.Client/Pages/CountryLandingPage.razor
@@ -17,48 +17,41 @@
@using Microsoft.AspNetCore.Authorization
@attribute [Authorize(Roles = "Admin,Warehouse")]
-@page "/office/{CountryCode}"
+@page "/office/country/{CountryCode}"
-
-
-
-
-
-
- @CountryCode.ToUpper() Sælgere
-
-
- Sælger kundeliste, Rapporter, Stamdata
-
-
Sælgere
-
-
-
-
-
-
-
-
- @CountryCode.ToUpper() Kunder
-
-
- Filtrer og søg kunder
-
-
Kundeliste
-
+
+
+
+
+
+ @CountryCode.ToUpper() Sælgere
+
+
+ Sælger kundeliste, Rapporter, Stamdata
+
+
Sælgere
-
-
-
-
- @CountryCode.ToUpper() Priskatalog
-
-
- Produkter og priser
-
-
Priskatalog
-
-
+
+
+
+
+ @CountryCode.ToUpper() Kunder
+
+
+ Filtrer og søg kunder
+
+
Kundeliste
+
+
+
+
+
+ @CountryCode.ToUpper() Priskatalog
+
+
+ Produkter og priser
+
+
Priskatalog
\ No newline at end of file
diff --git a/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor b/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor
index 7e7abe74..6cca392e 100644
--- a/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor
+++ b/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor
@@ -39,20 +39,20 @@
-
+
@if (Working)
diff --git a/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor.cs b/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor.cs
index 1f0dc396..6b37dbb3 100644
--- a/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor.cs
+++ b/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor.cs
@@ -26,17 +26,15 @@ public partial class CountrySalesRepCustomerListPage : IDisposable
{
[Parameter] public string UserId { get; set; } = "";
[Parameter] public string CountryCode { get; set; } = "dk";
-
- [Inject] public ILogger
Logger { get; set; }
[Inject] public HttpInterceptorService Interceptor { get; set; }
[Inject] public ICountryCustomerRepository CustomerRepo { get; set; }
[Inject] public UserProfileService UserProfileService { get; set; }
- private List _companyList { get; set; } = new();
- private MetaData _metaData { get; set; } = new();
- private CustomerPaging _paging = new();
+ private List CompanyList { get; set; } = new();
+ private MetaData ResponseMeta { get; set; } = new();
+ private CustomerPaging Paging = new();
private UserPref UserPref { get; set; } = new();
- private string _savedSearch { get; set; } = "";
- private bool _includeFolded { get; set; }
+ private string SavedSearch { get; set; } = "";
+ private bool IncludeFolded { get; set; }
private bool Working { get; set; } = true;
protected override async Task OnParametersSetAsync()
@@ -46,15 +44,14 @@ public partial class CountrySalesRepCustomerListPage : IDisposable
// set preferences
UserPref = await UserProfileService.GetPreferences();
- _paging.CountryCode = CountryCode.ToLower();
- _paging.OrderBy = UserPref.CompanySort;
- _paging.SearchColumn = UserPref.CompanySearch;
- _paging.PageSize = Convert.ToInt32(UserPref.PageSize);
- _paging.HasFolded = _includeFolded ? 1 : 0;
+ Paging.OrderBy = UserPref.CompanySort;
+ Paging.SearchColumn = UserPref.CompanySearch;
+ Paging.PageSize = Convert.ToInt32(UserPref.PageSize);
+ Paging.HasFolded = IncludeFolded ? 1 : 0;
// load saved search
- _savedSearch = UserPref.CompanyFilterPhrase;
- _paging.SearchTerm = _savedSearch;
+ SavedSearch = UserPref.CompanyFilterPhrase;
+ Paging.SearchTerm = SavedSearch;
await FetchCompanies();
Working = false;
@@ -62,33 +59,33 @@ public partial class CountrySalesRepCustomerListPage : IDisposable
private async Task OnFoldedClick()
{
- _includeFolded = !_includeFolded;
- _companyList = new List();
- _paging.PageNumber = 1;
- _paging.HasFolded = _includeFolded ? 1 : 0;
+ IncludeFolded = !IncludeFolded;
+ CompanyList = new List();
+ Paging.PageNumber = 1;
+ Paging.HasFolded = IncludeFolded ? 1 : 0;
await FetchCompanies();
}
private async Task SelectedPage(int page)
{
- _companyList = new List();
- _paging.PageNumber = page;
+ CompanyList = new List();
+ Paging.PageNumber = page;
await FetchCompanies();
}
private async Task SetSearchCol(string searchColumn)
{
- _companyList = new List();
- _paging.SearchColumn = searchColumn;
- _paging.PageNumber = 1;
+ CompanyList = new List();
+ Paging.SearchColumn = searchColumn;
+ Paging.PageNumber = 1;
await FetchCompanies();
}
private async Task SetPageSize(string pageSize)
{
- _companyList = new List();
- _paging.PageSize = Convert.ToInt32(pageSize);
- _paging.PageNumber = 1;
+ CompanyList = new List();
+ Paging.PageSize = Convert.ToInt32(pageSize);
+ Paging.PageNumber = 1;
await FetchCompanies();
}
@@ -96,30 +93,30 @@ public partial class CountrySalesRepCustomerListPage : IDisposable
{
// if (!string.IsNullOrWhiteSpace(searchTerm) && searchTerm.Length < 3) return;
- _companyList = new List();
- _paging.PageNumber = 1;
- _paging.SearchTerm = searchTerm;
+ CompanyList = new List();
+ Paging.PageNumber = 1;
+ Paging.SearchTerm = searchTerm;
await FetchCompanies();
if (!string.IsNullOrWhiteSpace(searchTerm) && searchTerm.TrimEnd().Length > 2)
{
- _savedSearch = searchTerm;
+ SavedSearch = searchTerm;
await UserProfileService.SetCompanyFilterPhrase(searchTerm.Trim());
}
}
private async Task SetSortCol(string orderBy)
{
- _companyList = new List();
- _paging.OrderBy = orderBy;
+ CompanyList = new List();
+ Paging.OrderBy = orderBy;
await FetchCompanies();
}
private async Task FetchCompanies()
{
Working = true;
- var pagingResponse = await CustomerRepo.GetCompaniesPagedSalesRep(UserId, _paging);
- _companyList = pagingResponse.Items;
- _metaData = pagingResponse.MetaData;
+ var pagingResponse = await CustomerRepo.GetCompaniesPaged(CountryCode, UserId, Paging);
+ CompanyList = pagingResponse.Items;
+ ResponseMeta = pagingResponse.MetaData;
Working = false;
}
diff --git a/Wonky.Client/Pages/KrvItemViewAdminPage.razor b/Wonky.Client/Pages/KrvItemViewAdminPage.razor
deleted file mode 100644
index 9603d279..00000000
--- a/Wonky.Client/Pages/KrvItemViewAdminPage.razor
+++ /dev/null
@@ -1,68 +0,0 @@
-@*
-// Copyright (C) 2022 FCS Frede's Computer Services.
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Affero General Public License as
-// published by the Free Software Foundation, either version 3 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Affero General Public License for more details.
-//
-// You should have received a copy of the GNU Affero General Public License
-// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
-//
-*@
-
-@page "/sales-item/{salesItemId}"
-@using Microsoft.AspNetCore.Authorization
-@attribute [Authorize(Roles = "Advisor,Admin")]
-
-
-
-
-
-
-
-
- Navn
- @_item.Name
-
-
- Varenr
- @_item.Sku
-
-
-
- @_item.ProductGroup
-
-
- Kort Navn
- @_item.ShortName
-
-
-
-
-
-
- Priser
-
-
-
- @foreach (var rate in _item.Rates)
- {
-
- @rate.Quantity
- @rate.Rate
-
- }
-
-
-
-
-
\ No newline at end of file
diff --git a/Wonky.Client/Pages/KrvItemViewAdminPage.razor.css b/Wonky.Client/Pages/KrvItemViewAdminPage.razor.css
deleted file mode 100644
index 50839936..00000000
--- a/Wonky.Client/Pages/KrvItemViewAdminPage.razor.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* item image preview */
-.image-name {
- margin-left: 10px;
-}
-.image-preview {
- width: auto;
- max-width: 200px;
- height: 100px;
- margin-top: 15px;
-}
\ No newline at end of file
diff --git a/Wonky.Client/Pages/SsystemPrintCatalogPage.razor b/Wonky.Client/Pages/PrintCatalogPage.razor
similarity index 93%
rename from Wonky.Client/Pages/SsystemPrintCatalogPage.razor
rename to Wonky.Client/Pages/PrintCatalogPage.razor
index 90b3cc8b..5236afb3 100644
--- a/Wonky.Client/Pages/SsystemPrintCatalogPage.razor
+++ b/Wonky.Client/Pages/PrintCatalogPage.razor
@@ -17,7 +17,7 @@
@using Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization
-@attribute [Authorize(Roles = "Admin,Advisor,Office,Warehouse")]
+@attribute [Authorize(Roles = "Admin,Advisor,Warehouse")]
@page "/print/catalog"
diff --git a/Wonky.Client/Pages/SsystemPrintCatalogPage.razor.cs b/Wonky.Client/Pages/PrintCatalogPage.razor.cs
similarity index 97%
rename from Wonky.Client/Pages/SsystemPrintCatalogPage.razor.cs
rename to Wonky.Client/Pages/PrintCatalogPage.razor.cs
index 0207d8d5..7b054de0 100644
--- a/Wonky.Client/Pages/SsystemPrintCatalogPage.razor.cs
+++ b/Wonky.Client/Pages/PrintCatalogPage.razor.cs
@@ -29,7 +29,7 @@ using Wonky.Entity.Views;
namespace Wonky.Client.Pages;
-public partial class SsystemPrintCatalogPage : IDisposable
+public partial class PrintCatalogPage : IDisposable
{
[Inject] public ILocalStorageService Storage { get; set; }
[Inject] public IAdvisorCatalogRepository ItemRepo { get; set; }
diff --git a/Wonky.Client/Pages/SystemPrintFrontPage.razor b/Wonky.Client/Pages/PrintFrontPage.razor
similarity index 97%
rename from Wonky.Client/Pages/SystemPrintFrontPage.razor
rename to Wonky.Client/Pages/PrintFrontPage.razor
index 3cd029d0..7d2a0ebc 100644
--- a/Wonky.Client/Pages/SystemPrintFrontPage.razor
+++ b/Wonky.Client/Pages/PrintFrontPage.razor
@@ -17,7 +17,7 @@
@using Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization
-@attribute [Authorize(Roles = "Admin,Advisor,Office")]
+@attribute [Authorize(Roles = "Admin,Advisor")]
@page "/print/report/{CountryCode}/{UserId}/{ReportDate}"
diff --git a/Wonky.Client/Pages/SystemPrintFrontPage.razor.cs b/Wonky.Client/Pages/PrintFrontPage.razor.cs
similarity index 95%
rename from Wonky.Client/Pages/SystemPrintFrontPage.razor.cs
rename to Wonky.Client/Pages/PrintFrontPage.razor.cs
index c98974e9..11ccbd1a 100644
--- a/Wonky.Client/Pages/SystemPrintFrontPage.razor.cs
+++ b/Wonky.Client/Pages/PrintFrontPage.razor.cs
@@ -22,7 +22,7 @@ using Wonky.Entity.Views;
namespace Wonky.Client.Pages;
-public partial class SystemPrintFrontPage
+public partial class PrintFrontPage
{
[Parameter] public string CountryCode { get; set; } = "";
[Parameter] public string UserId { get; set; } = "";
@@ -30,7 +30,7 @@ public partial class SystemPrintFrontPage
[Inject] public ILocalStorageService Storage { get; set; }
[Inject] public NavigationManager Navigator { get; set; }
[Inject] private IJSRuntime JSRuntime { get; set; }
- [Inject] public ILogger
Logger { get; set; }
+ [Inject] public ILogger Logger { get; set; }
private ReportView Report { get; set; } = new();
private IJSObjectReference JsModule { get; set; }
private string ReturnUrl { get; set; } = "";
diff --git a/Wonky.Client/Pages/SystemPrintOrderPage.razor b/Wonky.Client/Pages/PrintOrderPage.razor
similarity index 96%
rename from Wonky.Client/Pages/SystemPrintOrderPage.razor
rename to Wonky.Client/Pages/PrintOrderPage.razor
index f2a89c5b..f2371a6f 100644
--- a/Wonky.Client/Pages/SystemPrintOrderPage.razor
+++ b/Wonky.Client/Pages/PrintOrderPage.razor
@@ -17,7 +17,7 @@
@using Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization
-@attribute [Authorize(Roles = "Admin,Advisor,Office")]
+@attribute [Authorize(Roles = "Admin,Advisor")]
@page "/print/orders/{CountryCode}/{UserId}/{ReportDate}"
diff --git a/Wonky.Client/Pages/SystemPrintOrderPage.razor.cs b/Wonky.Client/Pages/PrintOrderPage.razor.cs
similarity index 95%
rename from Wonky.Client/Pages/SystemPrintOrderPage.razor.cs
rename to Wonky.Client/Pages/PrintOrderPage.razor.cs
index d45bcff7..f42ceb12 100644
--- a/Wonky.Client/Pages/SystemPrintOrderPage.razor.cs
+++ b/Wonky.Client/Pages/PrintOrderPage.razor.cs
@@ -21,7 +21,7 @@ using Wonky.Entity.Views;
namespace Wonky.Client.Pages;
-public partial class SystemPrintOrderPage
+public partial class PrintOrderPage
{
[Parameter] public string CountryCode { get; set; } = "";
[Parameter] public string UserId { get; set; } = "";
@@ -29,7 +29,7 @@ public partial class SystemPrintOrderPage
[Inject] public ILocalStorageService Storage { get; set; }
[Inject] public NavigationManager Navigator { get; set; }
[Inject] private IJSRuntime JSRuntime { get; set; }
- [Inject] public ILogger
Logger { get; set; }
+ [Inject] public ILogger Logger { get; set; }
private ReportView Report { get; set; } = new();
private List Items { get; set; } = new();
private IJSObjectReference JsModule { get; set; }
diff --git a/Wonky.Client/Pages/WarehouseOrderListPage.razor b/Wonky.Client/Pages/WarehouseOrderListPage.razor
index 67c52ae1..8a2b7315 100644
--- a/Wonky.Client/Pages/WarehouseOrderListPage.razor
+++ b/Wonky.Client/Pages/WarehouseOrderListPage.razor
@@ -17,7 +17,20 @@
@using Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization
-@attribute [Authorize(Roles = "Admin,Warehouse,Office")]
+@attribute [Authorize(Roles = "Admin,Warehouse")]
@page "/warehouse/orders/{Status}"
-
+
+
\ No newline at end of file
diff --git a/Wonky.Client/Pages/WarehouseOrderListPage.razor.cs b/Wonky.Client/Pages/WarehouseOrderListPage.razor.cs
index 932c265c..5e40b2f6 100644
--- a/Wonky.Client/Pages/WarehouseOrderListPage.razor.cs
+++ b/Wonky.Client/Pages/WarehouseOrderListPage.razor.cs
@@ -1,8 +1,108 @@
using Microsoft.AspNetCore.Components;
+using Wonky.Client.Helpers;
+using Wonky.Client.HttpInterceptors;
+using Wonky.Client.HttpInterfaces;
+using Wonky.Client.Models;
+using Wonky.Entity.Views;
namespace Wonky.Client.Pages;
-public partial class WarehouseOrderListPage
+public partial class WarehouseOrderListPage : IDisposable
{
- [Parameter] public string Status { get; set; } = "none";
+ [Parameter] public string Status { get; set; } = "none";
+
+ [Inject] public HttpInterceptorService Interceptor { get; set; }
+ [Inject] public IWarehouseRepository WarehouseRepo { get; set; }
+ [Inject] public NavigationManager Navigator { get; set; }
+ private List OrderList { get; set; }
+ private bool Working { get; set; } = true;
+ private string Header { get; set; } = "Ubehandlet";
+ private bool ReadyToShip { get; set; }
+ protected override async Task OnParametersSetAsync()
+ {
+ Interceptor.RegisterEvent();
+ Interceptor.RegisterBeforeSendEvent();
+ OrderList = await FetchOrders(Status);
+ }
+
+ private async Task GetStatusCallback(PStatus status)
+ {
+ Working = true;
+ OrderList = new List();
+ switch (status)
+ {
+ case PStatus.None:
+ Header = "Ubehandlede ordrer";
+ ReadyToShip = false;
+ break;
+ case PStatus.Picked:
+ Header = "Plukkede ordrer";
+ ReadyToShip = false;
+ break;
+ case PStatus.Packed:
+ Header = "Pakkede ordrer";
+ ReadyToShip = true;
+ break;
+ case PStatus.Shipped:
+ break;
+ case PStatus.All:
+ break;
+ case PStatus.Express:
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(status), status, null);
+ }
+ Status = Utils.EnumToString(status).ToLower();
+ OrderList = await FetchOrders(Status);
+ Working = false;
+ }
+
+ ///
+ /// QPak - quick mark an order as shipped
+ ///
+ ///
+ private async Task QPakCallback(string orderId)
+ {
+ Working = true;
+ var order = OrderList.First(x => x.OrderId == orderId);
+ order.ProcessStatusEnum = "packed";
+ var process = new WarehouseProcess
+ {
+ OrderId = order.OrderId,
+ ProcessStatusEnum = "packed"
+ };
+ await WarehouseRepo.UpdateWarehouseOrderStatus(process);
+ OrderList.Remove(order);
+ Working = false;
+ }
+ ///
+ /// Set status shipped where status is packed
+ ///
+ private async Task SetShippedCallback()
+ {
+ Working = true;
+ foreach (var order in OrderList.Where(order => order.ProcessStatusEnum.ToLower() == "packed"))
+ {
+ order.ProcessStatusEnum = "shipped";
+ var process = new WarehouseProcess
+ {
+ OrderId = order.OrderId,
+ ProcessStatusEnum = "shipped"
+ };
+ await WarehouseRepo.UpdateWarehouseOrderStatus(process);
+ }
+ Working = false;
+ }
+
+ private async Task> FetchOrders(string status)
+ {
+ Working = true;
+ var orderList = await WarehouseRepo.GetWarehouseOrderListByStatus(status.ToLower());
+ if(orderList.Any(x => x.Express))
+ orderList = orderList.OrderByDescending(x => x.Express).ToList();
+ Working = false;
+ return orderList;
+ }
+
+ public void Dispose() => Interceptor.DisposeEvent();
}
\ No newline at end of file
diff --git a/Wonky.Client/Pages/WarehouseOrderViewPage.razor b/Wonky.Client/Pages/WarehouseOrderViewPage.razor
index 135c3642..3d8f45e3 100644
--- a/Wonky.Client/Pages/WarehouseOrderViewPage.razor
+++ b/Wonky.Client/Pages/WarehouseOrderViewPage.razor
@@ -17,53 +17,53 @@
@using Microsoft.AspNetCore.Authorization
@using Wonky.Client.Components
-@attribute [Authorize(Roles = "Admin,Warehouse,Office")]
+@attribute [Authorize(Roles = "Admin,Warehouse")]
@page "/warehouse/orders/process/{OrderId}"
-@if (!string.IsNullOrWhiteSpace(_order.OrderDate))
+@if (!string.IsNullOrWhiteSpace(Order.OrderDate))
{
- @if (_order.Express)
+ @if (Order.Express)
{
HASTE ORDRE
}
- @_order.Company.Name
+ @Order.Company.Name
Konto
- @_order.Company.Account
+ @Order.Company.Account
Telefon
- @_order.Company.Phone
+ @Order.Company.Phone
Kunde
- @_order.Company.Name
+ @Order.Company.Name
Lev.Navn
- @_order.DlvName
+ @Order.DlvName
Adresse
- @_order.Company.Address1
+ @Order.Company.Address1
Lev.Adresse
- @_order.DlvAddress1
+ @Order.DlvAddress1
Adresse
- @_order.Company.Address2
+ @Order.Company.Address2
Lev.Adresse
- @_order.DlvAddress2
+ @Order.DlvAddress2
Postnr By
- @_order.Company.ZipCode @_order.Company.City
+ @Order.Company.ZipCode @Order.Company.City
Lev.Postnr By
- @_order.DlvZipCity
+ @Order.DlvZipCity
@@ -77,7 +77,7 @@
- @foreach (var line in _order.Lines)
+ @foreach (var line in Order.Lines)
{
@line.Location
@@ -93,10 +93,10 @@
}
- @if (!string.IsNullOrWhiteSpace(_order.OfficeNote))
+ @if (!string.IsNullOrWhiteSpace(Order.OfficeNote))
{
-
@_order.OfficeNote
+ @Order.OfficeNote
}
@@ -106,15 +106,15 @@
- @if (_order.ProcessStatusEnum.ToLower() == "none")
+ @if (Order.ProcessStatusEnum.ToLower() == "none")
{
Sæt status plukket
}
- @if (_order.ProcessStatusEnum.ToLower() == "picked")
+ @if (Order.ProcessStatusEnum.ToLower() == "picked")
{
Sæt status pakket
}
- @if (_order.ProcessStatusEnum.ToLower() == "packed")
+ @if (Order.ProcessStatusEnum.ToLower() == "packed")
{
Sæt status afsendt
}
diff --git a/Wonky.Client/Pages/WarehouseOrderViewPage.razor.cs b/Wonky.Client/Pages/WarehouseOrderViewPage.razor.cs
index 6f6d811f..8242936b 100644
--- a/Wonky.Client/Pages/WarehouseOrderViewPage.razor.cs
+++ b/Wonky.Client/Pages/WarehouseOrderViewPage.razor.cs
@@ -28,63 +28,71 @@ namespace Wonky.Client.Pages;
public partial class WarehouseOrderViewPage : IDisposable
{
[Parameter] public string OrderId { get; set; } = "";
- [Inject] public HttpInterceptorService _interceptor { get; set; }
- [Inject] public IWarehouseRepository _warehouseRepo { get; set; }
- [Inject] public NavigationManager _navigator { get; set; }
- [Inject] public IToastService _toast { get; set; }
- [Inject] public ILogger
_logger { get; set; }
+ [Inject] public HttpInterceptorService Interceptor { get; set; }
+ [Inject] public IWarehouseRepository WarehouseRepo { get; set; }
+ [Inject] public NavigationManager Navigator { get; set; }
+ [Inject] public IToastService Toast { get; set; }
+ [Inject] public ILogger Logger { get; set; }
- private WarehouseOrderView _order { get; set; } = new();
- private bool Working { get; set; }
+ private WarehouseOrderView Order { get; set; } = new();
+ private bool Working { get; set; } = true;
protected override async Task OnParametersSetAsync()
{
- _interceptor.RegisterEvent();
- _interceptor.RegisterBeforeSendEvent();
+ Interceptor.RegisterEvent();
+ Interceptor.RegisterBeforeSendEvent();
if (!string.IsNullOrWhiteSpace(OrderId))
- _order = await _warehouseRepo.GetWarehouseOrder(OrderId);
+ Order = await WarehouseRepo.GetWarehouseOrder(OrderId);
- _logger.LogDebug("Warehouse OrderView =>\n{}", JsonSerializer.Serialize(_order));
+ Logger.LogDebug("Warehouse OrderView =>\n{}", JsonSerializer.Serialize(Order));
+ Working = false;
}
private async Task SetProcessStatusPicked()
{
+ if (Working)
+ return;
+
Working = true;
var process = new WarehouseProcess
{
- OrderId = _order.OrderId,
+ OrderId = Order.OrderId,
ProcessStatusEnum = "picked"
};
- await _warehouseRepo.UpdateWarehouseOrderStatus(process);
- _navigator.NavigateTo("/warehouse/orders/none");
+ await WarehouseRepo.UpdateWarehouseOrderStatus(process);
+ Navigator.NavigateTo("/warehouse/orders/none");
}
private async Task SetProcessStatusPacked()
{
+ if (Working)
+ return;
Working = true;
var process = new WarehouseProcess
{
- OrderId = _order.OrderId,
+ OrderId = Order.OrderId,
ProcessStatusEnum = "packed"
};
- await _warehouseRepo.UpdateWarehouseOrderStatus(process);
- _navigator.NavigateTo("/warehouse/orders/picked");
+ await WarehouseRepo.UpdateWarehouseOrderStatus(process);
+ Navigator.NavigateTo("/warehouse/orders/picked");
}
private async Task SetProcessStatusShipped()
{
+ if (Working)
+ return;
Working = true;
var process = new WarehouseProcess
{
- OrderId = _order.OrderId,
+ OrderId = Order.OrderId,
ProcessStatusEnum = "shipped"
};
- await _warehouseRepo.UpdateWarehouseOrderStatus(process);
- _navigator.NavigateTo("/warehouse/orders/none");
+ await WarehouseRepo.UpdateWarehouseOrderStatus(process);
+ Navigator.NavigateTo("/warehouse/orders/none");
}
public void Dispose()
{
- _interceptor.DisposeEvent();
+ Interceptor.DisposeEvent();
}
}
\ No newline at end of file
diff --git a/Wonky.Client/Shared/InformationModal.razor.cs b/Wonky.Client/Shared/InformationModal.razor.cs
index f17ba663..6b771658 100644
--- a/Wonky.Client/Shared/InformationModal.razor.cs
+++ b/Wonky.Client/Shared/InformationModal.razor.cs
@@ -31,6 +31,7 @@ public partial class InformationModal
StateHasChanged();
}
+ // ReSharper disable once MemberCanBePrivate.Global
public void Hide()
{
_modalDisplay = "none;";
diff --git a/Wonky.Client/Shared/InventoryReorderModal.razor.cs b/Wonky.Client/Shared/InventoryReorderModal.razor.cs
index 2172a50c..6980fea6 100644
--- a/Wonky.Client/Shared/InventoryReorderModal.razor.cs
+++ b/Wonky.Client/Shared/InventoryReorderModal.razor.cs
@@ -29,7 +29,7 @@ public partial class InventoryReorderModal
{
[Parameter] public string CompanyId { get; set; } = "";
[Parameter] public SalesItemView SalesItem { get; set; } = new();
- [Inject] public ICustomerHistoryRepository CustomerHistoryCrmRepo { get; set; }
+ [Inject] public ICustomerHistoryRepository HistoryRepo { get; set; }
[Parameter] public EventCallback OnSelected { get; set; }
private List? History { get; set; } = new();
private DraftItem SelectedItem { get; set; } = new();
@@ -43,7 +43,7 @@ public partial class InventoryReorderModal
if (string.IsNullOrWhiteSpace(SalesItem.Sku))
return;
- History = await CustomerHistoryCrmRepo.FetchHistory(CompanyId, SalesItem.Sku);
+ History = await HistoryRepo.FetchHistory(CompanyId, SalesItem.Sku);
if (!History.Any())
await Task.Delay(1000);
SelectedItem.Item = SalesItem;
diff --git a/Wonky.Client/Shared/NavMenu.razor b/Wonky.Client/Shared/NavMenu.razor
index eebb17e4..d25a5066 100644
--- a/Wonky.Client/Shared/NavMenu.razor
+++ b/Wonky.Client/Shared/NavMenu.razor
@@ -44,19 +44,19 @@
-
+
-
+
Danmark
-
+
Norge
-
+
Sverige
@@ -75,7 +75,7 @@
-
+
Firmaer
diff --git a/Wonky.Client/Shared/PriceListModal.razor b/Wonky.Client/Shared/PriceListModal.razor
index a39bd430..768c3027 100644
--- a/Wonky.Client/Shared/PriceListModal.razor
+++ b/Wonky.Client/Shared/PriceListModal.razor
@@ -41,7 +41,7 @@
@@ -53,10 +53,10 @@
- @if (_items.Any())
+ @if (Items.Any())
{
- @foreach (var item in _items)
+ @foreach (var item in Items)
{
diff --git a/Wonky.Client/Shared/PriceListModal.razor.cs b/Wonky.Client/Shared/PriceListModal.razor.cs
index 2acb843a..9513817d 100644
--- a/Wonky.Client/Shared/PriceListModal.razor.cs
+++ b/Wonky.Client/Shared/PriceListModal.razor.cs
@@ -28,21 +28,20 @@ public partial class PriceListModal : IDisposable
{
[Parameter] public string CountryCode { get; set; } = "dk";
[Parameter] public EventCallback
OnSelected { get; set; }
- [Inject] public IAdvisorCatalogRepository ItemRepo { get; set; }
+ [Inject] public IAdvisorCatalogRepository Catalog { get; set; }
[Inject] public HttpInterceptorService Interceptor { get; set; }
- [Inject] public UserProfileService UserProfileService { get; set; }
+ [Inject] public UserProfileService ProfileService { get; set; }
private string _modalDisplay = "";
private bool _showBackdrop;
- private List _items { get; set; } = new();
- private MetaData? _metaData { get; set; } = new();
+ private List Items { get; set; } = new();
+ private MetaData? ResponseMeta { get; set; } = new();
private CatalogPaging _paging = new();
private UserPref _userPref = new();
protected override async Task OnInitializedAsync()
{
- _userPref = await UserProfileService.GetPreferences();
- _paging.CountryCode = CountryCode;
+ _userPref = await ProfileService.GetPreferences();
_paging.OrderBy = _userPref.ItemSort;
_paging.SearchColumn = _userPref.ItemSearch;
_paging.PageSize = Convert.ToInt32(_userPref.PageSize);
@@ -59,13 +58,13 @@ public partial class PriceListModal : IDisposable
private async Task SelectedPage(int page)
{
- _items = new List();
+ Items = new List();
_paging.PageNumber = page;
await GetSalesItems();
}
private async Task SetSearchPhrase(string searchTerm)
{
- _items = new List();
+ Items = new List();
_paging.PageNumber = 1;
_paging.SearchTerm = searchTerm;
await GetSalesItems();
@@ -73,14 +72,14 @@ public partial class PriceListModal : IDisposable
private async Task GetSalesItems()
{
- var pagingResponse = await ItemRepo.GetSalesItemsPaged(_paging);
- _items = pagingResponse.Items!;
- _metaData = pagingResponse.MetaData;
+ var pagingResponse = await Catalog.GetSalesItemsPaged(_paging);
+ Items = pagingResponse.Items!;
+ ResponseMeta = pagingResponse.MetaData;
}
private async Task SetPageSize(string pageSize)
{
- _items = new List();
+ Items = new List();
_paging.PageSize = Convert.ToInt32(pageSize);
_paging.PageNumber = 1;
await GetSalesItems();
@@ -88,7 +87,7 @@ public partial class PriceListModal : IDisposable
private async Task SetSearchCol(string columnName)
{
- _items = new List();
+ Items = new List();
_paging.PageNumber = 1;
_paging.SearchColumn = columnName;
await GetSalesItems();
@@ -96,7 +95,7 @@ public partial class PriceListModal : IDisposable
private async Task SetSortCol(string orderBy)
{
- _items = new List();
+ Items = new List();
_paging.OrderBy = orderBy;
await GetSalesItems();
}
diff --git a/Wonky.Client/Shared/ProductHistoryModal.razor.cs b/Wonky.Client/Shared/ProductHistoryModal.razor.cs
index 8574a82a..1daa2872 100644
--- a/Wonky.Client/Shared/ProductHistoryModal.razor.cs
+++ b/Wonky.Client/Shared/ProductHistoryModal.razor.cs
@@ -29,7 +29,7 @@ public partial class ProductHistoryModal
// [Parameter] public EventCallback OnSelected { get; set; }
[Parameter] public string CompanyId { get; set; } = "";
[Parameter] public string ItemSku { get; set; } = "";
- [Inject] public ICustomerHistoryRepository CustomerHistoryCrmRepo { get; set; }
+ [Inject] public ICustomerHistoryRepository HistoryRepo { get; set; }
private List? History { get; set; }
private string ProductName { get; set; } = "";
private string _modalDisplay = "";
@@ -37,7 +37,7 @@ public partial class ProductHistoryModal
protected override async Task OnParametersSetAsync()
{
- History = await CustomerHistoryCrmRepo.FetchHistory(CompanyId, ItemSku);
+ History = await HistoryRepo.FetchHistory(CompanyId, ItemSku);
if (History.Any())
{
ProductName = History[0].Description;
diff --git a/Wonky.Client/Shared/ProductPriceHistoryModal.razor.cs b/Wonky.Client/Shared/ProductPriceHistoryModal.razor.cs
index de314f02..d8afefe0 100644
--- a/Wonky.Client/Shared/ProductPriceHistoryModal.razor.cs
+++ b/Wonky.Client/Shared/ProductPriceHistoryModal.razor.cs
@@ -29,7 +29,7 @@ public partial class ProductPriceHistoryModal
[Parameter] public EventCallback OnSelected { get; set; }
[Parameter] public string CompanyId { get; set; } = "";
[Parameter] public string Sku { get; set; } = "";
- [Inject] public ICustomerHistoryRepository CustomerHistoryCrmRepo { get; set; }
+ [Inject] public ICustomerHistoryRepository HistoryRepo { get; set; }
private List? History { get; set; }
private string ProductName { get; set; } = "";
private string _modalDisplay = "";
@@ -40,7 +40,7 @@ public partial class ProductPriceHistoryModal
if (string.IsNullOrWhiteSpace(Sku))
return;
- History = await CustomerHistoryCrmRepo.FetchHistory(CompanyId, Sku);
+ History = await HistoryRepo.FetchHistory(CompanyId, Sku);
if (History.Any())
{
ProductName = History[0].Description;
diff --git a/Wonky.Client/wwwroot/css/app.css b/Wonky.Client/wwwroot/css/app.css
index 2cb2a5d5..11012adf 100644
--- a/Wonky.Client/wwwroot/css/app.css
+++ b/Wonky.Client/wwwroot/css/app.css
@@ -6,8 +6,12 @@ body {
.draft-expires-msg {
font-size: 0.8em;
}
-.spinner {
- height: 48px;
+.busy-signal {
+ float: right;
+ z-index: 100;
+ position: relative;
+ top: 1px;
+ right: 10px;
}
.workDate {
font-variant: small-caps;
diff --git a/Wonky.Entity/Requests/CatalogPaging.cs b/Wonky.Entity/Requests/CatalogPaging.cs
index 8ab6ea2a..fd7ecb96 100644
--- a/Wonky.Entity/Requests/CatalogPaging.cs
+++ b/Wonky.Entity/Requests/CatalogPaging.cs
@@ -60,9 +60,4 @@ public class CatalogPaging
/// Set product group filter
///
public string SelectGroup { get; set; } = "";
-
- ///
- /// Country code
- ///
- public string CountryCode { get; set; } = "dk";
}
\ No newline at end of file
diff --git a/Wonky.Entity/Requests/CustomerPaging.cs b/Wonky.Entity/Requests/CustomerPaging.cs
index cdb7391b..7ca546dc 100644
--- a/Wonky.Entity/Requests/CustomerPaging.cs
+++ b/Wonky.Entity/Requests/CustomerPaging.cs
@@ -71,6 +71,4 @@ public class CustomerPaging
///
public int HasFolded { get; set; }
- public string CountryCode { get; set; } = "dk";
-
}
\ No newline at end of file