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

            tablesetsListViewModel = null;


            // List
            QueryResponse queryResponse = null;
            List <Quest.Functional.Logging.TablesetLog> tablesetLogList = null;
            TablesetLogsMgr tablesetLogsMgr = new TablesetLogsMgr(this.UserSession);

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

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


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

            status = TransferQueryResponse(queryResponse, out queryResponseViewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            tablesetsListViewModel.QueryResponse = queryResponseViewModel;
            foreach (Quest.Functional.Logging.TablesetLog tablesetLog in tablesetLogList)
            {
                TablesetLineItemViewModel tablesetLineItemViewModel = new TablesetLineItemViewModel();
                BufferMgr.TransferBuffer(tablesetLog, tablesetLineItemViewModel);
                tablesetsListViewModel.Items.Add(tablesetLineItemViewModel);
            }
            return(new questStatus(Severity.Success));
        }
コード例 #2
0
        public questStatus Page(out TablesetsListViewModel tablesetsListViewModel)
        {
            // Initialize
            questStatus status = null;

            tablesetsListViewModel = 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.TablesetLog> tablesetLogList = null;
            TablesetLogsMgr tablesetLogsMgr = new TablesetLogsMgr(this.UserSession);

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

            // Transfer model.
            tablesetsListViewModel = new TablesetsListViewModel(this.UserSession);
            foreach (Quest.Functional.Logging.TablesetLog tablesetLog in tablesetLogList)
            {
                TablesetLineItemViewModel tablesetLineItemViewModel = new TablesetLineItemViewModel();
                BufferMgr.TransferBuffer(tablesetLog, tablesetLineItemViewModel);
                tablesetsListViewModel.Items.Add(tablesetLineItemViewModel);
            }
            return(new questStatus(Severity.Success));
        }