public SubQueryTab(SQLFormattingOptions formattingOptions, SubQueryType subQueryType = SubQueryType.Expression) { FormattingOptions = new SQLFormattingOptions(); InitializeComponent(); FormattingOptions.Dispose(); FormattingOptions = formattingOptions; switch (subQueryType) { case SubQueryType.Expression: SelectFormat = formattingOptions.ExpressionSubQueryFormat; break; case SubQueryType.Derived: GroupBoxControl.Header = "Derived tables format options"; TextBlockCaptionUpDown.Text = "Derived tables indent:"; CheckBoxStartSubQueriesNewLine.Content = "Start derived tables from new lines"; TextBlockDescription.Text = "Derived Tables format options\n" + "determine the layout of sub-queries\n" + "used as data sources in the query."; SelectFormat = formattingOptions.DerivedQueryFormat; break; case SubQueryType.Cte: GroupBoxControl.Header = "Common table expressions format options"; TextBlockCaptionUpDown.Text = "CTE indent:"; CheckBoxStartSubQueriesNewLine.Content = "Start CTE from new lines"; TextBlockDescription.Text = "CTE format options\n" + "determine the layout of sub-queries\n" + "used above the main query in the with clause."; SelectFormat = formattingOptions.CTESubQueryFormat; break; } LoadOptions(); }
public SubQueryTab(SQLFormattingOptions formattingOptions, SubQueryType type = SubQueryType.Expression) { InitializeComponent(); FormattingOptions = formattingOptions; if (type == SubQueryType.Expression) { SelectFormat = formattingOptions.ExpressionSubQueryFormat; } else if (type == SubQueryType.Derived) { groupBox1.Text = "Derived tables format options"; label1.Text = "Derived tables indent:"; chBxSubQueriesFromNewLines.Text = "Start derived tables from new lines"; label2.Text = "Derived Tables format options\n" + "determine the layout of sub-queries\n" + "used as data sources in the query."; SelectFormat = formattingOptions.DerivedQueryFormat; } else if (type == SubQueryType.Cte) { groupBox1.Text = "Common table expressions format options"; label1.Text = "CTE indent:"; chBxSubQueriesFromNewLines.Text = "Start CTE from new lines"; label2.Text = "CTE format options\n" + "determine the layout of sub-queries\n" + "used above the main query in the with clause."; SelectFormat = formattingOptions.CTESubQueryFormat; } LoadOptions(); }
/// <summary> /// 查询订阅结果集 /// </summary> /// <param name="userID">用户id</param> /// <param name="subID">末尾订阅ID</param> /// <param name="strWhere">查询条件 用于查询是否订阅条件</param> /// <param name="pageSize">页面大小</param> /// <param name="pageIndex">起始页 默认为1</param> /// <param name="type">YES 已订阅 NO 未订阅</param> /// <returns></returns> public OperationResult <List <SubscriptionEntity> > Subscription_GetList(int userID, int subID, int pageSize, string strWhere, int pageIndex, SubQueryType type) { try { List <SubscriptionEntity> entitys = new List <SubscriptionEntity>(); SqlParameter[] prms = { new SqlParameter("@UserID", userID), new SqlParameter("@SubID", subID), new SqlParameter("@StrWhere", strWhere), new SqlParameter("@PageIndex", pageIndex), new SqlParameter("@PageSize", pageSize), new SqlParameter("@QueryType", (int)type) }; DataTable table = SQlHelper.ExecuteDataset(SQlHelper.MyConnectStr, CommandType.StoredProcedure, "M_Subscription_GetList", prms).Tables[0]; entitys = ConvertDataTable <SubscriptionEntity> .ConvertToList(table); return(new OperationResult <List <SubscriptionEntity> >(OperationResultType.Success, "订阅列表获取完成!", entitys)); } catch (Exception ex) { LogUtil.WriteLog(ex); return(new OperationResult <List <SubscriptionEntity> >(OperationResultType.NoConnection, Description.EnumDescription(OperationResultType.NoConnection))); } }
private bool CurrentSubQueryIs(SubQueryType subQueryType) { return(_subQueryStack.Count != 0 && _subQueryStack.Peek() == subQueryType); }
public static IWhereResult <T, TMe> Where <T, TMe>(this IWhereTarget <T, TMe> fluentBuilder, Action <ISelectResult <T, TMe> > subQuery, SubQueryType type) { fluentBuilder.AppendWhere(); switch (type) { case SubQueryType.Exists: fluentBuilder.QueryBuilder.StringBuilder.AppendAfterSpace("EXISTS"); break; case SubQueryType.NotExists: fluentBuilder.QueryBuilder.StringBuilder.AppendAfterSpace("NOT EXISTS"); break; } fluentBuilder.SubQuery(subQuery); return((IWhereResult <T, TMe>)fluentBuilder); }
private bool CurrentSubQueryIsNot(SubQueryType subQueryType) { return(_subQueryStack.Count == 0 || _subQueryStack.Peek() != subQueryType); }