/// <summary> /// 显示信息 /// </summary> /// <param name="listRecord">信息列表</param> void ShowInfo(F_GoodsPlanCost goodsInfo, List <F_GoodsAttributeRecord> listRecord) { if (goodsInfo == null) { return; } View_F_GoodsPlanCost goodsView = UniversalFunction.GetGoodsInfo(goodsInfo.ID); txtCode.Tag = m_goodsID; txtCode.Text = goodsView.图号型号; txtName.Text = goodsView.物品名称; txtSpec.Text = goodsView.规格; chbIsDisable.Checked = m_goodsInfo.IsDisable; txtDepot.Text = goodsView.物品类别名称; txtDepot.Tag = goodsView.物品类别; cmbUnit.Text = goodsView.单位; cmbUnit.Tag = goodsView.单位ID; if (listRecord == null) { return; } foreach (F_GoodsAttributeRecord record in listRecord) { if (record.AttributeValue == null) { continue; } F_GoodsAttribute attribute = m_serverGoods.GetGoodsAttirbute(record.AttributeID); CE_GoodsAttributeName attributeName = GlobalObject.GeneralFunction.StringConvertToEnum <CE_GoodsAttributeName>(attribute.AttributeName); bool valuesFlag = false; Boolean.TryParse(record.AttributeValue, out valuesFlag); switch (attributeName) { case CE_GoodsAttributeName.生产耗用: chbProductionUse.Checked = valuesFlag; break; case CE_GoodsAttributeName.防锈期: chbRustLife.Checked = true; numRustLife.Value = Convert.ToDecimal(record.AttributeValue); break; case CE_GoodsAttributeName.保质期: chbShelfLife.Checked = true; break; case CE_GoodsAttributeName.安全库存: chbSafeStock.Checked = true; numSafeStock.Value = Convert.ToDecimal(record.AttributeValue); break; case CE_GoodsAttributeName.最高库存: chbTopStock.Checked = true; numTopStock.Value = Convert.ToDecimal(record.AttributeValue); break; case CE_GoodsAttributeName.毛坯: chbBlank.Checked = valuesFlag; m_lstBlankToProductInfo = m_serverGoods.GetBlankToProductListInfo(record.AttributeRecordID); dataGridViewBlankToProduct.DataSource = new BindingList <View_F_GoodsBlankToProduct>(m_lstBlankToProductInfo); chbBlank_CheckedChanged(null, null); break; case CE_GoodsAttributeName.缺料计算考虑毛坯: chbStarvingBlank.Checked = valuesFlag; break; case CE_GoodsAttributeName.物料价值ABC分类: cmbGoodsValueABC.Text = record.AttributeValue; break; case CE_GoodsAttributeName.技术等级ABC分类: chbGoodsTechnologyABC.Checked = true; cmbGoodsTechnologyABC.Text = record.AttributeValue; break; case CE_GoodsAttributeName.来料须依据检验结果入库: chbNeedDetection.Checked = valuesFlag; break; case CE_GoodsAttributeName.采购件: chbPurchaseGoods.Checked = valuesFlag; break; case CE_GoodsAttributeName.自制件: chbSelfmade.Checked = valuesFlag; break; case CE_GoodsAttributeName.委外加工: chbOutsourceGoods.Checked = valuesFlag; break; case CE_GoodsAttributeName.部件: chbAssemblyUnit.Checked = valuesFlag; break; case CE_GoodsAttributeName.零件: chbPart.Checked = valuesFlag; break; case CE_GoodsAttributeName.配件: chbOption.Checked = valuesFlag; break; case CE_GoodsAttributeName.替换件: chbReplace.Checked = valuesFlag; m_lstReplaceInfo = m_serverGoods.GetReplaceListInfo(record.AttributeRecordID); dataGridViewReplace.DataSource = new BindingList <View_F_GoodsReplaceInfo>(m_lstReplaceInfo); break; case CE_GoodsAttributeName.CVT: chbCVT.Checked = valuesFlag; break; case CE_GoodsAttributeName.TCU: chbTCU.Checked = valuesFlag; break; case CE_GoodsAttributeName.虚拟件: chbVirtualPart.Checked = valuesFlag; break; case CE_GoodsAttributeName.领用上限: break; case CE_GoodsAttributeName.整包发料: chbPackageSending.Checked = valuesFlag; break; case CE_GoodsAttributeName.刀具寿命: num_CutterLife.Value = Convert.ToDecimal(record.AttributeValue); break; case CE_GoodsAttributeName.流水码: chbWaterCode.Checked = valuesFlag; m_lstWaterCode = m_serverGoods.GetWaterCodeListInfo(record.AttributeRecordID); dataGridViewWaterCode.DataSource = new BindingList <F_ProductWaterCode>(m_lstWaterCode); break; case CE_GoodsAttributeName.厂商编码: txtCSCODE.Text = record.AttributeValue == null ? "" : record.AttributeValue.ToString(); break; case CE_GoodsAttributeName.停产: chbIsEol.Checked = valuesFlag; break; case CE_GoodsAttributeName.装箱数: num_PCS.Value = Convert.ToDecimal(record.AttributeValue); break; default: break; } } }