disable update/save buttons to avoid doubled records

This commit is contained in:
FH 2022-10-04 10:49:43 +02:00
parent 9ff13d9914
commit 1e298adab8
4 changed files with 7 additions and 3 deletions

View file

@ -134,6 +134,7 @@ namespace Wonky.Client.Pages
}
private async Task SubmitCompanyForm()
{
_formInvalid = true;
_company.LastVisit = $"{_lastVisit:yyyy-MM-dd}";
_company.NextVisit = $"{_nextVisit:yyyy-MM-dd}";
@ -147,6 +148,7 @@ namespace Wonky.Client.Pages
else
{
_toast.ShowWarning($"'{_company.Name}' IKKE oprettet.");
_formInvalid = false;
}
}

View file

@ -209,7 +209,7 @@
<a class="btn btn-light border-dark d-block" href="/companies/@_company.CompanyId/h/i">Produktkøb</a>
</div>
<div class="col">
<button type="submit" class="btn btn-light border-dark d-block">Gem</button>
<button type="submit" class="btn btn-light border-dark d-block" disabled="@_working">Gem</button>
</div>
<div class="col">
<ActivityButton ActionLink="@_actionLink"

View file

@ -20,7 +20,7 @@
<div class="row">
<div class="col text-end">
<button type="button" class="btn btn-warning d-block" onclick="window.print();">PRINT</button>
<button type="button" class="btn btn-warning d-block" @onclick="SetExpressState">SÆT I GANG</button>
<button type="button" class="btn btn-warning d-block" @onclick="SetExpressState" disabled="@_isNotified">SÆT I GANG</button>
</div>
</div>
</div>

View file

@ -26,6 +26,7 @@ public partial class OfficeViewActivityPage : IDisposable
[Inject] public ILogger<OfficeViewActivityPage> Logger { get; set; }
[Inject] public IToastService Toast { get; set; }
private ReportItemView _reportItem { get; set; } = new();
private bool _isNotified { get; set; }
private readonly JsonSerializerOptions? _options = new JsonSerializerOptions
{
@ -95,7 +96,8 @@ public partial class OfficeViewActivityPage : IDisposable
Toast.ShowWarning($"Notifikation til {salesRep.FirstName} kunne ikke sendes. {sendMail.Message}",
"ADVARSEL");
}
_isNotified = true;
}
public void Dispose()