-
-
Notifications
You must be signed in to change notification settings - Fork 315
Expand file tree
/
Copy pathAddEditModal.razor
More file actions
55 lines (48 loc) · 1.88 KB
/
AddEditModal.razor
File metadata and controls
55 lines (48 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@typeparam TRequest
@inject IStringLocalizer<SharedResource> L
<EditForm Model="@RequestModel" OnValidSubmit="SaveAsync">
<MudDialog>
<TitleContent>
<MudText Typo="Typo.h6">
@if (IsCreate)
{
<MudIcon Icon="@Icons.Material.Filled.Add" Class="mr-3 mb-n1" />
@($"{L["Create"]} "); @L[EntityName];
}
else
{
<MudIcon Icon="@Icons.Material.Filled.Update" Class="mr-3 mb-n1" />
@($"{L["Edit"]} "); @L[EntityName]
}
</MudText>
</TitleContent>
<DialogContent>
<DataAnnotationsValidator />
<CustomValidation @ref="_customValidation" />
<MudGrid>
@if (!IsCreate && !HideId)
{
<MudItem xs="12" md="6">
<MudTextField Value="Id" ReadOnly DisableUnderLine Label="@L[$"{EntityName} Id"]" />
</MudItem>
}
@EditFormContent(RequestModel)
</MudGrid>
</DialogContent>
<DialogActions>
<MudButton DisableElevation Variant="Variant.Filled" OnClick="Cancel" StartIcon="@Icons.Filled.Cancel">@L["Cancel"]</MudButton>
@if (IsCreate)
{
<MudButton DisableElevation Variant="Variant.Filled" ButtonType="ButtonType.Submit" Color="Color.Success" StartIcon="@Icons.Filled.Save" >
@L["Save"]
</MudButton>
}
else
{
<MudButton DisableElevation Variant="Variant.Filled" ButtonType="ButtonType.Submit" Color="Color.Secondary" StartIcon="@Icons.Filled.Update">
@L["Update"]
</MudButton>
}
</DialogActions>
</MudDialog>
</EditForm>