void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0 && e.ColumnIndex >= 0) { string 退货编号 = dataGridView1.Rows[e.RowIndex].Cells["退货编号"].Value.ToString(); switch (退货申请or退货记录) { case 0: 退货申请 form1 = new 退货申请(mainform, 退货编号); form1.Show(); break; case 1: 退货记录 form2 = new 退货记录(mainform, 退货编号); form2.Show(); break; } } }
private void btn退货记录_Click(object sender, EventArgs e) { SqlDataAdapter da = new SqlDataAdapter("select * from 退货申请 where 状态='未申请'", mySystem.Parameter.conn); DataTable dt = new DataTable(); da.Fill(dt); string ids = mySystem.Other.InputDataGridView.getIDs("", dt, false); try { int id = Convert.ToInt32(ids); string 退货编码 = dt.Select("ID=" + id)[0]["退货编号"].ToString(); 退货记录 form = new 退货记录(mainform, 退货编码); form.Show(); } catch (Exception ee) { } }