complete account page

This commit is contained in:
2022-03-02 17:31:49 +08:00
parent aa38e186c7
commit 51f8e4f2e8
26 changed files with 547 additions and 76 deletions

View File

@ -5,6 +5,7 @@ namespace Billing.Models
public class Category : BaseModel
{
public int Id { get; set; }
public CategoryType Type { get; set; }
public string Icon { get; set; } = ICON_DEFAULT;
public string Name { get; set; }
public int? ParentId { get; set; }
@ -12,6 +13,7 @@ namespace Billing.Models
public override void OnXmlDeserialize(XElement node)
{
Id = Read(node, nameof(Id), 0);
Type = (CategoryType)Read(node, nameof(Type), 0);
Icon = Read(node, nameof(Icon), ICON_DEFAULT);
Name = Read(node, nameof(Name), string.Empty);
var parentId = Read(node, nameof(ParentId), -1);
@ -24,6 +26,7 @@ namespace Billing.Models
public override void OnXmlSerialize(XElement node)
{
Write(node, nameof(Id), Id);
Write(node, nameof(Type), (int)Type);
Write(node, nameof(Icon), Icon);
Write(node, nameof(Name), Name);
if (ParentId != null)
@ -32,4 +35,10 @@ namespace Billing.Models
}
}
}
public enum CategoryType
{
Spending,
Income
}
}