Example #1
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                ILimit limitsCasted = item.As <ILimit>();

                if ((limitsCasted != null))
                {
                    this._parent.Limits.Add(limitsCasted);
                }
                ICompatibleUnit compatibleUnitsCasted = item.As <ICompatibleUnit>();

                if ((compatibleUnitsCasted != null))
                {
                    this._parent.CompatibleUnits.Add(compatibleUnitsCasted);
                }
                IProcedureDataSet procedureDataSetsCasted = item.As <IProcedureDataSet>();

                if ((procedureDataSetsCasted != null))
                {
                    this._parent.ProcedureDataSets.Add(procedureDataSetsCasted);
                }
                IUserAttribute procedureValuesCasted = item.As <IUserAttribute>();

                if ((procedureValuesCasted != null))
                {
                    this._parent.ProcedureValues.Add(procedureValuesCasted);
                }
            }
Example #2
0
 /// <summary>
 /// 指定の子ノードを取り除く
 /// </summary>
 /// <param name="child">子ノード</param>
 public void RemoveChild(IQueryNode child)
 {
     if (this.JoinNodes != null)
     {
         var join = child as IJoin;
         if (join != null)
         {
             this.JoinNodes.Remove(join);
         }
     }
     if (this.WhereNode == child)
     {
         this.WhereNode = null;
     }
     if (this.GroupByNode == child)
     {
         this.GroupByNode = null;
     }
     if (this.OrderByNode == child)
     {
         this.OrderByNode = null;
     }
     if (this.LimitNode == child)
     {
         this.LimitNode = null;
     }
 }
Example #3
0
            /// <summary>
            /// Removes the given item from the collection
            /// </summary>
            /// <returns>True, if the item was removed, otherwise False</returns>
            /// <param name="item">The item that should be removed</param>
            public override bool Remove(IModelElement item)
            {
                ILimit limitItem = item.As <ILimit>();

                if (((limitItem != null) &&
                     this._parent.Limits.Remove(limitItem)))
                {
                    return(true);
                }
                ICompatibleUnit compatibleUnitItem = item.As <ICompatibleUnit>();

                if (((compatibleUnitItem != null) &&
                     this._parent.CompatibleUnits.Remove(compatibleUnitItem)))
                {
                    return(true);
                }
                IProcedureDataSet procedureDataSetItem = item.As <IProcedureDataSet>();

                if (((procedureDataSetItem != null) &&
                     this._parent.ProcedureDataSets.Remove(procedureDataSetItem)))
                {
                    return(true);
                }
                IUserAttribute userAttributeItem = item.As <IUserAttribute>();

                if (((userAttributeItem != null) &&
                     this._parent.ProcedureValues.Remove(userAttributeItem)))
                {
                    return(true);
                }
                return(false);
            }
Example #4
0
        internal Paged(
            ISkip <uint, Query.Filter.Filter> skip,
            ILimit <uint, Query.Filter.Filter> limit)
        {
            this.skip  = skip;
            this.limit = limit;

            this.Data  = new List <TSource>();
            this.Skip  = this.skip.Apply(default);
Example #5
0
 public GetAll(
     ISkip<Filter.Simple.Data.Filter> skip,
     ILimit<Filter.Simple.Data.Filter> limit,
     IOrder<Filter.Simple.Data.Filter, ObjectReference> order)
 {
     _skip = skip;
     _limit = limit;
     _order = order;
 }
 public GetCategoriesByPayee(
     Neo4JConnection connection,
     ILimit <int, Filter> limit,
     ISkip <int, Filter> skip)
 {
     this.connection = connection;
     this.limit      = limit;
     this.skip       = skip;
 }
        public EffectHandle(IEffect effect, IChoice choice, ILimit limit)
        {
            if (effect == null)
                throw new ArgumentNullException("effect");

            this.effect = effect;
            this.choice = choice;
            this.limit = limit;
        }
Example #8
0
 public GetCurrencies(
     Neo4JConnection connection,
     ILimit <int, Filter> limit,
     ISkip <int, Filter> skip)
 {
     this.connection = connection;
     this.limit      = limit;
     this.skip       = skip;
 }
Example #9
0
 public GetInstallments(
     Neo4JConnection connection,
     ILimit <int, Filter> limit,
     ISkip <int, Filter> skip)
 {
     this.connection = connection;
     this.limit      = limit;
     this.skip       = skip;
 }
Example #10
0
 public bool AddLimit(ILimit limit)
 {
     if (limit == null || list.Contains(limit))
     {
         return false;
     }
     list.Add(limit);
     return true;
 }
Example #11
0
 public GetPaymentMethods(
     Neo4JConnection connection,
     ILimit <int, Filter> limit,
     ISkip <int, Filter> skip)
 {
     this.connection = connection;
     this.limit      = limit;
     this.skip       = skip;
 }
Example #12
0
 public From <TColumns> Limit(ILimit limit)
 {
     if (this.LimitNode != null)
     {
         throw new ApplicationException();
     }
     QueryNodeHelper.SwitchParent(limit, this);
     this.LimitNode = limit;
     return(this);
 }
Example #13
0
        public Paged(
            ISkip <int, Query.Filter.Filter> skip,
            ILimit <int, Query.Filter.Filter> limit)
        {
            this.skip  = skip;
            this.limit = limit;

            this.Data  = new List <TSource>();
            this.Skip  = this.skip.Apply(null);
            this.Limit = this.limit.Apply(null);
        }
Example #14
0
 public GetTransactions(
     Neo4JConnection connection,
     ILimit <int, Filter> limit,
     ISkip <int, Filter> skip,
     IEnumerable <IWhere <string, Filter> > where)
 {
     this.connection = connection;
     this.limit      = limit;
     this.skip       = skip;
     this.where      = where.First(item => item.Name == typeof(Where).FullName);
 }
Example #15
0
        public EffectHandle(IEffect effect, IChoice choice, ILimit limit)
        {
            if (effect == null)
            {
                throw new ArgumentNullException("effect");
            }

            this.effect = effect;
            this.choice = choice;
            this.limit  = limit;
        }
Example #16
0
 public GetAll(
     ISkip<Filter.Simple.Data.Filter> skip,
     ILimit<Filter.Simple.Data.Filter> limit,
     IWhere<Filter.Simple.Data.Filter, SimpleExpression> where,
     IOrder<Filter.Simple.Data.Filter, ObjectReference> order,
     IOrderDirection<Filter.Simple.Data.Filter, OrderByDirection> orderDirection)
 {
     _skip = skip;
     _limit = limit;
     _where = where;
     _order = order;
     _orderDirection = orderDirection;
 }
Example #17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SimpleLimiter"/> class.
        /// </summary>
        /// <param name="limit">The limit to use.</param>
        /// <param name="metricsRegistry">The metrics registry.</param>
        public SimpleLimiter(ILimit limit, IMetricsRegistry metricsRegistry)
        {
            this.limit = limit;

            this.operationsExecuted = metricsRegistry.CreateCounter(
                Metrics.Executed.Name,
                Metrics.Executed.Description,
                new[] { Metrics.Labels.LimiterTypeName })
                                      .WithLabels(new[] { Metrics.Labels.LimiterTypeDescription });
            this.operationsLimited = metricsRegistry.CreateCounter(
                Metrics.Limited.Name,
                Metrics.Limited.Description,
                new[] { Metrics.Labels.LimiterTypeName })
                                     .WithLabels(new[] { Metrics.Labels.LimiterTypeDescription });
        }
        public async Task <LimitResponse> GetLimitAsync(string clientId)
        {
            ILimit limit = await _limitsService.GetLimitAsync(clientId);

            return(_mapper.Map <LimitResponse>(limit));
        }
 /// <summary>
 /// Creates a composite limit based on one initial limit
 /// </summary>
 /// <param name="initialLimit">
 /// The initial <see cref="ILimit"/>
 /// </param>
 public AbstractCompositeLimit(ILimit initialLimit) : this()
 {
     AddLimit(initialLimit);
 }
 public GetAllQuery(
     ISkip <int, Filter> skip,
     ILimit <int, Filter> limit)
 {
     this.paged = new Paged <dynamic>(skip, limit);
 }
 /// <summary>
 /// Adds an <see cref="ILimit"/> to the set of limits included in the composition
 /// </summary>
 /// <param name="limit">
 /// The <see cref="ILimit"/> to add
 /// </param>
 public void AddLimit(ILimit limit)
 {
     limits.Add(limit);
 }
Example #22
0
 internal GetAllQuery(ISkip <uint, Filter> skip, ILimit <uint, Filter> limit) => this.paged = new Paged <dynamic>(skip, limit);
Example #23
0
 /// <summary>
 ///     Vyhledávání hotelů
 /// </summary>
 /// <param name="filter">Filtr výsledků</param>
 /// <param name="order">Pořadí výsledků</param>
 /// <param name="limit">Omezení počtu výsledků</param>
 /// <returns>Hotels má vlastnost </returns>
 public Hotels Search(ISearchFilter filter, IOrder order = null, ILimit limit = null)
 {
     return
         (Repository.Search(filter.ToSnippetXmlOrNull() + order.ToSnippetXmlOrNull() + limit.ToSnippetXmlOrNull()));
 }
Example #24
0
 /// <summary>
 ///     Pozor volat alespon s nejakym filtrem jinak error prilis velke data
 ///     Vyhledávání partnerských provizí
 ///     Previo v každé zemi fakturuje provize v jednotné měně, rezervace v jiných měnách jsou do cílové měny přepočítány.
 ///     Proto tato operace vrací na api.previo.cz všechny částky (price, previoBonusAmount, partnerBonusAmount a totalBonusAmount) v CZK a na api.previo.sk v EUR.
 ///     Měnu, ve které byla rezervace zaplacena, zjistíte z elementu account.
 /// </summary>
 /// <param name="filter">Filtr</param>
 /// //todo problem s filtrem from
 /// <param name="order">Pořadí výsledků</param>
 /// //todo neuvedeli se desc radi sestupne ?
 /// <param name="limit">Omezení počtu výsledků</param>
 /// <returns>Partnerské provize</returns>
 public Bonuses SearchBonuses(ISeacrhBonusesFilter filter, IOrder order, ILimit limit)
 {
     return
         (Repository.SearchBonuses(filter.ToSnippetXmlOrNull() + order.ToSnippetXmlOrNull() +
                                   limit.ToSnippetXmlOrNull()));
 }
 /// <summary>
 /// Creates a composite limit based on one initial limit
 /// </summary>
 /// <param name="initialLimit">
 /// The initial <see cref="ILimit"/>
 /// </param>
 public CompositeMaximumLimit(ILimit initialLimit) : base(initialLimit)
 {
     //Do nothing extra
 }