Beispiel #1
0
        public void Handle()
        {
            var records = RecentCaseRecordManagementService.GetAllRecentRecords();

            if (records == null || records.Count() == 0)
            {
                return;
            }

            RegionHelper.RequestNavigate(Contracts.MainPage.Constants.MainPageDocumentRegion, Contracts.Casing.Constants.RecentCaseRecordsView);
        }
Beispiel #2
0
        private void InitializeGroups()
        {
            RecordGroups.Clear();
            var records = RecentCaseRecordManagementService.GetAllRecentRecords();


            //根据时间段添加group;
            void AddGroup(string groupName, DateTime latestTime, TimeSpan?lastedTime)
            {
                var thisGroupRecords = records.Where(p => p.LastAccessTime <= latestTime &&
                                                     (lastedTime == null || p.LastAccessTime > latestTime - lastedTime.Value)).ToArray();

                if (thisGroupRecords.Length == 0)
                {
                    return;
                }

                var group = new RecentCaseRecordGroupModel {
                    Header = groupName
                };

                foreach (var record in thisGroupRecords)
                {
                    AddRecordModelToGroup(record, group);
                }
                RecordGroups.Add(group);
            }

            AddGroup(
                LanguageService.FindResourceString(Constants.RecentCaseRecordGroupName_Today),
                DateTime.Now.Date.AddDays(1), TimeSpan.FromDays(1)
                );

            AddGroup(
                LanguageService.FindResourceString(Constants.RecentCaseRecordGroupName_Yesterday),
                DateTime.Now.Date,
                TimeSpan.FromDays(1));

            AddGroup(
                LanguageService.FindResourceString(Constants.RecentCaseRecordGroupName_Earlier),
                DateTime.Now.Date.AddDays(-1),
                null);
        }