|
@@ -22,7 +22,7 @@ public class ForeignCurrencyGridSettings : BaseObject, IGlobalConfigurationSetti
|
|
|
public string ApiKey { get; set; }
|
|
|
|
|
|
[TextBoxEditor]
|
|
|
- [EditorSequence(1)]
|
|
|
+ [EditorSequence(2)]
|
|
|
public string BaseCurrency { get; set; } = "AUD";
|
|
|
}
|
|
|
|
|
@@ -66,6 +66,21 @@ public class ForeignCurrencyGrid : DynamicDataGrid<ForeignCurrency>
|
|
|
new Client<ForeignCurrency>().Save(fc, string.Format("Set to {0} ", fc.Active ? "Active" : "InActive"));
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ protected override BaseEditor? GetEditor(object item, DynamicGridColumn column)
|
|
|
+ {
|
|
|
+ BaseEditor? editor = null;
|
|
|
+ if (column.ColumnName.Equals(nameof(ForeignCurrency.Identifier)) && string.IsNullOrWhiteSpace(_settings.ApiKey))
|
|
|
+ {
|
|
|
+ editor = base.GetEditor(item, column)?.CloneEditor() ?? new NullEditor();
|
|
|
+ editor.Editable = Editable.Hidden;
|
|
|
+ editor.Visible = Visible.Hidden;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ editor = base.GetEditor(item, column);
|
|
|
+
|
|
|
+ return editor;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
private bool UpdateExchangeRates(Button button, CoreRow[] rows)
|
|
@@ -112,7 +127,7 @@ public class ForeignCurrencyGrid : DynamicDataGrid<ForeignCurrency>
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- foreach (var item in items.Where(x => x.Active))
|
|
|
+ foreach (var item in items)
|
|
|
item.ExchangeRate = foreign_usd / usd_aud;
|
|
|
}
|
|
|
}
|