修复错误
This commit is contained in:
@@ -42,21 +42,21 @@ namespace U8AppMain
|
||||
colums.Add("创建日期", "VersionEffDate");
|
||||
|
||||
|
||||
var bomLookup = new Dictionary<string, Bom.BomEnity>();
|
||||
var bomLookup = new Dictionary<string, Bom.ufinterface>();
|
||||
|
||||
|
||||
foreach (DataRow row in this.dataTable.Rows)
|
||||
{
|
||||
var bom = new Bom.BomEnity();
|
||||
var bom = new Bom.ufinterface();
|
||||
var comp = new Bom.ComponentBody();
|
||||
|
||||
bom.Version.Version = Convert.ToInt32(row["版本号"]);
|
||||
bom.Version.VersionDesc = row.Field<string>("版本说明");
|
||||
bom.Parent.InvCode = row.Field<string>("母件编码");
|
||||
bom.Version.VersionEffDate = DateTime.Parse(row.Field<string>("版本生效日"));
|
||||
bom.Version.BomType = row.Field<string>("BOM类别");
|
||||
bom.Parent.ParentScrap = decimal.Parse(row["母件损耗率"].ToString());
|
||||
var strKey = $"{bom.Parent.InvCode}-{bom.Version.Version}";
|
||||
bom.Bom.Version.Version = Convert.ToInt32(row["版本号"]);
|
||||
bom.Bom.Version.VersionDesc = row.Field<string>("版本说明");
|
||||
bom.Bom.Parent.InvCode = row.Field<string>("母件编码");
|
||||
bom.Bom.Version.VersionEffDate = DateTime.Parse(row.Field<string>("版本生效日"));
|
||||
bom.Bom.Version.BomType = row.Field<string>("BOM类别");
|
||||
bom.Bom.Parent.ParentScrap = decimal.Parse(row["母件损耗率"].ToString());
|
||||
var strKey = $"{bom.Bom.Parent.InvCode}-{bom.Bom.Version.Version}";
|
||||
if (bomLookup.ContainsKey(strKey))
|
||||
{
|
||||
bom = bomLookup[strKey];
|
||||
@@ -72,7 +72,10 @@ namespace U8AppMain
|
||||
comp.Component.CompScrap = decimal.Parse(row["子件损耗率"].ToString());
|
||||
comp.ComponentOpt.WIPType = row["供应类型"].ToString();
|
||||
|
||||
bom.ComponentBodies.Add(comp);
|
||||
bom.Bom.ComponentBodies.Add(comp);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +87,7 @@ namespace U8AppMain
|
||||
//var bom = new Bom.ufinterface();
|
||||
//bom.Bom.ComponentBodies.Add(new Bom.ComponentBody());
|
||||
//bom.Bom.ComponentBodies.Add(new Bom.ComponentBody());
|
||||
var strbody = XmlHelper.XmlSerialize(bomLookup.Values.ToList(), Encoding.UTF8);
|
||||
var strbody = XmlHelper.XmlSerialize(bomLookup.Values.ToList()[0], Encoding.UTF8);
|
||||
var response = await HttpHelper.Post("", strbody);
|
||||
MessageBox.Show(response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user