diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.cs
index 1763192..1ed6368 100644
--- a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.cs
+++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.cs
@@ -60,7 +60,15 @@ namespace HighWayIot.Winform.UserControlPages.MaterialConfigPages
///
private void AddMaterialTypeButton_Click(object sender, EventArgs e)
{
+ zxMaterialTypeService.InsertMaterialTypeInfo(new ZxMaterialTypeEntity()
+ {
+ MaterialTypeName = MaterialTypeTextBox.Text.Trim(),
+ });
+ zxMaterialTypeList = zxMaterialTypeService.GetMaterialTypeInfos();
+
+ MaterialTypeDataGridView.DataSource = null;
+ MaterialTypeDataGridView.DataSource = zxMaterialTypeList;
}
///
@@ -70,7 +78,21 @@ namespace HighWayIot.Winform.UserControlPages.MaterialConfigPages
///
private void AddMaterialChildTypeButton_Click(object sender, EventArgs e)
{
+ //获取选择的物料类型行
+ int a = MaterialTypeDataGridView.CurrentRow.Index;
+
+ string s = MaterialTypeDataGridView.Rows[a].Cells["MaterialTypeName"].Value.ToString();
+
+ zxMaterialChildTypeService.InsertMaterialChildTypeInfo(new ZxMaterialChildTypeEntity()
+ {
+ MaterialTypeName = s,
+ MaterialChlidTypeName = MaterialChildTypeTextBox.Text.Trim(),
+ });
+
+ zxMaterialChildTypeList = zxMaterialChildTypeService.GetMaterialChildTypeInfos(x => x.MaterialTypeName == s);
+ MaterialChildTypeDataGridView.DataSource = null;
+ MaterialChildTypeDataGridView.DataSource = zxMaterialChildTypeList;
}
///