diff --git a/Billing.Shared/Helper.cs b/Billing.Shared/Helper.cs
index 5c35dcd..53beef9 100644
--- a/Billing.Shared/Helper.cs
+++ b/Billing.Shared/Helper.cs
@@ -1,5 +1,8 @@
-using System;
+using Billing.Models;
+using Billing.Views;
+using System;
using System.Globalization;
+using System.Linq;
using Xamarin.Essentials;
using Xamarin.Forms;
@@ -75,6 +78,18 @@ namespace Billing
return color;
}
+ public static UIBill WrapBill(Bill b)
+ {
+ return new UIBill(b)
+ {
+ Icon = App.Categories.FirstOrDefault(c => c.Id == b.CategoryId)?.Icon ?? BaseModel.ICON_DEFAULT,
+ Name = b.Name,
+ DateCreation = b.CreateTime,
+ Amount = b.Amount,
+ Wallet = App.Accounts.FirstOrDefault(a => a.Id == b.WalletId)?.Name
+ };
+ }
+
public static bool IsSameDay(DateTime day1, DateTime day2)
{
return day1.Year == day2.Year && day1.DayOfYear == day2.DayOfYear;
diff --git a/Billing.Shared/Languages/en.xml b/Billing.Shared/Languages/en.xml
index 7c593c9..67d91e8 100644
--- a/Billing.Shared/Languages/en.xml
+++ b/Billing.Shared/Languages/en.xml
@@ -89,4 +89,7 @@
Add Category
Are you sure you want to delete the category: {0}?
Select Category
+ Tracking Chart
+ (no results)
+ Top 10
\ No newline at end of file
diff --git a/Billing.Shared/Languages/zh-CN.xml b/Billing.Shared/Languages/zh-CN.xml
index 61f5374..21c4d04 100644
--- a/Billing.Shared/Languages/zh-CN.xml
+++ b/Billing.Shared/Languages/zh-CN.xml
@@ -89,4 +89,7 @@
新建分类
是否确认删除该分类:{0}?
选择类别
+ 跟踪图表
+ (无记录)
+ Top 10
\ No newline at end of file
diff --git a/Billing.Shared/Views/BillPage.xaml.cs b/Billing.Shared/Views/BillPage.xaml.cs
index 4c1c91e..aa77ef3 100644
--- a/Billing.Shared/Views/BillPage.xaml.cs
+++ b/Billing.Shared/Views/BillPage.xaml.cs
@@ -72,7 +72,7 @@ namespace Billing.Views
Task.Run(() =>
{
var bills = App.Bills.Where(b => Helper.IsSameDay(b.CreateTime, e.Date));
- Bills = new List(bills.OrderBy(b => b.CreateTime).Select(b => WrapBill(b)));
+ Bills = new List(bills.OrderBy(b => b.CreateTime).Select(b => Helper.WrapBill(b)));
RefreshBalance(Bills);
MainThread.BeginInvokeOnMainThread(async () => await scrollView.ScrollToAsync(0, 0, true));
});
@@ -88,18 +88,6 @@ namespace Billing.Views
SetValue(BalanceProperty, income - spending);
}
- private UIBill WrapBill(Bill b)
- {
- return new UIBill(b)
- {
- Icon = App.Categories.FirstOrDefault(c => c.Id == b.CategoryId)?.Icon ?? BaseModel.ICON_DEFAULT,
- Name = b.Name,
- DateCreation = b.CreateTime,
- Amount = b.Amount,
- Wallet = App.Accounts.FirstOrDefault(a => a.Id == b.WalletId)?.Name
- };
- }
-
private void UpdateBill(UIBill bill)
{
bill.Icon = App.Categories.FirstOrDefault(c => c.Id == bill.Bill.CategoryId)?.Icon ?? BaseModel.ICON_DEFAULT;
@@ -196,7 +184,7 @@ namespace Billing.Views
e.Id = maxId + 1;
App.Bills.Add(e);
var bills = Bills;
- bills.Add(WrapBill(e));
+ bills.Add(Helper.WrapBill(e));
Bills = bills.OrderBy(b => b.DateCreation).ToList();
}
else
diff --git a/Billing.Shared/Views/RankPage.xaml b/Billing.Shared/Views/RankPage.xaml
index 2ddf03d..022c65b 100644
--- a/Billing.Shared/Views/RankPage.xaml
+++ b/Billing.Shared/Views/RankPage.xaml
@@ -15,7 +15,7 @@
-