30 lines
1.4 KiB
C#
30 lines
1.4 KiB
C#
using Blazorise;
|
|
using Gremlin_BlazorServer.Data.EntityClasses;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace Gremlin_BlazorServer.Pages;
|
|
|
|
public partial class CustomDescriptionModal {
|
|
private CustomDescription? selectedSuggestedCustomDescription;
|
|
[Inject] public IModalService ModalService { get; set; }
|
|
[Parameter] public CustomDescription CustomDescription { get; set; } = new();
|
|
[Parameter] public IEnumerable<CustomDescription> Suggestions { get; set; }
|
|
|
|
private async Task OnSave() {
|
|
//TODO EventCallback to save new CD to DB
|
|
await ModalService.Hide();
|
|
}
|
|
|
|
private void OnSelectedSuggestedCustomDescription(CustomDescription newSelectedSuggestedCustomDescriptions) {
|
|
selectedSuggestedCustomDescription = newSelectedSuggestedCustomDescriptions;
|
|
CustomDescription.Heading = selectedSuggestedCustomDescription.Heading;
|
|
CustomDescription.CoverletterText = selectedSuggestedCustomDescription.CoverletterText;
|
|
CustomDescription.DescriptionText = selectedSuggestedCustomDescription.DescriptionText;
|
|
}
|
|
|
|
private void OnHeadingChanged(string value) => CustomDescription.Heading = value;
|
|
private void OnCoverletterTextChanged(string value) => CustomDescription.CoverletterText = value;
|
|
private void OnDescriptionTextChanged(string value) => CustomDescription.DescriptionText = value;
|
|
|
|
private async Task OnClose() => await ModalService.Hide();
|
|
} |