private void clearPart()
{
try
{
ds.Clear();
if (flag1)
{
bindingSource1.DataSource = ds.Tables[0];
this.bindingNavigator1.BindingSource = bindingSource1;
this.dataGridView1.DataSource = bindingSource1;
}
else
{
flag1 = true;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void btnQuery_Click(object sender, EventArgs e) //查询
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
string strSQL = null;
int rowIndex = e.RowIndex;
if (rowIndex < 0)
{
rowIndex = 0;
}
tempOutBound_no = dataGridView1.Rows[rowIndex].Cells[0].Value.ToString();
//创建一个新连接
DetailClearPart();
Detailds.Clear();
conn = new OracleConnection(ConnectionString);
try
{
strSQL = "SELECT OutBound_no,Spareparts_no,Spareparts_name,TotalNumber,TotalWeight,CK_no,Shelve_no,OutputMode,OutputTime,Class,Sequence,OutBounder_no,DeliveryMan_no,
+ "Other FROM T_BJ_OutBound Where OutBound_no = '" + tempOutBound_no + "' order by OutBound_no";
//创建数据提供者
OracleDataAdapter DataAdapter = new OracleDataAdapter(strSQL, conn);
DataAdapter.Fill(Detailds, "T_BJ_OutInfor");
DataAdapter.Dispose();
bindingSource2.DataSource = Detailds.Tables[0];
this.bindingNavigator2.BindingSource = bindingSource2;
this.dataGridView2.DataSource = bindingSource2;
flag2 = true;
if (Detailds.Tables[0].Rows.Count == 0)
{
MessageBox.Show("没有符合条件的数据!");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
conn.Close();
conn.Dispose();
Detailds.Dispose();
}
}
private void DetailClearPart()
{
try
{
Detailds.Clear();
if (flag3)
{
Detailds.Clear();
this.bindingNavigator2.BindingSource = bindingSource2;
this.dataGridView2.DataSource = bindingSource2;
}
else
{
flag3 = true;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}