コード例 #1
0
        public virtual ActionResult ActivityLogsList(DataSourceRequest command, ActivityLogModel model, string sort, string sortDir)
        {
            DateTime?startDateValue = (model.CreatedOnFrom == null) ? null
                : (DateTime?)model.CreatedOnFrom.Value;

            DateTime?endDateValue = (model.CreatedOnTo == null) ? null
                            : (DateTime?)model.CreatedOnTo.Value.AddDays(1);

            var items = _dqQueService.GetAllActivityLogs(model.USER_NAME, model.FULLNAME, model.BRANCH_CODE, startDateValue, endDateValue,
                                                         command.Page - 1, command.PageSize, string.Format("{0} {1}", sort, sortDir));
            //var logItems = _logger.GetAllLogs(createdOnFromValue, createdToFromValue, model.Message,
            //    logLevel, command.Page - 1, command.PageSize);
            DateTime _today    = DateTime.Now.Date;
            var      gridModel = new DataSourceResult
            {
                Data = items.Select(x => new ActivityLogModel
                {
                    Id            = x.ID,
                    ACTIVITY_ID   = x.ACTIVITY_ID,
                    USER_ID       = x.USER_ID,
                    USER_NAME     = x.USER_NAME,
                    FULLNAME      = x.FULLNAME,
                    ACTIVITY_DESC = x.ACTIVITY_DESC,
                    ACTIVITY_DATE = x.ACTIVITY_DATE,
                    BRANCH_CODE   = x.BRANCH_CODE,
                    BRANCH_NAME   = x.BRANCH_NAME,
                }),
                Total = items.TotalCount
            };

            return(Json(gridModel));
        }
コード例 #2
0
 public async Task OnGetAsync()
 {
     ActivityLogs = await _activityLogService.GetAllActivityLogs();
 }