public questStatus List(QueryOptions queryOptions, out StoredProceduresListViewModel storedProceduresListViewModel)
        {
            // Initialize
            questStatus status = null;

            storedProceduresListViewModel = null;


            // List
            QueryResponse queryResponse = null;
            List <Quest.Functional.Logging.StoredProcedureLog> storedProcedureLogList = null;
            StoredProcedureLogsMgr storedProcedureLogsMgr = new StoredProcedureLogsMgr(this.UserSession);

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

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


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

            status = TransferQueryResponse(queryResponse, out queryResponseViewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            storedProceduresListViewModel.QueryResponse = queryResponseViewModel;
            foreach (Quest.Functional.Logging.StoredProcedureLog storedProcedureLog in storedProcedureLogList)
            {
                StoredProcedureLineItemViewModel storedProcedureLineItemViewModel = new StoredProcedureLineItemViewModel();
                BufferMgr.TransferBuffer(storedProcedureLog, storedProcedureLineItemViewModel);
                storedProceduresListViewModel.Items.Add(storedProcedureLineItemViewModel);
            }
            return(new questStatus(Severity.Success));
        }
        public questStatus Page(out StoredProceduresListViewModel storedProceduresListViewModel)
        {
            // Initialize
            questStatus status = null;

            storedProceduresListViewModel = 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.StoredProcedureLog> storedProcedureLogList = null;
            StoredProcedureLogsMgr storedProcedureLogsMgr = new StoredProcedureLogsMgr(this.UserSession);

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

            // Transfer model.
            storedProceduresListViewModel = new StoredProceduresListViewModel(this.UserSession);
            foreach (Quest.Functional.Logging.StoredProcedureLog storedProcedureLog in storedProcedureLogList)
            {
                StoredProcedureLineItemViewModel storedProcedureLineItemViewModel = new StoredProcedureLineItemViewModel();
                BufferMgr.TransferBuffer(storedProcedureLog, storedProcedureLineItemViewModel);
                storedProceduresListViewModel.Items.Add(storedProcedureLineItemViewModel);
            }
            return(new questStatus(Severity.Success));
        }