コード例 #1
0
ファイル: TotalImpl.cs プロジェクト: mathewdenis/core
        /// <summary>
        /// Used to specify HAVING clause to SQL because the WHERE keyword could not be used with aggregate functions.
        /// </summary>
        /// <param name="column">Name of column on which condition need to be applied</param>
        /// <returns>Clause instance object</returns>
        public ITotalClause Having(String column)
        {
            having = new TotalClauseImpl(this);
            having.AddCol(column);

            return(having);
        }
コード例 #2
0
ファイル: TotalImpl.cs プロジェクト: mathewdenis/core
        /// <summary>
        /// Column name of which condition will be specified.
        /// </summary>
        /// <param name="column">Name of column</param>
        /// <returns>Clause instance object</returns>
        public ITotalClause Where(String column)
        {
            where = new TotalClauseImpl(this);
            where.AddCol(column);

            return(where);
        }
コード例 #3
0
ファイル: TotalImpl.cs プロジェクト: mathewdenis/core
        public double Execute()
        {
            String where = "";
            if (this.whereClause != null && this.whereClause.Length > 0)
            {
                where = this.whereClause;
            }
            else
            {
                if (this.where != null)
                {
                    where = this.where.ToString();
                }
            }

            String having = "";

            if (this.havingClause != null && this.havingClause.Length > 0)
            {
                having = this.havingClause;
            }
            else
            {
                if (this.having != null)
                {
                    having = this.having.ToString();
                }
            }

            if (this.columns == null)
            {
                this.columns = new String[] { };
            }

            if (this.orderBy == null)
            {
                this.orderBy = new String[] { };
            }

            if (this.groupBy == null)
            {
                this.groupBy = new String[] { };
            }

            String limit = null;

            if (this.limit != 0)
            {
                limit = this.limit.ToString();
            }


            return(DatabaseHelper.Total(entityDescriptor, column, where, groupBy.ToList().GetEnumerator(), having));
        }
コード例 #4
0
ファイル: TotalImpl.cs プロジェクト: mathewdenis/core
        /// <summary>
        /// Column name of which condition will be specified.
        /// </summary>
        /// <param name="column">Name of column</param>
        /// <returns>Clause instance object</returns>
        public ITotalClause Where(String column)
        {
            where = new TotalClauseImpl(this);
            where.AddCol(column);

            return where;
        }
コード例 #5
0
ファイル: TotalImpl.cs プロジェクト: mathewdenis/core
        /// <summary>
        /// Used to specify HAVING clause to SQL because the WHERE keyword could not be used with aggregate functions.
        /// </summary>
        /// <param name="column">Name of column on which condition need to be applied</param>
        /// <returns>Clause instance object</returns>
        public ITotalClause Having(String column)
        {
            having = new TotalClauseImpl(this);
            having.AddCol(column);

            return having;
        }
コード例 #6
0
ファイル: TotalImpl.cs プロジェクト: mathewdenis/core
        public double Execute()
        {
            String where = "";
            if (this.whereClause != null && this.whereClause.Length > 0)
            {
                where = this.whereClause;
            }
            else
            {
                if (this.where != null)
                {
                    where = this.where.ToString();
                }
            }

            String having = "";
            if (this.havingClause != null && this.havingClause.Length > 0)
            {
                having = this.havingClause;
            }
            else
            {
                if (this.having != null)
                {
                    having = this.having.ToString();
                }
            }

            if (this.columns == null)
            {
                this.columns = new String[] { };
            }

            if (this.orderBy == null)
            {
                this.orderBy = new String[] { };
            }

            if (this.groupBy == null)
            {
                this.groupBy = new String[] { };
            }

            String limit = null;
            if (this.limit != 0)
            {
                limit = this.limit.ToString();
            }

            return DatabaseHelper.Total(entityDescriptor, column, where, groupBy.ToList().GetEnumerator(), having);
        }