Beispiel #1
0
        public AuditLogsViewModel(IAuditLogAppService appService)
        {
            IsAdvancedFilter = false;
            filter           = new GetAuditLogsFilter()
            {
                StartDate      = DateTime.Now.AddDays(-30),
                EndDate        = DateTime.Now,
                MaxResultCount = AppConsts.DefaultPageSize
            };
            entityChangeFilter = new GetEntityChangeFilter()
            {
                StartDate      = DateTime.Now.AddDays(-30),
                EndDate        = DateTime.Now,
                MaxResultCount = AppConsts.DefaultPageSize
            };
            this.appService = appService;

            SearchCommand         = new DelegateCommand(Search);
            SearchChangedCommand  = new DelegateCommand(SearchChanged);
            ViewLogCommand        = new DelegateCommand(ViewLog);
            ViewChangedLogCommand = new DelegateCommand(ViewChangedLog);
            AdvancedCommand       = new DelegateCommand(() => { IsAdvancedFilter = !IsAdvancedFilter; });
            logsdataPager         = ContainerLocator.Container.Resolve <IDataPagerService>();

            //绑定分页组件索引改变事件
            logsdataPager.OnPageIndexChangedEventhandler += EntityChangesOnPageIndexChangedEventhandler;
            dataPager.OnPageIndexChangedEventhandler     += AuditLogsOnPageIndexChangedEventhandler;
        }
Beispiel #2
0
 /// <summary>
 /// 获取审计日期数据
 /// </summary>
 /// <returns></returns>
 private async Task GetAuditLogs(GetAuditLogsFilter input)
 {
     await WebRequest.Execute(() => appService.GetAuditLogs(Map <GetAuditLogsInput>(input)),
                              async result =>
     {
         dataPager.SetList(result);
         await Task.CompletedTask;
     });
 }