private void btnStructInput_Click(object sender, EventArgs e) { FormGoodsSelect frm = new FormGoodsSelect(m_serviceStatement.GetAssemblyInfo()); if (frm.ShowDialog() == DialogResult.OK) { List <View_BASE_BomStruct> listTemp = m_serviceBOMInfo.GetBOMList_Design(frm.GoodsInfo.序号); string goodsCode = dataGridViewParent.CurrentRow.Cells["父级图号_2"].Value.ToString(); int goodsID = Convert.ToInt32(dataGridViewParent.CurrentRow.Cells["父级物品ID_2"].Value); foreach (View_BASE_BomStruct item in listTemp) { View_Business_Base_BomChange_Struct tempLnq = new View_Business_Base_BomChange_Struct(); tempLnq.单据号 = txtBillNo.Text; tempLnq.父级图号 = goodsCode; tempLnq.父级物品ID = goodsID; tempLnq.规格 = item.Spec; tempLnq.基数 = item.Usage; tempLnq.图号型号 = item.GoodsCode; tempLnq.物品ID = item.GoodsID; tempLnq.物品名称 = item.GoodsName; m_listStruct.Add(tempLnq); } List <View_Business_Base_BomChange_Struct> lstTemp = SingleParentGoodsStruct(goodsID); foreach (View_Business_Base_BomChange_Struct item in lstTemp) { dataGridViewStruct.Rows.Add(new object[] { item.单据号, item.父级图号, item.父级物品ID, item.物品ID, item.图号型号, item.物品名称, item.规格, item.基数 }); } string strTemp = GetEndSql(); foreach (DataGridViewRow dr in dataGridViewStruct.Rows) { SetStructShowTextBox(dr, strTemp); } userControlDataLocalizer1.Init(dataGridViewStruct, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridViewStruct.Name, BasicInfo.LoginID)); } }
private void 替换件ToolStripMenuItem_Click(object sender, EventArgs e) { string strSql = " select c.序号 as 物品ID, c.图号型号, c.物品名称, c.规格 " + " from F_GoodsAttributeRecord as a inner join F_GoodsReplaceInfo as b " + " on a.AttributeRecordID = b.AttributeRecordID " + " inner join View_F_GoodsPlanCost as c on b.ReplaceGoodsID = c.序号 " + " where a.GoodsID = " + Convert.ToInt32(dataGridView1.CurrentRow.Cells["物品ID"].Value); FormGoodsSelect frm = new FormGoodsSelect(strSql); if (frm.ShowDialog() == DialogResult.OK) { dataGridView1.CurrentRow.Cells["物品ID"].Value = frm.GoodsInfo.序号; dataGridView1.CurrentRow.Cells["图号型号"].Value = frm.GoodsInfo.图号型号; dataGridView1.CurrentRow.Cells["物品名称"].Value = frm.GoodsInfo.物品名称; dataGridView1.CurrentRow.Cells["规格"].Value = frm.GoodsInfo.规格; } }