コード例 #1
0
        public questStatus List(QueryOptions queryOptions, out ExceptionsListViewModel exceptionsListViewModel)
        {
            // Initialize
            questStatus status = null;

            exceptionsListViewModel = null;


            // List
            QueryResponse queryResponse = null;
            List <Quest.Functional.Logging.ExceptionLog> exceptionLogList = null;
            ExceptionLogsMgr exceptionLogsMgr = new ExceptionLogsMgr(this.UserSession);

            status = exceptionLogsMgr.List(queryOptions, out exceptionLogList, out queryResponse);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Sort
            exceptionLogList.Sort(delegate(Quest.Functional.Logging.ExceptionLog i1, Quest.Functional.Logging.ExceptionLog i2) { return(i2.Created.CompareTo(i1.Created)); });


            // Transfer model.
            // TODO: USE BaseListModeler to xfer queryOptions to QueryOptionsViewModel.
            exceptionsListViewModel = new ExceptionsListViewModel(this.UserSession);
            QueryResponseViewModel queryResponseViewModel = null;

            status = TransferQueryResponse(queryResponse, out queryResponseViewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            exceptionsListViewModel.QueryResponse = queryResponseViewModel;
            foreach (Quest.Functional.Logging.ExceptionLog exceptionLog in exceptionLogList)
            {
                ExceptionLineItemViewModel exceptionLineItemViewModel = new ExceptionLineItemViewModel();
                BufferMgr.TransferBuffer(exceptionLog, exceptionLineItemViewModel);
                exceptionsListViewModel.Items.Add(exceptionLineItemViewModel);
            }
            return(new questStatus(Severity.Success));
        }
コード例 #2
0
        public questStatus Page(out ExceptionsListViewModel exceptionsListViewModel)
        {
            // Initialize
            questStatus status = null;

            exceptionsListViewModel = null;


            // Set up query options.
            // TEMPORARY: OPTIMIZE THIS
            List <SearchField> searchFieldList = new List <SearchField>();

            SearchOptions searchOptions = new SearchOptions();

            searchOptions.SearchFieldList = searchFieldList;

            QueryOptions queryOptions = new QueryOptions(100, 1);

            queryOptions.SearchOptions = searchOptions;
            QueryResponse queryResponse = null;


            // List
            List <Quest.Functional.Logging.ExceptionLog> exceptionLogList = null;
            ExceptionLogsMgr exceptionLogsMgr = new ExceptionLogsMgr(this.UserSession);

            status = exceptionLogsMgr.List(queryOptions, out exceptionLogList, out queryResponse);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Transfer model.
            exceptionsListViewModel = new ExceptionsListViewModel(this.UserSession);
            foreach (Quest.Functional.Logging.ExceptionLog exceptionLog in exceptionLogList)
            {
                ExceptionLineItemViewModel exceptionLineItemViewModel = new ExceptionLineItemViewModel();
                BufferMgr.TransferBuffer(exceptionLog, exceptionLineItemViewModel);
                exceptionsListViewModel.Items.Add(exceptionLineItemViewModel);
            }
            return(new questStatus(Severity.Success));
        }