1
0
Fork 0

add - 物料类型子类型添加

nodyang^2
SoulStar 2 months ago
parent 2b88aee176
commit fad3c8ea3e

@ -60,7 +60,15 @@ namespace HighWayIot.Winform.UserControlPages.MaterialConfigPages
/// <param name="e"></param> /// <param name="e"></param>
private void AddMaterialTypeButton_Click(object sender, EventArgs e) 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;
} }
/// <summary> /// <summary>
@ -70,7 +78,21 @@ namespace HighWayIot.Winform.UserControlPages.MaterialConfigPages
/// <param name="e"></param> /// <param name="e"></param>
private void AddMaterialChildTypeButton_Click(object sender, EventArgs e) 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;
} }
/// <summary> /// <summary>

Loading…
Cancel
Save