Make line readonly after save
This commit is contained in:
parent
2d59684469
commit
3d3a6af103
3 changed files with 9 additions and 4 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace Schaad.Accounting.Models
|
||||
{
|
||||
|
|
@ -42,6 +43,9 @@ namespace Schaad.Accounting.Models
|
|||
|
||||
[Display(Name = "Währungskurs")]
|
||||
public decimal? FxRate { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public bool ReadOnly {get; set;}
|
||||
|
||||
public Transaction()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ else
|
|||
</td>
|
||||
<td>
|
||||
<div class="text-column">
|
||||
<input list="texts" @bind="@transaction.Text" placeholder="Type or select..."/>
|
||||
<input list="texts" @bind="@transaction.Text" placeholder="Type or select..." readonly="@transaction.ReadOnly"/>
|
||||
<datalist id="texts">
|
||||
@foreach (var text in bookingTexts.OrderBy(t => t))
|
||||
{
|
||||
|
|
@ -88,11 +88,12 @@ else
|
|||
</td>
|
||||
<td style="align-content: center">
|
||||
<FluentButton IconEnd="@(new Icons.Regular.Size16.SplitVertical())" Appearance="Appearance.Neutral"
|
||||
OnClick="@(() => SplitBankTransactionAsync(transaction))" Disabled="@(transaction.Value > 0)"/>
|
||||
OnClick="@(() => SplitBankTransactionAsync(transaction))" Disabled="@(transaction.Value > 0 || transaction.ReadOnly)" />
|
||||
</td>
|
||||
<td style="align-content: center">
|
||||
<FluentButton IconEnd="@(new Icons.Regular.Size16.Save())" Appearance="Appearance.Neutral"
|
||||
OnClick="@(() => BookBankTransactionAsync(transaction))"/>
|
||||
OnClick="@(() => BookBankTransactionAsync(transaction))"
|
||||
Disabled="@transaction.ReadOnly" />
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ public partial class Home : ComponentBase
|
|||
return;
|
||||
}
|
||||
transactionRepository.SaveTransaction(transaction);
|
||||
ReloadPage();
|
||||
transaction.ReadOnly = true;
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue