34 lines
1.4 KiB
C#
34 lines
1.4 KiB
C#
using Blazorise;
|
|
using Gremlin_BlazorServer.Data.EntityClasses;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace Gremlin_BlazorServer.Pages
|
|
{
|
|
public partial class CustomDescriptionModal
|
|
{
|
|
[Inject] public IModalService ModalService { get; set; }
|
|
|
|
[Parameter] public CustomDescription CustomDescription { get; set; }
|
|
|
|
[Parameter] public List<CustomDescription> SuggestedCustomDescriptions { get; set; }
|
|
|
|
private CustomDescription? selectedSuggestedCustomDescription;
|
|
private async Task OnSave()
|
|
{
|
|
//TODO EventCallback to save new CD to DB
|
|
await ModalService.Hide();
|
|
}
|
|
|
|
private void OnSelectedSuggestedCustomDescription(CustomDescription _selectedSuggestedCustomDescriptions)
|
|
{
|
|
selectedSuggestedCustomDescription = _selectedSuggestedCustomDescriptions;
|
|
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;
|
|
}
|
|
} |