private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.CurrentRow == null) { return; } else { txtGoodsCode.Tag = dataGridView1.CurrentRow.Cells["GoodsID"].Value.ToString(); txtGoodsCode.Text = dataGridView1.CurrentRow.Cells["图号型号"].Value.ToString(); txtGoodsName.Text = dataGridView1.CurrentRow.Cells["物品名称"].Value.ToString(); txtGoodsName.Tag = dataGridView1.CurrentRow.Cells["账务库房ID"].Value.ToString(); txtSpec.Text = dataGridView1.CurrentRow.Cells["规格"].Value.ToString(); numCount.Value = Convert.ToDecimal(dataGridView1.CurrentRow.Cells["挂账数量"].Value); lbUnit.Text = dataGridView1.CurrentRow.Cells["单位"].Value.ToString(); txtListRemark.Text = dataGridView1.CurrentRow.Cells["备注"].Value.ToString(); Out_Stock lnqStock = IntegrativeQuery.QuerySecStock(Convert.ToInt32(txtGoodsCode.Tag), txtReceiving.Tag.ToString(), txtGoodsName.Tag.ToString()); lbStock.Text = Convert.ToDecimal(lnqStock == null ? 0 : lnqStock.StockQty).ToString(); } }
private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.CurrentRow == null) { return; } else { numApplyCount.Maximum = 10000000000; txtGoodsCode.Tag = dataGridView1.CurrentRow.Cells["物品ID"].Value.ToString(); txtGoodsCode.Text = dataGridView1.CurrentRow.Cells["图号型号"].Value.ToString(); txtGoodsName.Text = dataGridView1.CurrentRow.Cells["物品名称"].Value.ToString(); txtGoodsName.Tag = dataGridView1.CurrentRow.Cells["账务库房ID"].Value.ToString(); txtSpec.Text = dataGridView1.CurrentRow.Cells["规格"].Value.ToString(); numApplyCount.Value = Convert.ToDecimal(dataGridView1.CurrentRow.Cells["申请数量"].Value); numAuditingCount.Value = Convert.ToDecimal(dataGridView1.CurrentRow.Cells["审核数量"].Value); lbUnit.Text = dataGridView1.CurrentRow.Cells["单位"].Value.ToString(); txtListRemark.Text = dataGridView1.CurrentRow.Cells["备注"].Value.ToString(); Out_Stock lnqStock = IntegrativeQuery.QuerySecStock(Convert.ToInt32(txtGoodsCode.Tag), txtShipments.Tag.ToString(), txtGoodsName.Tag.ToString()); if (lnqStock == null) { numApplyCount.Maximum = 0; } else { numApplyCount.Maximum = Convert.ToDecimal(lnqStock.StockQty); } lbStock.Text = numApplyCount.Maximum.ToString(); } }