private ToolStripMenuItem GetToolStripMenuItem(BaseObject baseObject, SQLCodeType sqlCodeType) { ToolStripMenuItem toolStripMenuItem = new ToolStripMenuItem(); BaseObject b = baseObject.Clone(); b.ID = SQLManager.GetSQLCode(b.ID, sqlCodeType); toolStripMenuItem.Text = b.Name; toolStripMenuItem.Tag = b; return(toolStripMenuItem); }
private int SetFormData() { string tempSql = SQL; if (TranslateValue != null) { #region 需要被翻译的种类。 SQLCodeType[] types = new SQLCodeType[4]; types[0] = SQLCodeType.Tree; types[1] = SQLCodeType.System; types[2] = SQLCodeType.Condition; types[3] = SQLCodeType.Column; #endregion Translating = true; TranslateValue(tempSql, out tempSql, types); Translating = false; } DataSet ds = GetDataSet(tempSql); if (ds == null) { return(-1); } return(frmSelector.InitSelector(this, ds)); }
/// <summary> /// 根据字符串获得该字符串在SQL中的表示方式。 /// </summary> /// <param name="code">字符串。</param> /// <param name="type">Code的的类型。</param> /// <returns>其在SQL中的表示方式。</returns> public static string GetSQLCode(string code, SQLCodeType type) { return("[" + type.ToString() + "-" + code + "]"); }