94 lines
4.9 KiB
Plaintext
94 lines
4.9 KiB
Plaintext
@page "/CustomDescriptions"
|
|
@using Gremlin_BlazorServer.Services
|
|
@using Gremlin_BlazorServer.Data.EntityClasses
|
|
|
|
@inject GenericController GenericController
|
|
@inject GenericImporter GenericImporter
|
|
|
|
<AuthorizeView>
|
|
<Authorized Context="auth">
|
|
<Div Margin="Margin.Is3"
|
|
Border="Border.Dark.OnAll"
|
|
Padding="Padding.Is3"
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
<Heading Size="HeadingSize.Is4">CustomDescription</Heading>
|
|
<Paragraph>
|
|
<DataGrid TItem="CustomDescription"
|
|
Data="@customDescriptions"
|
|
SelectedRow="@selectedCustomDescription"
|
|
SelectedRowChanged="@OnSelectedCustomDescriptionChanged"
|
|
RowInserted="@OnRowInsertedAsync"
|
|
RowUpdated="@OnRowUpdatedAsync"
|
|
RowRemoved="@OnRowRemovedAsync"
|
|
CommandMode="DataGridCommandMode.ButtonRow"
|
|
EditMode="DataGridEditMode.Popup"
|
|
PagerPosition="DataGridPagerPosition.Top"
|
|
PagerOptions="new() { ButtonSize = Size.Default }"
|
|
ShowPageSizes UseValidation Narrow Navigable Editable ShowPager Bordered Hoverable Sortable Filterable Striped Responsive FixedHeader>
|
|
|
|
<DataGridColumns>
|
|
<DataGridCommandColumn NewCommandAllowed="false" EditCommandAllowed="false" DeleteCommandAllowed="false">
|
|
<SaveCommandTemplate>
|
|
<Button ElementId="btnSave" Type="ButtonType.Submit" PreventDefaultOnSubmit Color="Color.Primary" Clicked="context.Clicked">@context.LocalizationString</Button>
|
|
</SaveCommandTemplate>
|
|
<CancelCommandTemplate>
|
|
<Button ElementId="btnCancel" Color="Color.Secondary" Clicked="context.Clicked">@context.LocalizationString</Button>
|
|
</CancelCommandTemplate>
|
|
</DataGridCommandColumn>
|
|
|
|
<DataGridColumn Field="@nameof(CustomDescription.CustomDescriptionId)" Caption="CustomDescriptionId" Filterable Sortable/>
|
|
|
|
<DataGridColumn Field="@nameof(CustomDescription.ProductNumber)" Caption="ProductNumber" Filterable Sortable Editable/>
|
|
|
|
<DataGridColumn Field="@nameof(CustomDescription.OptionNumber)" Caption="OptionNumber" Filterable Sortable Editable/>
|
|
|
|
<DataGridColumn Field="@nameof(CustomDescription.Heading)" Caption="Heading" Filterable Sortable Editable/>
|
|
|
|
<DataGridColumn Field="@nameof(CustomDescription.CoverletterText)" Caption="CoverletterText" Filterable Sortable Editable/>
|
|
|
|
<DataGridColumn Field="@nameof(CustomDescription.DescriptionText)" Caption="DescriptionText" Filterable Sortable Editable/>
|
|
|
|
<DataGridColumn Field="@nameof(CustomDescription.AccountId)" Caption="AccountId" Filterable Sortable Editable>
|
|
<EditTemplate>
|
|
<NumericEdit TValue="uint" Value="(uint)context.CellValue" ValueChanged="v => context.CellValue = v"/>
|
|
</EditTemplate>
|
|
</DataGridColumn>
|
|
</DataGridColumns>
|
|
|
|
<ButtonRowTemplate>
|
|
<Button Color="Color.Success" Clicked="context.NewCommand.Clicked">New</Button>
|
|
<Button Color="Color.Primary" Disabled="selectedCustomDescription is null" Clicked="context.EditCommand.Clicked">Edit</Button>
|
|
<Button Color="Color.Danger" Disabled="selectedCustomDescription is null" Clicked="context.DeleteCommand.Clicked">Delete</Button>
|
|
<Button Color="Color.Secondary" Clicked="context.ClearFilterCommand.Clicked">Clear Filter</Button>
|
|
</ButtonRowTemplate>
|
|
</DataGrid>
|
|
</Paragraph>
|
|
</Div>
|
|
|
|
<Div Margin="Margin.Is3"
|
|
Border="Border.Dark.OnAll"
|
|
Padding="Padding.Is3"
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
<Heading Size="HeadingSize.Is4">Import</Heading>
|
|
<Paragraph>
|
|
<Field>
|
|
<FieldLabel>Import CustomDescriptions</FieldLabel>
|
|
<FileEdit Filter=".csv" Changed="@OnImportCustomDescriptions"/>
|
|
</Field>
|
|
</Paragraph>
|
|
</Div>
|
|
|
|
</Authorized>
|
|
<NotAuthorized>
|
|
<Div Margin="Margin.Is3"
|
|
Border="Border.Dark.OnAll"
|
|
Padding="Padding.Is3"
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
<Heading Size="HeadingSize.Is3">Authentication Failure!</Heading>
|
|
<Paragraph>You're not signed in. Please click on the upper right to either register or log in.</Paragraph>
|
|
</Div>
|
|
</NotAuthorized>
|
|
</AuthorizeView> |