Exemple #1
0
        public questStatus List(QueryOptions queryOptions, out HTTPRequestsListViewModel httpRequestsListViewModel)
        {
            // Initialize
            questStatus status = null;

            httpRequestsListViewModel = null;


            // List
            QueryResponse queryResponse = null;
            List <Quest.Functional.Logging.HTTPRequestLog> httpRequestLogList = null;
            HTTPRequestLogsMgr httpRequestLogsMgr = new HTTPRequestLogsMgr(this.UserSession);

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

            // Sort  if sort not specified.
            if (queryOptions.SortColumns.Columns.Count == 0)
            {
                httpRequestLogList.Sort(delegate(Quest.Functional.Logging.HTTPRequestLog i1, Quest.Functional.Logging.HTTPRequestLog i2) { return(i2.Created.CompareTo(i1.Created)); });
            }


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

            status = TransferQueryResponse(queryResponse, out queryResponseViewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            httpRequestsListViewModel.QueryResponse = queryResponseViewModel;
            foreach (Quest.Functional.Logging.HTTPRequestLog httpRequestLog in httpRequestLogList)
            {
                HTTPRequestLineItemViewModel httpRequestLineItemViewModel = new HTTPRequestLineItemViewModel();
                BufferMgr.TransferBuffer(httpRequestLog, httpRequestLineItemViewModel);
                httpRequestsListViewModel.Items.Add(httpRequestLineItemViewModel);
            }
            return(new questStatus(Severity.Success));
        }
Exemple #2
0
        public questStatus Page(out HTTPRequestsListViewModel httpRequestsListViewModel)
        {
            // Initialize
            questStatus status = null;

            httpRequestsListViewModel = 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.HTTPRequestLog> httpRequestLogList = null;
            HTTPRequestLogsMgr httpRequestLogsMgr = new HTTPRequestLogsMgr(this.UserSession);

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

            // Transfer model.
            httpRequestsListViewModel = new HTTPRequestsListViewModel(this.UserSession);
            foreach (Quest.Functional.Logging.HTTPRequestLog httpRequestLog in httpRequestLogList)
            {
                HTTPRequestLineItemViewModel httpRequestLineItemViewModel = new HTTPRequestLineItemViewModel();
                BufferMgr.TransferBuffer(httpRequestLog, httpRequestLineItemViewModel);
                httpRequestsListViewModel.Items.Add(httpRequestLineItemViewModel);
            }
            return(new questStatus(Severity.Success));
        }