Archived
1
0

capitalise bounty voucher type

This commit is contained in:
Florian Stinglmayr 2021-08-04 17:39:57 +02:00
parent 27d34be46d
commit dfd66c9fb6

View File

@ -1,12 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
using System.Globalization;
using NonaBGS.Journal;
namespace NonaBGS.BGS {
public class Vouchers : LogEntry {
private string type = null;
public int TotalSum {
get {
@ -19,21 +17,21 @@ namespace NonaBGS.BGS {
public string Type {
get {
string v = Entries
.Where(x => x.GetType() == typeof(RedeemVoucherEntry))
.GroupBy(x => (x as RedeemVoucherEntry).Type)
.Select(x => x.Key)
.First();
return v;
if (type == null) {
string v = Entries
.Where(x => x.GetType() == typeof(RedeemVoucherEntry))
.GroupBy(x => (x as RedeemVoucherEntry).Type)
.Select(x => x.Key)
.First();
type = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(v);
}
return type;
}
}
public override string ToString() {
StringBuilder builder = new StringBuilder();
builder.AppendFormat("{0} Vouchers: {1}", Type, Credits.FormatCredits(TotalSum));
return builder.ToString();
return string.Format("{0} Vouchers: {1}", Type, Credits.FormatCredits(TotalSum));
}
/// <summary>