public static void setParametersAux(cConnect connect, cReportConnect rptConnect) { rptConnect.getColumns().clear(); rptConnect.getParameters().clear(); for (int i = 0; i < connect.getColumnsInfo().count(); i++) { CSConnect.cColumnInfo colInfo = connect.getColumnsInfo().item(i); CSReportDll.cColumnInfo rptColInfo = new CSReportDll.cColumnInfo(); rptColInfo.setName(colInfo.getName()); rptColInfo.setPosition(colInfo.getPosition()); rptColInfo.setColumnType(colInfo.getColumnType()); rptConnect.getColumns().add(rptColInfo, ""); } for (int i = 0; i < connect.getParameters().count(); i++) { CSConnect.cParameter parameter = connect.getParameters().item(i); CSReportDll.cParameter rptParameter = new CSReportDll.cParameter(); rptParameter.setName(parameter.getName()); rptParameter.setPosition(parameter.getPosition()); rptParameter.setColumnType(parameter.getColumnType()); rptParameter.setValue(parameter.getValue()); rptConnect.getParameters().add(rptParameter, ""); } }
private void loadParameters() { int top = 20; m_texts = new TextBox[m_parameters.count()]; for (int j = 0; j < m_parameters.count(); j++) { cParameter parameter = m_parameters.getByPosition(j + 1); System.Windows.Forms.Label label = new System.Windows.Forms.Label(); label.AutoSize = true; label.Location = new System.Drawing.Point(30, top); label.Text = parameter.getName(); System.Windows.Forms.TextBox input = new System.Windows.Forms.TextBox(); input.Location = new System.Drawing.Point(150, top); input.Size = new System.Drawing.Size(150, 20); input.Text = parameter.getValue(); input.Tag = parameter.getKey(); switch (parameter.getColumnType()) { case csDataType.CSTDLONGVARCHAR: case csDataType.CSTDCHAR: input.Tag = "T"; break; case csDataType.CSTDBIGINT: case csDataType.CSTDBINARY: case csDataType.CSTDINTEGER: case csDataType.CSTDSMALLINT: case csDataType.CSTDTINYINT: case csDataType.CSTDUNSIGNEDTINYINT: input.Tag = "N"; break; case csDataType.CSTDBOOLEAN: input.Tag = "N"; break; case csDataType.CSTDSINGLE: case csDataType.CSTDDECIMAL: case csDataType.CSTDDOUBLE: input.Tag = "N"; break; case csDataType.CSTDDBTIME: input.Tag = "F"; break; } m_texts[j] = input; pnlParameters.Controls.Add(label); pnlParameters.Controls.Add(input); top += 30; } }