private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { try { text编号.Text = dataGridView产品进出库.Rows[e.RowIndex].Cells["编号"].Value.ToString(); text产品编号.Text = dataGridView产品进出库.Rows[e.RowIndex].Cells["产品编号"].Value.ToString(); date发生时间.Value = Convert.ToDateTime(dataGridView产品进出库.Rows[e.RowIndex].Cells["发生时间"].Value); text类型.Text = dataGridView产品进出库.Rows[e.RowIndex].Cells["类型"].Value.ToString(); text相关订单编号.Text = dataGridView产品进出库.Rows[e.RowIndex].Cells["相关订单编号"].Value.ToString(); text相关计划编号.Text = dataGridView产品进出库.Rows[e.RowIndex].Cells["相关计划编号"].Value.ToString(); text不合格产品数.Text = dataGridView产品进出库.Rows[e.RowIndex].Cells["不合格产品数"].Value.ToString(); text当期状态.Text = dataGridView产品进出库.Rows[e.RowIndex].Cells["当前状态"].Value.ToString(); //dataGridView订单 dataGridView产品信息.DataSource = pdm.GetAllProductsByNameEX("产品编号", dataGridView产品进出库.Rows[e.RowIndex].Cells["产品编号"].Value.ToString()); dataGridView产品信息.Update(); dataGridView订单.DataSource = odm.GetOrderBySerial(dataGridView产品进出库.Rows[e.RowIndex].Cells["相关订单编号"].Value.ToString()); dataGridView订单.Update(); //_____________________________________________________ dataGridView完成情况.DataSource = odm.GetOrderFinish(dataGridView产品进出库.Rows[e.RowIndex].Cells["相关订单编号"].Value.ToString()); dataGridView完成情况.Update(); //_____________________________________________________ } catch (Exception ex) { } }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { try { dataGrid产品.DataSource = pm.GetAllProductsByNameEX("产品编号", dataGrid未生产.Rows[e.RowIndex].Cells["产品编号"].Value.ToString()); dataGrid产品原料关系.DataSource = pm.GetMaterialProductRelationByProduct(dataGrid未生产.Rows[e.RowIndex].Cells["产品编号"].Value.ToString()); dataGrid产品.Update(); dataGrid产品原料关系.Update(); textBox产品.Text = dataGrid未生产.Rows[e.RowIndex].Cells["产品编号"].Value.ToString(); textBox领料产品.Text = dataGrid未生产.Rows[e.RowIndex].Cells["产品编号"].Value.ToString(); int pCount = int.Parse(dataGrid未生产.Rows[e.RowIndex].Cells["产品数量"].Value.ToString()); int fCount = int.Parse(dataGrid未生产.Rows[e.RowIndex].Cells["已完成生产数"].Value.ToString()); textBox产品数量.Text = (pCount - fCount).ToString(); textBox订单编号.Text = dataGrid未生产.Rows[e.RowIndex].Cells["编号"].Value.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); }; }
private void dataGridView产品订单数据_CellClick(object sender, DataGridViewCellEventArgs e) { //根据产品编号查询数据 //dataGridView1.Rows[e.RowIndex].Cells["产品编号"].Value.ToString() try { selectedOrderRowIdx = e.RowIndex; var selectedRow = dataGridView产品订单数据.Rows[selectedOrderRowIdx]; var prodResult = pm.GetAllProductsByNameEX("产品编号", selectedRow.Cells["产品编号"].Value.ToString()); dataGridView参数修正.DataSource = prodResult; dataGridView产品原料关系.DataSource = pm.GetMaterialProductRelationByProduct(selectedRow.Cells["产品编号"].Value.ToString()); dataGridView参数修正.Update(); dataGridView产品原料关系.Update(); // label库存数.Text = prodResult.Rows[0]["库存数量"].ToString(); selectedProdCount = int.Parse(selectedRow.Cells["数量"].Value.ToString()); //////// } catch (Exception ex) { MessageBox.Show(ex.Message); }; }