sc 1 month ago
parent
commit
9e94b03bc4
  1. 2
      Models/DataSource.cs
  2. 2
      NotificationView/MessagePage.xaml.cs
  3. 2
      NotificationView/NoticePage.xaml.cs
  4. 2
      NotificationView/SystemPage.xaml.cs

2
Models/DataSource.cs

@ -93,7 +93,7 @@ namespace SunlightAggregationTerminal.Models
public static List<NotificationItem> GetAllItems()
{
DataSet? data = AppModels.Select("select * from Notification Where Time > '" +
DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd HH:mm:ss.fff") + "'");
DateTime.Now.AddDays(-60).ToString("yyyy-MM-dd HH:mm:ss.fff") + "'");
_NotificationData.Clear();

2
NotificationView/MessagePage.xaml.cs

@ -24,7 +24,7 @@ public partial class MessagePage : ContentPage
MessageItems.Clear();
// 按时间倒序,并只取最新的 50 条
var itemsToShow = allData.OrderByDescending(x => x.Time).Take(50).Where(x => x.Type == MsgType.Message);
var itemsToShow = allData.OrderByDescending(x => x.Time).Take(100).Where(x => x.Type == MsgType.Message);
// 将数据添加到集合中,UI 会自动更新
foreach (var item in itemsToShow)

2
NotificationView/NoticePage.xaml.cs

@ -25,7 +25,7 @@ public partial class NoticePage : ContentPage
NoticeItems.Clear();
// 按时间倒序,并只取最新的 N 条(例如 50 条)
var itemsToShow = allData.OrderByDescending(x => x.Time).Take(50).Where(x => x.Type == MsgType.Notice);
var itemsToShow = allData.OrderByDescending(x => x.Time).Take(100).Where(x => x.Type == MsgType.Notice);
// 将数据添加到集合中,UI 会自动更新
foreach (var item in itemsToShow)

2
NotificationView/SystemPage.xaml.cs

@ -24,7 +24,7 @@ public partial class SystemPage : ContentPage
SystemItems.Clear();
// 按时间倒序,并只取最新的 N 条(例如 50 条)
var itemsToShow = allData.OrderByDescending(x => x.Time).Take(50).Where(x => x.Type == MsgType.System);
var itemsToShow = allData.OrderByDescending(x => x.Time).Take(100).Where(x => x.Type == MsgType.System);
// 将数据添加到集合中,UI 会自动更新
foreach (var item in itemsToShow)

Loading…
Cancel
Save