我已经编写了下面的查询来从实体创建一个 xml,我需要在 .NET 中yyyymmddhhmmss
以字段格式获取日期时间SLOTTINGTIME
,所以我考虑编写一种新方法来获取所需格式的日期时间。
var slottingmessagexml = new XDocument(new XElement("Message",
new XAttribute("ID","SLT"),
new XElement("Record",
new XAttribute("STORENO",slottingmessage.StoreID),
new XAttribute("PICKLOCATION",slottingmessage.PickLocation),
new XAttribute("TPNB",slottingmessage.ProductID),
new XAttribute("SLOTTINGTIME",GetDateTimeInNewFormat(slottingmessage.SlottingDateTime)),
new XAttribute("SLOTTTINGACTION",slottingmessage.SlottingAction))
)
);