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.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace Schaad.Accounting.Models
|
namespace Schaad.Accounting.Models
|
||||||
{
|
{
|
||||||
|
|
@ -43,6 +44,9 @@ namespace Schaad.Accounting.Models
|
||||||
[Display(Name = "Währungskurs")]
|
[Display(Name = "Währungskurs")]
|
||||||
public decimal? FxRate { get; set; }
|
public decimal? FxRate { get; set; }
|
||||||
|
|
||||||
|
[XmlIgnore]
|
||||||
|
public bool ReadOnly {get; set;}
|
||||||
|
|
||||||
public Transaction()
|
public Transaction()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ else
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="text-column">
|
<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">
|
<datalist id="texts">
|
||||||
@foreach (var text in bookingTexts.OrderBy(t => t))
|
@foreach (var text in bookingTexts.OrderBy(t => t))
|
||||||
{
|
{
|
||||||
|
|
@ -88,11 +88,12 @@ else
|
||||||
</td>
|
</td>
|
||||||
<td style="align-content: center">
|
<td style="align-content: center">
|
||||||
<FluentButton IconEnd="@(new Icons.Regular.Size16.SplitVertical())" Appearance="Appearance.Neutral"
|
<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>
|
||||||
<td style="align-content: center">
|
<td style="align-content: center">
|
||||||
<FluentButton IconEnd="@(new Icons.Regular.Size16.Save())" Appearance="Appearance.Neutral"
|
<FluentButton IconEnd="@(new Icons.Regular.Size16.Save())" Appearance="Appearance.Neutral"
|
||||||
OnClick="@(() => BookBankTransactionAsync(transaction))"/>
|
OnClick="@(() => BookBankTransactionAsync(transaction))"
|
||||||
|
Disabled="@transaction.ReadOnly" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ public partial class Home : ComponentBase
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
transactionRepository.SaveTransaction(transaction);
|
transactionRepository.SaveTransaction(transaction);
|
||||||
ReloadPage();
|
transaction.ReadOnly = true;
|
||||||
await Task.CompletedTask;
|
await Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue