public FrmAddParameter(HIS.Report_BLL.Paramater currParameter) { InitializeComponent(); _currParameter = currParameter; cbParaNames.Items.Add(_currParameter.PARAMETER); cbParaNames.SelectedIndex = 0; txtInOut.Text = _currParameter.PARAMETER_TYPE; txtParamLength.Text = _currParameter.DATALENGTH.ToString(); txtParamter_cn.Text = _currParameter.PARAMETER_CN; txtParaType.Text = _currParameter.PARAMDATATYPE.ToString(); }
private void GetParamter() { if (isAdd) { if (_currParameter == null) { _currParameter = new HIS.Report_BLL.Paramater(); } if (txtParaType.Text.IndexOf("INT", 0) >= 0) { _currParameter.PARAMDATATYPE = 1; } else if (txtParaType.Text.IndexOf("DATE", 0) >= 0 || txtParaType.Text.IndexOf("TIME", 0) >= 0) { _currParameter.PARAMDATATYPE = 2; } else { _currParameter.PARAMDATATYPE = 0; } } else { _currParameter.PARAMDATATYPE = Convert.ToInt32(txtParaType.Text); } _currParameter.PARAMETER = cbParaNames.Text.Trim(); _currParameter.PARAMETER_CN = txtParamter_cn.Text.Trim(); _currParameter.DATALENGTH = txtParamLength.Text.Trim() == "" ? 0 : Convert.ToInt32(txtParamLength.Text); _currParameter.UIC_TYPE = cbParaControl.SelectedIndex; _currParameter.PARAMETER_TYPE = txtInOut.Text.Trim(); if (cbSource.SelectedIndex != -1) { DataRow[] dr = _enum.Select("enumname='" + cbSource.Text.Trim() + "'"); if (dr == null || dr.Length == 0) { return; } //_currParameter.FOREIGNER_FILTER_SQL = dr[0]["remark"].ToString().Trim(); //_currParameter.FOREIGNER_FIELD_CN_NAME = "name"; //_currParameter.FOREIGNER_FIELD_DB_NAM = "id"; if (cbSource.Text.Trim() != "无") { _currParameter.ENUMEID = Convert.ToInt32(cbSource.SelectedValue.ToString()); } else { _currParameter.ENUMEID = 0; } } }
private void btnTest_Click(object sender, EventArgs e) { HIS.Report_BLL.Paramater _parameter = new HIS.Report_BLL.Paramater(); if (sourceSql == "") { MessageBox.Show("数据源SQL不能为空"); return; } try { if (_parameter.TestSQL(sourceSql)) { isRight = true; MessageBox.Show("SQL语句正确!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception err) { MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { FrmEditSource edit = new FrmEditSource(); if (!isAdd) { edit.sourceSql = _currParameter.FOREIGNER_FILTER_SQL; } edit.ShowDialog(); if (edit.isRight) { if (_currParameter == null) { _currParameter = new HIS.Report_BLL.Paramater(); } _currParameter.FOREIGNER_FILTER_SQL = edit.sourceSql; _currParameter.FOREIGNER_FIELD_CN_NAME = "name"; _currParameter.FOREIGNER_FIELD_DB_NAME = "id"; _currParameter.ENUMEID = -1; } }