Esempio n. 1
0
		/// <summary>
		/// Set next phrase.
		/// </summary>
		/// <param name="phrase">The next phrase.</param>
		/// <returns>The next phrase.</returns>
		public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase)
		{
			if (phrase is APSqlOrderPhrase || phrase == null)
				return base.SetNext(phrase);

			throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError,
				GetType().Name, phrase.GetType().Name, typeof(APSqlOrderPhrase).Name));
		}
Esempio n. 2
0
        /// <summary>
        /// Set next phrase.
        /// </summary>
        /// <param name="phrase">The next phrase.</param>
        /// <returns>The next phrase.</returns>
        public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase)
        {
            if (phrase is APSqlOrderPhrase || phrase == null)
            {
                return(base.SetNext(phrase));
            }

            throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError,
                                                           GetType().Name, phrase.GetType().Name, typeof(APSqlOrderPhrase).Name));
        }
Esempio n. 3
0
        /// <summary>
        /// Set next phrases.
        /// </summary>
        /// <param name="phrases">The phrases.</param>
        /// <returns>The last phrase.</returns>
        public IAPSqlPhrase SetNext(params IAPSqlPhrase[] phrases)
        {
            IAPSqlPhrase phrase = this;

            foreach (IAPSqlPhrase next in phrases)
            {
                phrase = phrase.SetNext(next);
            }
            return(phrase);
        }
Esempio n. 4
0
        /// <summary>
        /// Set next phrases.
        /// </summary>
        /// <param name="phrases">The IEnumerable phrases.</param>
        /// <returns>The last phrase.</returns>
        public IAPSqlPhrase SetNext(IEnumerable <IAPSqlPhrase> phrases)
        {
            IAPSqlPhrase phrase = this;

            foreach (IAPSqlPhrase next in phrases)
            {
                phrase = phrase.SetNext(next);
            }
            return(phrase);
        }
Esempio n. 5
0
		/// <summary>
		/// Set next phrase.
		/// </summary>
		/// <param name="phrase">The next phrase.</param>
		/// <returns>The next phrase.</returns>
		public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase)
		{
			if (phrase is APSqlWherePhrase || phrase == null)
				return base.SetNext(phrase);

			//string typeName = phrase == null ? "null" : phrase.GetType().Name;
			string typeName = phrase.GetType().Name;
			throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError,
				GetType().Name, typeName, typeof(APSqlWherePhrase).Name));
		}
Esempio n. 6
0
		/// <summary>
		/// Set next phrase.
		/// </summary>
		/// <param name="phrase">The next phrase.</param>
		/// <returns>The next phrase.</returns>
		public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase)
		{
			if (phrase is APSqlSelectPhrase)
				return base.SetNext(phrase);
			else if (phrase == null)
				return base.SetNext(new APSqlSelectPhrase(APSqlNullExpr.Expr));

			string typeName = phrase.GetType().Name;
			throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError,
				GetType().Name, typeName, typeof(APSqlSelectPhrase).Name));
		}
Esempio n. 7
0
        /// <summary>
        /// Set next phrase.
        /// </summary>
        /// <param name="phrase">The next phrase.</param>
        /// <returns>The next phrase.</returns>
        public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase)
        {
            if (phrase is APSqlWherePhrase || phrase == null)
            {
                return(base.SetNext(phrase));
            }

            //string typeName = phrase == null ? "null" : phrase.GetType().Name;
            string typeName = phrase.GetType().Name;

            throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError,
                                                           GetType().Name, typeName, typeof(APSqlWherePhrase).Name));
        }
Esempio n. 8
0
        /// <summary>
        /// Set next phrase.
        /// </summary>
        /// <param name="phrase">The next phrase.</param>
        /// <returns>The next phrase.</returns>
        public override IAPSqlPhrase SetNext(IAPSqlPhrase phrase)
        {
            if (phrase is APSqlSelectPhrase)
            {
                return(base.SetNext(phrase));
            }
            else if (phrase == null)
            {
                return(base.SetNext(new APSqlSelectPhrase(APSqlNullExpr.Expr)));
            }

            throw new APDataException(APResource.GetString(APResource.APData_PhraseNextError,
                                                           GetType().Name, phrase.GetType().Name, typeof(APSqlSelectPhrase).Name));
        }
Esempio n. 9
0
        /// <summary>
        /// Create a new 'OR' condition group.
        /// </summary>
        /// <param name="phrases">The IEnumerable phrases.</param>
        public APSqlConditionOrPhrase(IEnumerable <APSqlWherePhrase> phrases)
        {
            IAPSqlPhrase phrase = null;

            foreach (APSqlWherePhrase next in phrases)
            {
                if (_child == null)
                {
                    phrase = _child = next;
                }
                else
                {
                    phrase = phrase.SetNext(next);
                }
            }
        }
Esempio n. 10
0
		/// <summary>
		/// Set next phrase.
		/// </summary>
		/// <param name="phrase">The next phrase.</param>
		/// <returns>The next phrase.</returns>
		public virtual IAPSqlPhrase SetNext(IAPSqlPhrase phrase)
		{
			_next = phrase;
			return phrase ?? this;
		}
Esempio n. 11
0
		/// <summary>
		/// Set next null.
		/// </summary>
		internal protected virtual void SetNextNull()
		{
			_next = null;
		}
Esempio n. 12
0
 /// <summary>
 /// Set next phrase.
 /// </summary>
 /// <param name="phrase">The next phrase.</param>
 /// <returns>The next phrase.</returns>
 public virtual IAPSqlPhrase SetNext(IAPSqlPhrase phrase)
 {
     _next = phrase;
     return(phrase ?? this);
 }
Esempio n. 13
0
 /// <summary>
 /// Set next null.
 /// </summary>
 internal protected virtual void SetNextNull()
 {
     _next = null;
 }
Esempio n. 14
0
		/// <summary>
		/// Set next phrase.
		/// </summary>
		/// <param name="phrase">The next phrase.</param>
		/// <returns>The next phrase.</returns>
		public IAPSqlPhrase SetNext(IAPSqlPhrase phrase)
		{
			throw new NotImplementedException();
		}
Esempio n. 15
0
 /// <summary>
 /// Set next phrase.
 /// </summary>
 /// <param name="phrase">The next phrase.</param>
 /// <returns>The next phrase.</returns>
 public IAPSqlPhrase SetNext(IAPSqlPhrase phrase)
 {
     throw new NotImplementedException();
 }