-
-
+@if (!IsLoading)
+{
+
+
+
+
+
+
+
@Title
+
@(m_calculator.FormatMoneyWithCurrency(Value))
+
@(Percentage.ToString("0.00")) %
-
@Title
-
@(m_calculator.FormatMoneyWithCurrency(Value))
-
@(Percentage.ToString("0.00")) %
-
\ No newline at end of file
+}
+else
+{
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/Client/Pages/Dashboard/Elements/AnalyticsItemSmall.razor.cs b/Client/Pages/Dashboard/Elements/AnalyticsItemSmall.razor.cs
index 1e6651c..924fe75 100644
--- a/Client/Pages/Dashboard/Elements/AnalyticsItemSmall.razor.cs
+++ b/Client/Pages/Dashboard/Elements/AnalyticsItemSmall.razor.cs
@@ -7,10 +7,12 @@ namespace Biskilog_Accounting.Client.Pages.Dashboard.Elements
[Parameter]
public string Icon { get; set; } = string.Empty;
[Parameter]
- public string Title { get; set; }= string.Empty;
+ public string Title { get; set; } = string.Empty;
[Parameter]
- public double Value{ get; set; }
+ public double Value { get; set; }
[Parameter]
- public double Percentage { get;set; }
+ public double Percentage { get; set; }
+ [Parameter]
+ public bool IsLoading { get; set; } = true;
}
}
diff --git a/Client/Pages/Dashboard/Elements/ChartElement.razor b/Client/Pages/Dashboard/Elements/ChartElement.razor
index 8f94414..a6abdea 100644
--- a/Client/Pages/Dashboard/Elements/ChartElement.razor
+++ b/Client/Pages/Dashboard/Elements/ChartElement.razor
@@ -1,10 +1,11 @@
@using Biskilog_Accounting.Shared.CustomModels;
@using Biskilog_Accounting.Shared.Interfaces;
+@using Microsoft.Fast.Components.FluentUI
@inject ICalculator m_calculator
@if (!IsLoading)
{
-
+
-}else{
-
+}
+else
+{
+
+
+
+
+
+
+
}
\ No newline at end of file
diff --git a/Client/Pages/Dashboard/Elements/LowStockItems.razor b/Client/Pages/Dashboard/Elements/LowStockItems.razor
index 4124868..0ef7238 100644
--- a/Client/Pages/Dashboard/Elements/LowStockItems.razor
+++ b/Client/Pages/Dashboard/Elements/LowStockItems.razor
@@ -1,7 +1,9 @@
@using Biskilog_Accounting.Shared.CustomModels;
@using Biskilog_Accounting.Shared.Interfaces;
+@using Microsoft.Fast.Components.FluentUI
@inject ICalculator m_calculator
+@if(!IsLoading){
+}else{
+
+
+
+
+
+
+
+}
+
\ No newline at end of file
diff --git a/Client/Pages/Dashboard/Elements/LowStockItems.razor.cs b/Client/Pages/Dashboard/Elements/LowStockItems.razor.cs
index e0734d4..3348bfd 100644
--- a/Client/Pages/Dashboard/Elements/LowStockItems.razor.cs
+++ b/Client/Pages/Dashboard/Elements/LowStockItems.razor.cs
@@ -6,6 +6,8 @@ namespace Biskilog_Accounting.Client.Pages.Dashboard.Elements
public partial class LowStockItems
{
[Parameter]
- public IEnumerable
LowStockProducts { get;set; } = new List();
+ public IEnumerable LowStockProducts { get; set; } = new List();
+ [Parameter]
+ public bool IsLoading { get; set; } = true;
}
}
diff --git a/Client/Pages/Dashboard/Elements/MostPurchasedElement.razor b/Client/Pages/Dashboard/Elements/MostPurchasedElement.razor
index 56f4a08..6e1a325 100644
--- a/Client/Pages/Dashboard/Elements/MostPurchasedElement.razor
+++ b/Client/Pages/Dashboard/Elements/MostPurchasedElement.razor
@@ -1,5 +1,6 @@
@using Biskilog_Accounting.Shared.CustomModels;
@using Biskilog_Accounting.Shared.Interfaces;
+@using Microsoft.Fast.Components.FluentUI
@inject ICalculator m_calculator
@if (!IsLoading)
@@ -34,10 +35,21 @@
}
else
{
-
+
+
+
+
+
+
+
}
diff --git a/Client/Pages/Dashboard/Elements/ProductPriceHistory.razor b/Client/Pages/Dashboard/Elements/ProductPriceHistory.razor
index eb03db0..7adccb3 100644
--- a/Client/Pages/Dashboard/Elements/ProductPriceHistory.razor
+++ b/Client/Pages/Dashboard/Elements/ProductPriceHistory.razor
@@ -1,5 +1,6 @@
@using Biskilog_Accounting.Shared.CustomModels;
@using Biskilog_Accounting.Shared.Interfaces;
+@using Microsoft.Fast.Components.FluentUI
@inject ICalculator m_calculator
@if (!IsLoading)
{
@@ -14,5 +15,20 @@
}
else
{
+
+
+
+
+
+
+
}
\ No newline at end of file
diff --git a/Client/Pages/Dashboard/Elements/ProductPriceHistory.razor.cs b/Client/Pages/Dashboard/Elements/ProductPriceHistory.razor.cs
index 7a83d41..eb36634 100644
--- a/Client/Pages/Dashboard/Elements/ProductPriceHistory.razor.cs
+++ b/Client/Pages/Dashboard/Elements/ProductPriceHistory.razor.cs
@@ -16,12 +16,12 @@ namespace Biskilog_Accounting.Client.Pages.Dashboard.Elements
private bool m_increase { get; set; } = false;
private double m_currentPrice { get; set; } = 0;
private ApexChartOptions options = new ApexChartOptions();
- private string m_productName { get; set; }= string.Empty;
- private string m_subtitle { get;set; } = string.Empty;
- private string m_title { get;set; } = string.Empty;
+ private string m_productName { get; set; } = string.Empty;
+ private string m_subtitle { get; set; } = string.Empty;
+ private string m_title { get; set; } = string.Empty;
protected override void OnInitialized()
{
-
+
base.OnInitialized();
}
protected override void OnParametersSet()
@@ -52,11 +52,10 @@ namespace Biskilog_Accounting.Client.Pages.Dashboard.Elements
}
}
};
-
Random random = new Random();
int randomNumber = random.Next(ProductHistory.Count);
m_currentProduct = ProductHistory[randomNumber].Pcode;
- m_productHistory = ProductHistory.Where(t => t.Pcode == m_currentProduct).ToList();
+ m_productHistory = ValidateList(ProductHistory.Where(t => t.Pcode == m_currentProduct).ToList());
if (m_productHistory.Count > 0)
{
@@ -71,5 +70,23 @@ namespace Biskilog_Accounting.Client.Pages.Dashboard.Elements
}
base.OnParametersSet();
}
+ ///
+ /// Validates list to remove duplicate dates
+ ///
+ ///
+ ///
+ private List ValidateList(List a_list)
+ {
+ List validated = new List();
+
+ foreach (ProductPriceChange change in a_list)
+ {
+ if (!validated.Select(d => d.ChangeDate).Contains(change.ChangeDate))
+ {
+ validated.Add(change);
+ }
+ }
+ return validated;
+ }
}
}
diff --git a/Client/Pages/Dashboard/Elements/TransactionCard.razor b/Client/Pages/Dashboard/Elements/TransactionCard.razor
index dc0c1c6..bba253f 100644
--- a/Client/Pages/Dashboard/Elements/TransactionCard.razor
+++ b/Client/Pages/Dashboard/Elements/TransactionCard.razor
@@ -1,31 +1,58 @@
@using Biskilog_Accounting.Shared.CustomModels;
@using Biskilog_Accounting.Shared.Interfaces;
+@using Microsoft.Fast.Components.FluentUI
@inject ICalculator m_calculator
-
-
-
-
-
-
-
-
-
- @(m_calculator.FormatMoneyWithCurrencyKilo((double)detail.Total))
-
-
+@if (!IsLoading)
+{
+
+
+
+
+
+
+
+
+
+ @(
+ m_calculator.FormatMoneyWithCurrencyKilo((double)detail.Total)
+ )
+
+
-
-
+
+
+
-
-
+}
+else
+{
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/Client/Pages/Dashboard/Elements/WelcomeCard.razor b/Client/Pages/Dashboard/Elements/WelcomeCard.razor
index 969e02b..e3efb96 100644
--- a/Client/Pages/Dashboard/Elements/WelcomeCard.razor
+++ b/Client/Pages/Dashboard/Elements/WelcomeCard.razor
@@ -1,25 +1,47 @@
@using Biskilog_Accounting.Shared.Interfaces;
+@using Microsoft.Fast.Components.FluentUI
@inject ICalculator m_calculator;
-
-
-
-
-
@(TradeSummary.CurrentTradeSales > TradeSummary.LastTradeSales ? "Congratulations 🎉" : TradeSummary.LastTradeSales > TradeSummary.CurrentTradeSales ? "Tough shift there" : "Well Done") @Username!
-
- @m_remarks
-
-
View Trade Summary
+@if (!IsLoading)
+{
+
+
+
+
+
@(TradeSummary.CurrentTradeSales > TradeSummary.LastTradeSales ? "Congratulations 🎉" : TradeSummary.LastTradeSales > TradeSummary.CurrentTradeSales ? "Tough shift there" : "Well Done") @Username!
+
+ @m_remarks
+
+
View Trade Summary
+
-
-
-
-
+
+
+
+
-
\ No newline at end of file
+}
+else
+{
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/Client/Pages/Dashboard/Elements/WelcomeCard.razor.cs b/Client/Pages/Dashboard/Elements/WelcomeCard.razor.cs
index 4982050..277f19b 100644
--- a/Client/Pages/Dashboard/Elements/WelcomeCard.razor.cs
+++ b/Client/Pages/Dashboard/Elements/WelcomeCard.razor.cs
@@ -10,7 +10,8 @@ namespace Biskilog_Accounting.Client.Pages.Dashboard.Elements
[Parameter]
public TradeSummary TradeSummary { get; set; } = new TradeSummary();
-
+ [Parameter]
+ public bool IsLoading { get; set; } = true;
private string m_remarks { get; set; } = "";
private string m_currentTrade { get; set; } = string.Empty;
private string m_previousTrade { get; set; } = string.Empty;
@@ -21,7 +22,7 @@ namespace Biskilog_Accounting.Client.Pages.Dashboard.Elements
}
private void CalculateStatistic()
{
- if(TradeSummary.CurrentTradeDate != DateTime.Today)
+ if (TradeSummary.CurrentTradeDate != DateTime.Today)
{
m_currentTrade = $"most recent trade date ({TradeSummary.CurrentTradeDate.ToString("dd MMM,yyy")})";
}
diff --git a/Client/Program.cs b/Client/Program.cs
index 2f1b925..5109c32 100644
--- a/Client/Program.cs
+++ b/Client/Program.cs
@@ -6,6 +6,7 @@ using Blazored.LocalStorage;
using Blazored.SessionStorage;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
+using Microsoft.Fast.Components.FluentUI;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add
("#app");
@@ -20,5 +21,11 @@ builder.Services.AddBlazoredSessionStorageAsSingleton();
builder.Services.AddScoped();
builder.Services.AddScoped();
+builder.Services.AddFluentUIComponents(options =>
+{
+ options.HostingModel = BlazorHostingModel.WebAssembly;
+ options.IconConfiguration = ConfigurationGenerator.GetIconConfiguration();
+ options.EmojiConfiguration = ConfigurationGenerator.GetEmojiConfiguration();
+});
await builder.Build().RunAsync();