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