private void dgv2_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int i = e.RowIndex; string sql = ""; DataGridViewCell dgc = dgv2.CurrentCell; decimal iTaxUnitPrice = 0; decimal iDisRate = 0; if (dgc.OwningColumn.Name == "ZXSPBM") { frmQueryYP HW = new frmQueryYP(); //frmQueryHW.strmdcode = mdcode; HW.ShowDialog(); if (frmQueryYP.hwID != "") { this.dgv2.Rows[i].Cells["xh"].Value = dgv2.Rows.Count + 1; this.dgv2.Rows[i].Cells["ZXSPBM"].Value = frmQueryYP.hwID; this.dgv2.Rows[i].Cells["YQBM"].Value = "ZDYC0001"; sql = @"select c.cComUnitName from inventory inv left join ComputationUnit c on c.cComunitCode =inv.cComunitCode where inv.cInvCode='" + frmQueryYP.hwCode + "'"; this.dgv2.Rows[i].Cells["CGJLDW"].Value = ClsSystem.gnvl(SqlAccess.ExecuteScalar(sql, Program.ConnectionString), ""); } } }
private void btnCus_Click(object sender, EventArgs e) { //frmQueryHW.QueryCondition = businessObject.Rows[para.RowKey].Cells["cHwCode"].Value; frmQueryYP HW = new frmQueryYP(); //frmQueryHW.strmdcode = mdcode; HW.ShowDialog(); if (frmQueryYP.hwID != "") { textBox1.Text = frmQueryYP.hwID; } }