Skip to content

Commit

Permalink
Merge pull request #362 from dimmik/beta/strange-rate
Browse files Browse the repository at this point in the history
lets try
  • Loading branch information
dimmik authored Nov 6, 2024
2 parents 4686e5a + f9d0f3c commit 8bed225
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions TCalcCore/Domain/Tour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,21 @@ public class Tour : AbstractItem

public string StateGUID { get; set; } = "";
public IEnumerable<Currency> Currencies { get; set; } = new Currency[] { Currency.Default };
private Currency __currency = Currency.Default;
private string cId { get; set; }
public Currency Currency {
get {
return __currency;
}
set {
if (__currency != value)
get {
if (!Currencies.Any(c => c.Id == cId))
cId = Currencies.First().Id;
return Currencies.Where(c => c.Id == cId).First();
}
set
{
if (cId != value.Id)
{
__currency = value;
// remove all suggested spendings
cId = value.Id;
Spendings = Spendings.Where(s => !s.Planned).ToList();
}
}
}
}
public void PrepareForStoring()
{
Expand Down

0 comments on commit 8bed225

Please sign in to comment.