|
|
|
|
@ -5,6 +5,7 @@
|
|
|
|
|
@using System.Globalization;
|
|
|
|
|
|
|
|
|
|
@inject QuoteService quoteservice
|
|
|
|
|
@inject LineItemService lineItemService
|
|
|
|
|
|
|
|
|
|
<h1>Quotes</h1>
|
|
|
|
|
|
|
|
|
|
@ -22,83 +23,79 @@
|
|
|
|
|
|
|
|
|
|
@if (quotes is null)
|
|
|
|
|
{
|
|
|
|
|
<p><em>Loading... !</em></p>
|
|
|
|
|
<p><em>Loading... !</em></p>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<p>Es wurden @filteredQuotes.Count Quotes gefunden.</p>
|
|
|
|
|
@if (quotes != null)
|
|
|
|
|
{
|
|
|
|
|
<DataGrid
|
|
|
|
|
TItem="Quote"
|
|
|
|
|
Data="@quotes"
|
|
|
|
|
@bind-SelectedRow="@selectedQuote"
|
|
|
|
|
ReadData="@OnReadData"
|
|
|
|
|
TotalItems="@totalQuotes"
|
|
|
|
|
PageSize="15"
|
|
|
|
|
ShowPager
|
|
|
|
|
{
|
|
|
|
|
<DataGrid
|
|
|
|
|
TItem="Quote"
|
|
|
|
|
Data="@quotes"
|
|
|
|
|
@bind-SelectedRow="@selectedQuote"
|
|
|
|
|
ReadData="@OnReadData"
|
|
|
|
|
TotalItems="@totalQuotes"
|
|
|
|
|
PageSize="10"
|
|
|
|
|
ShowPager
|
|
|
|
|
Bordered
|
|
|
|
|
Hoverable
|
|
|
|
|
Filterable
|
|
|
|
|
Sortable
|
|
|
|
|
Striped
|
|
|
|
|
Responsive>
|
|
|
|
|
<DataGridCommandColumn />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.QuoteId)" Caption="#"/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.QuotationNumber)" Caption="QuotationNumber" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.QuotationDate)" Caption="Date" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.ValidUntil)" Caption="ValidUntil" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.TotalNet)" Caption="TotalNet" DisplayFormat="{0:C}" DisplayFormatProvider=cultureInfo Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.TotalGross)" Caption="TotalGross" DisplayFormat="{0:C}" DisplayFormatProvider=cultureInfo Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.QuoteContains3PP)" Caption="3PP" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.QuoteContainsRB)" Caption="RB" Editable />
|
|
|
|
|
</DataGrid>
|
|
|
|
|
|
|
|
|
|
<p>LineItems in selectedQuote</p>
|
|
|
|
|
<DataGrid
|
|
|
|
|
TItem="LineItem"
|
|
|
|
|
Data="@lineItemsInSelectedQuote"
|
|
|
|
|
Bordered
|
|
|
|
|
Hoverable
|
|
|
|
|
Sortable
|
|
|
|
|
Striped
|
|
|
|
|
Responsive>
|
|
|
|
|
<DataGridCommandColumn />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.QuoteId)" Caption="#" Sortable="false" />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.QuotationNumber)" Caption="QuotationNumber" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.QuotationDate)" Caption="Date" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.ValidUntil)" Caption="ValidUntil" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.TotalNet)" Caption="TotalNet" DisplayFormat="{0:C}" DisplayFormatProvider=cultureInfo Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.TotalGross)" Caption="TotalGross" DisplayFormat="{0:C}" DisplayFormatProvider=cultureInfo Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.QuoteContains3PP)" Caption="3PP" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(Quote.QuoteContainsRB)" Caption="RB" Editable />
|
|
|
|
|
</DataGrid>
|
|
|
|
|
|
|
|
|
|
@* <table class="table">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>@nameof(Quote.QuoteId)</th>
|
|
|
|
|
<th>@nameof(Quote.QuotationNumber)</th>
|
|
|
|
|
<th>@nameof(Quote.QuotationDate)</th>
|
|
|
|
|
<th>@nameof(Quote.ValidUntil)</th>
|
|
|
|
|
<th>@nameof(Quote.TotalNet)</th>
|
|
|
|
|
<th>@nameof(Quote.TotalGross)</th>
|
|
|
|
|
<th>@nameof(Quote.QuoteContains3PP)</th>
|
|
|
|
|
<th>@nameof(Quote.QuoteContainsRB)</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
@foreach (Quote quote in filteredQuotes)
|
|
|
|
|
{<tr>
|
|
|
|
|
<td>@quote.QuoteId</td>
|
|
|
|
|
<td>@quote.QuotationNumber</td>
|
|
|
|
|
<td>@quote.QuotationDate</td>
|
|
|
|
|
<td>@quote.ValidUntil</td>
|
|
|
|
|
<td>@quote.TotalNet.ToString("C", cultureInfo)</td>
|
|
|
|
|
<td>@quote.TotalGross.ToString("C", cultureInfo)</td>
|
|
|
|
|
<td>@quote.QuoteContains3PP</td>
|
|
|
|
|
<td>@quote.QuoteContainsRB</td>
|
|
|
|
|
<td>
|
|
|
|
|
<a class="nav-link" href="Quotes/Edit/@quote.QuoteId">
|
|
|
|
|
<span class="oi oi-pencil" aria-hidden="true">Edit</span>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="nav-link" href="Quotes/Delete/@quote.QuoteId">
|
|
|
|
|
<span class="oi oi-trash" aria-hidden="true">Delete</span>
|
|
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>*@
|
|
|
|
|
}
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.Position)" Caption="#"/>
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.Amount)" Caption="Amount" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.ProductNumber)" Caption="ProductNumber" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.OptionNumber)" Caption="OptionNumber" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.ProductLine)" Caption="ProductLine" Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.ListPrice)" Caption="ListPrice" DisplayFormat="{0:C}" DisplayFormatProvider=cultureInfo Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.TotalDiscount)" Caption="TotalDiscount" DisplayFormat="{0:C}" DisplayFormatProvider=cultureInfo Editable />
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.Total)" Caption="Total" DisplayFormat="{0:C}" DisplayFormatProvider=cultureInfo Editable />
|
|
|
|
|
</DataGrid>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
|
|
|
|
|
public string searchQuote = "";
|
|
|
|
|
Quote selectedQuote = new();
|
|
|
|
|
CultureInfo cultureInfo = new("de-DE");
|
|
|
|
|
|
|
|
|
|
Quote? selectedQuote = new();
|
|
|
|
|
List<LineItem> lineItemsInSelectedQuote = new();
|
|
|
|
|
|
|
|
|
|
List<Quote> quotes = new();
|
|
|
|
|
List<Quote> filteredQuotes = new();
|
|
|
|
|
CultureInfo cultureInfo = new("de-DE");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
|
{
|
|
|
|
|
quotes = await Task.Run(() => quoteservice.GetAllQuotesAsync());
|
|
|
|
|
filteredQuotes = quotes;
|
|
|
|
|
selectedQuote = quotes.FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
lineItemsInSelectedQuote = await lineItemService.GetLineItemsAsync(selectedQuote);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SearchQuote_OnChange()
|
|
|
|
|
|