flower-story/App/Data/Model/FlowerItem.cs
2023-06-26 22:33:44 +08:00

46 lines
1019 B
C#

using SQLite;
namespace Blahblah.FlowerStory.Data.Model;
[Table("flowers")]
public class FlowerItem
{
[Column("fid"), PrimaryKey, AutoIncrement]
public int Id { get; set; }
[Column("categoryid")]
public int CategoryId { get; set; }
private string categoryName;
public string CategoryName
{
get
{
if (categoryName == null)
{
if (!Constants.Categories.TryGetValue(CategoryId, out var name))
{
name = Constants.CategoryOther;
}
categoryName = LocalizationResource.GetText(name);
}
return categoryName;
}
}
[Column("name")]
public string Name { get; set; }
[Column("datebuy")]
public DateTimeOffset DateBuy { get; set; }
[Column("cost")]
public decimal? Cost { get; set; }
[Column("purchase")]
public string Purchase { get; set; }
[Column("memo")]
public string Memo { get; set; }
}