This commit is contained in:
Friend2868
2023-06-13 21:37:03 +02:00
parent 9f1b6fe3b1
commit b0e09114fb
2 changed files with 9 additions and 4 deletions
@@ -82,15 +82,15 @@
<ModalBody> <ModalBody>
<Field> <Field>
<FieldLabel>User Name</FieldLabel> <FieldLabel>User Name</FieldLabel>
<TextEdit @ref="modalAddUserName" Placeholder="Enter user name..." /> <TextEdit @ref="modalAddUserName" @bind-Text="@UserCopy.Name" Placeholder="Enter user name..." />
</Field> </Field>
<Field> <Field>
<FieldLabel>User E-Mail</FieldLabel> <FieldLabel>User E-Mail</FieldLabel>
<TextEdit @ref="modalAddUserEmail" Placeholder="Enter user E-mail..." /> <TextEdit @ref="modalAddUserEmail" @bind-Text="@UserCopy.Name" Placeholder="Enter user E-mail..." />
</Field> </Field>
<Field> <Field>
<FieldLabel>User Password</FieldLabel> <FieldLabel>User Password</FieldLabel>
<TextEdit @ref="modalAddUserPW" Placeholder="Enter user password..." /> <TextEdit @ref="modalAddUserPW" @bind-Text="@UserCopy.Name" Placeholder="Enter user password..." />
</Field> </Field>
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
@@ -248,7 +248,7 @@
private async Task RegisterUser() private async Task RegisterUser()
{ {
Result<Device> result = await AuthenthicationService.RegisterUserAsync(modalAddUserName.Text.ToString(), modalAddUserEmail.Text.ToString(), modalAddUserPW.Text.ToString(), Role.User); Result<Device> result = await AuthenthicationService.RegisterUserAsync(modalAddUserName.Text.ToString(), modalAddUserPW.Text.ToString(), modalAddUserEmail.Text.ToString(), Role.User);
if (result.IsSuccess) if (result.IsSuccess)
{ {
@@ -40,6 +40,11 @@ public class EnergyPriceService : IEnergyPriceService
{ {
plugnames += $"shellyplug-s-{device.MacAddress}/relay/0|"; plugnames += $"shellyplug-s-{device.MacAddress}/relay/0|";
} }
if(plugnames.Length <= 0)
{
return 0;
}
plugnames = plugnames[0..^1]; plugnames = plugnames[0..^1];
if (startime < endTime) if (startime < endTime)