26 lines
751 B
C#
26 lines
751 B
C#
using Elwig.Models.Entities;
|
|
using System;
|
|
|
|
namespace Elwig.Helpers.Billing {
|
|
public class Varibute : IComparable<Varibute> {
|
|
|
|
public WineVar? Variety { get; }
|
|
public WineAttr? Attribute { get; }
|
|
public string Listing => $"{Variety?.SortId}{Attribute?.AttrId}";
|
|
public string FullName => $"{Variety?.Name}" + (Variety != null && Attribute != null ? " " : "") + $"{Attribute?.Name}";
|
|
|
|
public Varibute(WineVar? var, WineAttr? attr) {
|
|
Variety = var;
|
|
Attribute = attr;
|
|
}
|
|
|
|
public override string ToString() {
|
|
return Listing;
|
|
}
|
|
|
|
public int CompareTo(Varibute? other) {
|
|
return Listing.CompareTo(other?.Listing);
|
|
}
|
|
}
|
|
}
|