private void button1_Click(object sender, EventArgs e)
{
string Fing_Sql = "";
if (checkBox1.Checked == true)
{
Fing_Sql = " (BlotterDate = '" + (Convert.ToDateTime(dateTimePicker1.Value.ToString())).ToShortDateString() + "')";
}
if (checkBox2.Checked == true)
{
if ((comboBox1.Text.Trim()).Length == 0)
{
MessageBox.Show("请添写查询条件。");
return;
}
if (Fing_Sql != "")
Fing_Sql = Fing_Sql + " AND " + " (BlotterSort = '" + comboBox1.Text + "')";
}
if (Fing_Sql != "")
Fing_Sql = AllSql + " where " + Fing_Sql;
else
Fing_Sql = AllSql;
//用dataGridView1控件显示职工的名称
MyDS_Grid = MyDataClass.getDataSet(Fing_Sql, "tb_DayWordPad");
dataGridView1.DataSource = MyDS_Grid.Tables[0];
checkBox3.Checked = false;
if (MyDS_Grid.Tables[0].Rows.Count < 1) //如果查询结果为空,清除相关文本
{
WordPad_2.Text = "";
WordPad_3.Text = "";
WordPad_4.Text = "";
Word_ID = "";
}
}