/// <summary> /// 获取header节点数据 /// </summary> /// <param name="dEBusinessItem"></param> /// <returns></returns> private DataTable GetHeaderTable(DEBusinessItem dEBusinessItem) { if (dEBusinessItem == null) { return(null); } var dt = BuildHeaderDt(); DataRow row = dt.NewRow(); #region 普通节点,默认ERP列名和PLM列名一致 foreach (DataColumn col in dt.Columns) { var val = dEBusinessItem.GetAttrValue(dEBusinessItem.ClassName, col.ColumnName.ToUpper()); switch (col.ColumnName) { default: row[col] = val == null ? DBNull.Value : val; break; case "CreatePerson": row[col] = PrintUtil.GetUserName(dEBusinessItem.Creator); break; case "ModifyPerson": row[col] = PrintUtil.GetUserName(dEBusinessItem.LatestUpdator); break; case "ModifyDate": row[col] = dEBusinessItem.LatestUpdateTime; break; case "unitgroup_code": row[col] = val == null ? "01" : val; break; case "cPlanMethod": row[col] = val == null ? "L" : val; break; case "cSRPolicy": row[col] = val == null ? "PE" : val; break; case "iSupplyType": row[col] = val == null ? 0 : val; break; } } #endregion dt.Rows.Add(row); return(dt); }