disable history and statistic button if account contains NY
This commit is contained in:
parent
a09e3ab50e
commit
1597d99bff
3 changed files with 22 additions and 9 deletions
|
@ -38,8 +38,16 @@
|
||||||
{
|
{
|
||||||
<a class="btn btn-secondary btn-sm me-2" href="/advisor/customers/@CompanyId/workplaces/new"><i class="bi-plus-lg"></i> Arbejdssted</a>
|
<a class="btn btn-secondary btn-sm me-2" href="/advisor/customers/@CompanyId/workplaces/new"><i class="bi-plus-lg"></i> Arbejdssted</a>
|
||||||
}
|
}
|
||||||
<a class="btn btn-secondary btn-sm me-2" href="/advisor/customers/@CompanyId/statistic"><i class="bi-activity"></i> Statistik</a>
|
@if (_company.Account.StartsWith("NY"))
|
||||||
<button class="btn btn-secondary btn-sm me-2" @onclick="@ReloadHistory" disabled="@_working"><i class="bi-repeat"></i> Historik</button>
|
{
|
||||||
|
<a type="button" class="btn btn-secondary btn-sm me-2 disabled" aria-disabled="true"><i class="bi-activity"></i> Statistik</a>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<a class="btn btn-secondary btn-sm me-2" href="/advisor/customers/@CompanyId/statistic" disabled="@(_company.Account.StartsWith("NY"))"><i class="bi-activity"></i> Statistik</a>
|
||||||
|
}
|
||||||
|
|
||||||
|
<button class="btn btn-secondary btn-sm me-2" @onclick="@ReloadHistory" disabled="@(_working || _company.Account.StartsWith("NY"))"><i class="bi-repeat"></i> Historik</button>
|
||||||
<a class="btn btn-primary btn-sm me-2" href="/advisor/customers"><i class="bi-chevron-left"></i> Tilbage</a>
|
<a class="btn btn-primary btn-sm me-2" href="/advisor/customers"><i class="bi-chevron-left"></i> Tilbage</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -228,13 +228,16 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
|
||||||
if (firstRender)
|
if (firstRender)
|
||||||
{
|
{
|
||||||
await GetContacts(CompanyId);
|
await GetContacts(CompanyId);
|
||||||
|
_ = await DrawerService.GetActivityDrawerAsync(CompanyId);
|
||||||
|
if (!_company.Account.StartsWith("NY"))
|
||||||
|
{
|
||||||
_ = await HistoryRepo.RequestErpSync(CompanyId, _company.HistorySync, false);
|
_ = await HistoryRepo.RequestErpSync(CompanyId, _company.HistorySync, false);
|
||||||
_ = await DrawerService.GetInvoiceDrawerAsync(CompanyId);
|
_ = await DrawerService.GetInvoiceDrawerAsync(CompanyId);
|
||||||
_ = await DrawerService.GetInventoryDrawerAsync(CompanyId);
|
_ = await DrawerService.GetInventoryDrawerAsync(CompanyId);
|
||||||
_ = await DrawerService.GetActivityDrawerAsync(CompanyId);
|
|
||||||
_ = await DrawerService.GetStatisticDrawerAsync(CompanyId);
|
_ = await DrawerService.GetStatisticDrawerAsync(CompanyId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private async Task ReloadHistory()
|
private async Task ReloadHistory()
|
||||||
|
@ -242,6 +245,9 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
|
||||||
Toaster.ShowInfo("Afventer svar fra tjenester ...");
|
Toaster.ShowInfo("Afventer svar fra tjenester ...");
|
||||||
_enableLink = 0;
|
_enableLink = 0;
|
||||||
_enableActivity = 0;
|
_enableActivity = 0;
|
||||||
|
|
||||||
|
_ = await DrawerService.GetActivityDrawerAsync(CompanyId, true);
|
||||||
|
|
||||||
var newSync = await HistoryRepo.RequestErpSync(CompanyId, _company.HistorySync, true);
|
var newSync = await HistoryRepo.RequestErpSync(CompanyId, _company.HistorySync, true);
|
||||||
if (!string.IsNullOrWhiteSpace(newSync))
|
if (!string.IsNullOrWhiteSpace(newSync))
|
||||||
{
|
{
|
||||||
|
@ -249,7 +255,6 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
|
||||||
_company = _infoDrawer.Content;
|
_company = _infoDrawer.Content;
|
||||||
_ = await DrawerService.GetInvoiceDrawerAsync(CompanyId, true);
|
_ = await DrawerService.GetInvoiceDrawerAsync(CompanyId, true);
|
||||||
_ = await DrawerService.GetInventoryDrawerAsync(CompanyId, true);
|
_ = await DrawerService.GetInventoryDrawerAsync(CompanyId, true);
|
||||||
_ = await DrawerService.GetActivityDrawerAsync(CompanyId, true);
|
|
||||||
_ = await DrawerService.GetStatisticDrawerAsync(CompanyId, true);
|
_ = await DrawerService.GetStatisticDrawerAsync(CompanyId, true);
|
||||||
}
|
}
|
||||||
_enableLink = 1;
|
_enableLink = 1;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<PageSizeComponent />
|
<PageSizeComponent />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<hr/>
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<label class="col-md-3 col-form-label">Kunde søgning</label>
|
<label class="col-md-3 col-form-label">Kunde søgning</label>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
<SearchCustomerSortColumnComponent />
|
<SearchCustomerSortColumnComponent />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<hr/>
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<label class="col-md-3 col-form-label">Produkt søgning</label>
|
<label class="col-md-3 col-form-label">Produkt søgning</label>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
|
|
Loading…
Reference in a new issue