예제 #1
0
        public async Task <Framework.Models.DataAccessLayerMessageOfInteger> GetCountOfNameValuePairByCommon(
            Framework.Queries.QuerySystemStringContainsCriteria application
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "GetCountOfNameValuePairByCommon";
            IQueryable <Framework.Models.NameValuePair> _Query = _GetQueryOfNameValuePairByCommon(
                application
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetCountMessageAsync(_Query, currentIndex, pageSize, logMessageKey));
        }
예제 #2
0
        public async Task <Framework.Models.DataAccessLayerMessageOfBoolean> ExistsOfEntityByCommon(
            Framework.Queries.QuerySystemStringContainsCriteria application
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "ExistsOfEntityByCommon";
            IQueryable <Elmah.DataSourceEntities.ElmahApplication> _Query = _GetQueryOfEntityByCommon(
                application
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetExistsMessageAsync(_Query, currentIndex, pageSize, logMessageKey));
        }
예제 #3
0
        public async Task <Framework.Models.DataAccessLayerMessageOfInteger> GetCountOfEntityByIdentifier(
            Framework.Queries.QuerySystemStringEqualsCriteria type
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "GetCountOfEntityByIdentifier";
            IQueryable <Elmah.DataSourceEntities.ElmahType> _Query = _GetQueryOfEntityByIdentifier(
                type
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetCountMessageAsync(_Query, currentIndex, pageSize, logMessageKey));
        }
예제 #4
0
        public async Task <Elmah.DataSourceEntities.ELMAH_Error.DataAccessLayerMessageOfDefaultCollection> GetCollectionOfDefaultByIdentifier(
            Framework.Queries.QuerySystemGuidEqualsCriteria errorId
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "GetCollectionOfDefaultByIdentifier";
            IQueryable <Elmah.DataSourceEntities.ELMAH_Error.Default> _Query = _GetQueryOfDefaultByIdentifier(
                errorId
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetCollectionMessageAsync <
                       Elmah.DataSourceEntities.ELMAH_Error.DataAccessLayerMessageOfDefaultCollection,
                       List <Elmah.DataSourceEntities.ELMAH_Error.Default>,
                       Elmah.DataSourceEntities.ELMAH_Error.Default>(_Query, currentIndex, pageSize, logMessageKey));
        }
예제 #5
0
        public async Task <Elmah.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionElmahHost> GetCollectionOfEntityByIdentifier(
            Framework.Queries.QuerySystemStringEqualsCriteria host
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "GetCollectionOfEntityByIdentifier";
            IQueryable <Elmah.DataSourceEntities.ElmahHost> _Query = _GetQueryOfEntityByIdentifier(
                host
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetCollectionMessageAsync <
                       Elmah.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionElmahHost,
                       List <Elmah.DataSourceEntities.ElmahHost>,
                       Elmah.DataSourceEntities.ElmahHost>(_Query, currentIndex, pageSize, logMessageKey));
        }
        public async Task <Elmah.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionElmahStatusCode> GetCollectionOfEntityByCommon(
            Framework.Queries.QuerySystemStringContainsCriteria name
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "GetCollectionOfEntityByCommon";
            IQueryable <Elmah.DataSourceEntities.ElmahStatusCode> _Query = _GetQueryOfEntityByCommon(
                name
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetCollectionMessageAsync <
                       Elmah.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionElmahStatusCode,
                       List <Elmah.DataSourceEntities.ElmahStatusCode>,
                       Elmah.DataSourceEntities.ElmahStatusCode>(_Query, currentIndex, pageSize, logMessageKey));
        }
예제 #7
0
        public async Task <Elmah.DataSourceEntities.DataAccessLayerMessageOfMapItemCollection> GetMapItems(
            Elmah.EntityContracts.MapItemCategory[] mapItemCategories
            , Framework.Queries.QuerySystemStringContainsCriteria anyText
            , Framework.Queries.QueryGeographyRangeCriteria geographyRange
            , Framework.Queries.QueryGeographyIntersectsCriteria geographyIntersects
            , int currentIndex
            , int pageSize
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection
            )
        {
            var retval = new Elmah.DataSourceEntities.DataAccessLayerMessageOfMapItemCollection();

            retval.DataAccessLayerMessageStatus = Framework.Models.DataAccessLayerMessageStatus.Success;
            retval.QueryPagingResult            = new Framework.Queries.QueryPagingResult();
            retval.QueryPagingResult.PageSize   = pageSize;

            // TODO: Geography throwing: System.ArgumentException: 'When writing a SQL Server geography value, the shell of a polygon must be oriented counter-clockwise. To write polygons without a shell, set SkipGeographyChecks.'
            retval.QueryPagingResult.CurrentIndexOfStartRecord = currentIndex;
            retval.Result = new Elmah.DataSourceEntities.MapItemCollection();

            return(retval);
        }
예제 #8
0
        /// <param name="queryOrderBySettingCollection">query OrderBy setting</param>
        /// <returns>IQueryable&lt;...&gt; of Common</returns>
        internal IQueryable <Elmah.DataSourceEntities.ELMAH_Error.Default> _GetQueryOfDefaultByCommon(
            Framework.Queries.QuerySystemStringEqualsCriteria application
            , Framework.Queries.QuerySystemStringEqualsCriteria host
            , Framework.Queries.QuerySystemStringEqualsCriteria source
            , Framework.Queries.QuerySystemInt32EqualsCriteria statusCode
            , Framework.Queries.QuerySystemStringEqualsCriteria type
            , Framework.Queries.QuerySystemStringEqualsCriteria user
            , Framework.Queries.QuerySystemStringContainsCriteria message
            , Framework.Queries.QuerySystemStringContainsCriteria allXml
            , Framework.Queries.QuerySystemDateTimeRangeCriteria timeUtcRange
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection
            )
        {
            var _ResultFromDataSource =
                (
                    from t in this.LinqContext.ELMAH_Error
                    join ElmahApplication in this.LinqContext.ElmahApplication on t.Application equals ElmahApplication.Application
                    join ElmahHost in this.LinqContext.ElmahHost on t.Host equals ElmahHost.Host
                    join ElmahSource in this.LinqContext.ElmahSource on t.Source equals ElmahSource.Source
                    join ElmahStatusCode in this.LinqContext.ElmahStatusCode on t.StatusCode equals ElmahStatusCode.StatusCode
                    join ElmahType in this.LinqContext.ElmahType on t.Type equals ElmahType.Type
                    join ElmahUser in this.LinqContext.ElmahUser on t.User equals ElmahUser.User
                    where
                    (
                        (
                            (application.IsToCompare == false || application.IsToCompare && ElmahApplication.Application == application.ValueToCompare)
                            &&
                            (host.IsToCompare == false || host.IsToCompare && ElmahHost.Host == host.ValueToCompare)
                            &&
                            (source.IsToCompare == false || source.IsToCompare && ElmahSource.Source == source.ValueToCompare)
                            &&
                            (statusCode.IsToCompare == false || statusCode.IsToCompare && ElmahStatusCode.StatusCode == statusCode.ValueToCompare)
                            &&
                            (type.IsToCompare == false || type.IsToCompare && ElmahType.Type == type.ValueToCompare)
                            &&
                            (user.IsToCompare == false || user.IsToCompare && ElmahUser.User == user.ValueToCompare)
                        )
                        &&
                        (
                            !message.IsToCompare
                            &&
                            !allXml.IsToCompare
                            ||
                            message.IsToCompare && t.Message.Contains(message.ValueToBeContained)
                            ||
                            allXml.IsToCompare && t.AllXml.Contains(allXml.ValueToBeContained)
                        )
                        &&
                        (
                            !timeUtcRange.IsToCompare
                            ||
                            timeUtcRange.IsToCompare && (timeUtcRange.IsToCompareLowerBound == false || timeUtcRange.IsToCompareLowerBound && t.TimeUtc > timeUtcRange.LowerBound) && (timeUtcRange.IsToCompareUpperBound == false || timeUtcRange.IsToCompareUpperBound && t.TimeUtc <= timeUtcRange.UpperBound)
                        )
                    )
                    select new Elmah.DataSourceEntities.ELMAH_Error.Default {
                ElmahApplication_Name = ElmahApplication.Application, ErrorId = t.ErrorId, ElmahHost_Name = ElmahHost.Host, ElmahSource_Name = ElmahSource.Source, ElmahStatusCode_Name = ElmahStatusCode.Name, ElmahType_Name = ElmahType.Type, ElmahUser_Name = ElmahUser.User, Application = t.Application, Host = t.Host, Type = t.Type, Source = t.Source, Message = t.Message, User = t.User, StatusCode = t.StatusCode, TimeUtc = t.TimeUtc, Sequence = t.Sequence, AllXml = t.AllXml
            } into vD2
                    select vD2
                );
            var _retval = _ResultFromDataSource;

            if (queryOrderBySettingCollection == null || queryOrderBySettingCollection.Count == 0)
            {
                return(_retval);
            }
            return(_retval.OrderBy(queryOrderBySettingCollection.GetOrderByExpression()));
        }
        protected static List <Framework.Xaml.ActionForm.ActionItemModel> GetSortActionItems(Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection, ICommand sortCommand)
        {
            var sortActionItems = new List <Framework.Xaml.ActionForm.ActionItemModel>();

            foreach (var queryOrderBySetting in queryOrderBySettingCollection)
            {
                var sortActionItemModel = new Framework.Xaml.ActionForm.SortActionItemModel
                {
                    ActionFormItemType = Framework.Xaml.ActionForm.ActionFormItemTypes.SortCommandItem, //SortCommandItem,
                    Title            = queryOrderBySetting.DisplayName,                                 // some localized text here, e.g. Framework.Resx.UIStringResource. or NTierOnTime.Resx.UIStringResourcePerApp, or NTierOnTime.Resx.UIStringResourcePerEntity
                    FontIconSettings = new Framework.Xaml.FontIconSettings
                    {
                        MasterFontIcon = queryOrderBySetting.FontIcon // Search, open CommonSearchView
                        ,
                        MasterFontIconFamily = queryOrderBySetting.FontIconFamily
                    },
                    QueryOrderBySetting = queryOrderBySetting,
                    Command             = sortCommand,
                };

                sortActionItems.Add(sortActionItemModel);
            }

            return(sortActionItems);
        }