Esempio n. 1
0
        public static Request Retrieve(int?requestID, bool skipSecurity)
        {
            if (!requestID.HasValue)
            {
                return(null);
            }

            SelectQuery query;

            if (skipSecurity)
            {
                query = RequestQueryFactory.CreateDefaultQuery().InitialQuery;
            }
            else
            {
                query = RequestQueryFactory.CreateRetreaveQuery().InitialQuery;
            }
            query.PageSettings = new PageSettings {
                PageSize = 1, PageIndex = 1
            };

            query.AddCompare("RequestID", new Parameter(requestID), CompareOperator.Equal);
            query.OrderByTerms.Clear();
            var list = DataPortal.Instance.Retrieve <Request>(query);

            if (list.Count == 0)
            {
                return(null);
            }
            return(list[0]);
        }
Esempio n. 2
0
        public static Request RetrieveToEdit(int?requestID)
        {
            if (!requestID.HasValue)
            {
                return(null);
            }
            var query = RequestQueryFactory.CreateQueryToEdit().InitialQuery;

            query.PageSettings = new PageSettings {
                PageSize = 1, PageIndex = 1
            };
            query.AddCompare("RequestID", new Parameter(requestID), CompareOperator.Equal);
            query.OrderByTerms.Clear();
            var list = DataPortal.Instance.Retrieve <Request>(query);

            if (list.Count == 0)
            {
                return(null);
            }
            return(list[0]);
        }