From b0e09114fb6626f224783358979e69b425c81121 Mon Sep 17 00:00:00 2001 From: Friend2868 Date: Tue, 13 Jun 2023 21:37:03 +0200 Subject: [PATCH] yes --- src/Elektrifikatsiya/Elektrifikatsiya/Pages/Admin.razor | 8 ++++---- .../Services/Implementations/EnergyPriceService.cs | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Admin.razor b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Admin.razor index 8aca516..9f86930 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Admin.razor +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Admin.razor @@ -82,15 +82,15 @@ User Name - + User E-Mail - + User Password - + @@ -248,7 +248,7 @@ private async Task RegisterUser() { - Result result = await AuthenthicationService.RegisterUserAsync(modalAddUserName.Text.ToString(), modalAddUserEmail.Text.ToString(), modalAddUserPW.Text.ToString(), Role.User); + Result result = await AuthenthicationService.RegisterUserAsync(modalAddUserName.Text.ToString(), modalAddUserPW.Text.ToString(), modalAddUserEmail.Text.ToString(), Role.User); if (result.IsSuccess) { diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Services/Implementations/EnergyPriceService.cs b/src/Elektrifikatsiya/Elektrifikatsiya/Services/Implementations/EnergyPriceService.cs index e81031c..5a07c66 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Services/Implementations/EnergyPriceService.cs +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Services/Implementations/EnergyPriceService.cs @@ -40,6 +40,11 @@ public class EnergyPriceService : IEnergyPriceService { plugnames += $"shellyplug-s-{device.MacAddress}/relay/0|"; } + + if(plugnames.Length <= 0) + { + return 0; + } plugnames = plugnames[0..^1]; if (startime < endTime)