private void ChangeFieldList() { this.cb_Field.Properties.Items.Clear(); this.te_Des.EditValue = ""; if (this.cb_Table.SelectedItem == null) { return; } if (this.cb_Function.SelectedItem == null) { return; } TableListItem _tItem = this.cb_Table.SelectedItem as TableListItem; FunListItem _fItem = this.cb_Function.SelectedItem as FunListItem; this.currentTable = _tItem.Table; this.currentFun = _fItem.Function; this.te_Des.EditValue = this.currentFun.Description; string _pname = this.currentFun.ParamList[0]; string _ptype = this.currentFun.ParamTypeDict[_pname]; switch (_ptype) { case "VARCHAR": case "CHAR": case "VARCHAR2": case "NVARCHAR": case "NVARCHAR2": AddCharField(currentTable); break; case "NUMBER": AddNumField(currentTable); break; case "DATE": AddDateField(currentTable); break; case "ALL": AddALLField(currentTable); break; } }
private void ShowFunction() { if (this.gridView1.RowCount > 0 && this.gridView1.FocusedRowHandle >= 0) { this.xtraScrollableControl1.Controls.Clear(); currentItem = this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as MD_FUNCTION; this.te_Name.EditValue = currentItem.Name; this.te_Des.EditValue = currentItem.Description; this.te_Result.EditValue = currentItem.ResultType; foreach (string _pname in currentItem.ParamList) { string _type = currentItem.ParamTypeDict[_pname]; SinoUC_FunctionParam _pc = new SinoUC_FunctionParam(_pname, _type, this.TableDefine); _pc.Dock = DockStyle.Top; _pc.BringToFront(); this.xtraScrollableControl1.Controls.Add(_pc); } } }
public static string BuildStatisticsField(string TableName, MDModel_Table_Column _column, MD_FUNCTION FunctionDefine) { StringBuilder _sb = new StringBuilder(); _sb.Append("select "); _sb.Append(FunctionDefine.Name); _sb.Append("("); switch (_column.ColumnType) { case QueryColumnType.TableColumn: _sb.Append(string.Format("{0}.{1}", TableName, _column.ColumnName)); break; case QueryColumnType.CalculationColumn: case QueryColumnType.StatisticsColumn: _sb.Append(string.Format("{0}", _column.ColumnAlgorithm)); break; } _sb.Append(string.Format(") from {0} ", TableName)); return(_sb.ToString()); }
public FunListItem(MD_FUNCTION _function) { funDefine = _function; }