CreateFullName() public static méthode

public static CreateFullName ( tgDataRequest request ) : string
request Tiraggo.Interfaces.tgDataRequest
Résultat string
Exemple #1
0
        protected static string GetFromStatement(StandardProviderParameters std, tgDynamicQuerySerializable query)
        {
            IDynamicQuerySerializableInternal iQuery = query as IDynamicQuerySerializableInternal;

            string sql = String.Empty;

            if (iQuery.InternalFromQuery == null)
            {
                sql = Shared.CreateFullName(std.request, query);

                if (iQuery.JoinAlias != " ")
                {
                    sql += " " + iQuery.JoinAlias;
                }
            }
            else
            {
                IDynamicQuerySerializableInternal iSubQuery = iQuery.InternalFromQuery as IDynamicQuerySerializableInternal;

                iSubQuery.IsInSubQuery = true;

                sql += "(";
                sql += BuildQuery(std, iQuery.InternalFromQuery);
                sql += ")";

                if (iSubQuery.SubQueryAlias != " ")
                {
                    sql += " AS " + Delimiters.ColumnOpen + iSubQuery.SubQueryAlias + Delimiters.ColumnClose;
                }

                iSubQuery.IsInSubQuery = false;
            }

            return(sql);
        }
Exemple #2
0
        protected static string GetJoinStatement(StandardProviderParameters std, tgDynamicQuerySerializable query)
        {
            string sql = String.Empty;

            IDynamicQuerySerializableInternal iQuery = query as IDynamicQuerySerializableInternal;

            if (iQuery.InternalJoinItems != null)
            {
                foreach (tgJoinItem joinItem in iQuery.InternalJoinItems)
                {
                    tgJoinItem.tgJoinItemData joinData = (tgJoinItem.tgJoinItemData)joinItem;

                    switch (joinData.JoinType)
                    {
                    case tgJoinType.InnerJoin:
                        sql += " INNER JOIN ";
                        break;

                    case tgJoinType.LeftJoin:
                        sql += " LEFT JOIN ";
                        break;

                    case tgJoinType.RightJoin:
                        sql += " RIGHT JOIN ";
                        break;

                    case tgJoinType.FullJoin:
                        sql += " FULL JOIN ";
                        break;
                    }

                    IDynamicQuerySerializableInternal iSubQuery = joinData.Query as IDynamicQuerySerializableInternal;

                    sql += Shared.CreateFullName(std.request, joinData.Query);

                    sql += " " + iSubQuery.JoinAlias + " ON ";

                    sql += GetComparisonStatement(std, query, joinData.WhereItems, String.Empty);
                }
            }

            return(sql);
        }