private string GetWhere()
{
string strWhere = "";
strWhere += (tbFYDH.Text.Trim() != "") ? " and FY_DH like '" + tbFYDH.Text.Trim() + "%'" : "";
//strWhere += (cmbZGX.SelectedValue != null) ? " and FY_BM='" + cmbZGX.SelectedValue.ToString() + "%'" : "";
strWhere += (dtpFYRQ1.Checked) ? " and FY_RQ>='" + dtpFYRQ1.Value.ToShortDateString() + "'" : "";
strWhere += (cmbFYLX.SelectedValue != null) ? " and FY_LX = '" + cmbFYLX.SelectedValue.ToString() + "'" : "";
strWhere += (cmbZGDM.SelectedValue != null) ? " and FY_MD_ID = '" + cmbZGDM.SelectedValue.ToString() + "'" : "";
strWhere += (dtpFYRQ2.Checked) ? " and FY_RQ<='" + dtpFYRQ2.Value.ToShortDateString() + "'" : "";
strWhere += (cmbSH.SelectedIndex == -1 || cmbSH.SelectedIndex == 2) ? " and FY_SHF like '%'" : " and FY_SHF like '" + cmbSH.SelectedIndex.ToString() + "%'";
return strWhere;
}
{
string strWhere = "";
strWhere += (tbFYDH.Text.Trim() != "") ? " and FY_DH like '" + tbFYDH.Text.Trim() + "%'" : "";
//strWhere += (cmbZGX.SelectedValue != null) ? " and FY_BM='" + cmbZGX.SelectedValue.ToString() + "%'" : "";
strWhere += (dtpFYRQ1.Checked) ? " and FY_RQ>='" + dtpFYRQ1.Value.ToShortDateString() + "'" : "";
strWhere += (cmbFYLX.SelectedValue != null) ? " and FY_LX = '" + cmbFYLX.SelectedValue.ToString() + "'" : "";
strWhere += (cmbZGDM.SelectedValue != null) ? " and FY_MD_ID = '" + cmbZGDM.SelectedValue.ToString() + "'" : "";
strWhere += (dtpFYRQ2.Checked) ? " and FY_RQ<='" + dtpFYRQ2.Value.ToShortDateString() + "'" : "";
strWhere += (cmbSH.SelectedIndex == -1 || cmbSH.SelectedIndex == 2) ? " and FY_SHF like '%'" : " and FY_SHF like '" + cmbSH.SelectedIndex.ToString() + "%'";
return strWhere;
}