/// <summary> /// 载入sql格式内容 /// </summary> /// <param name="sqlFormatContext"></param> public void LoadFromString(string sqlFormatContext) { Clear(); if (string.IsNullOrEmpty(sqlFormatContext)) { return; } _sourceSqlFmt = sqlFormatContext; MatchInfos whereItems = QueryHelper.GetMinMatchData(sqlFormatContext, "<wi=", "/wi>"); if (whereItems.Count <= 0) { return; } foreach (MatchInfo whereitem in whereItems) { WhereItem wi = new WhereItem(); wi.LoadWhereFromString("<wi=" + whereitem.MatchContext + "/wi>"); _whereItems.Add(wi.Name, wi, whereitem.StartIndex); } }
private void frmWhereItem_Load(object sender, EventArgs e) { try { _isTabChanging = true; try { LoadDataSource(); cbxControlType.SelectedIndex = 0; _wi.LoadWhereFromString(_whereItem); txtWhereItemName.Text = _wi.Name; cbxLinkType.Text = _wi.LinkType; rtbWhereContext.Text = _wi.Condition; foreach (InputItem ii in _wi.InputItems.Values) { if (ii.Name.IndexOf("系统_") >= 0) { continue; } tabItems.TabPages.Add(ii.Name, ii.Name); } if (_wi.InputItems.Count > 0) { cbxControlType.Enabled = false; } } finally { _isTabChanging = false; } if (tabItems.TabPages.Count > 0) { tabItems_SelectedIndexChanged(tabItems, e); } } catch (Exception ex) { MsgBox.ShowException(ex, this); } }