62,046
社区成员
发帖
与我相关
我的任务
分享
#region 生成导入信息表
if (dbEmptyQty >0 )
{
#region 生成串货信息
if (Convert.ToDecimal(xn.Attributes["Quantity"].Value )>0 )
{
if (i == 0)
{
InsertBatchLine(ref xmlSAPDoc, xmlSAPDocCopy, i, ChuanHuoPiCi, dbEmptyQty, "Y");
xmlSAPDoc.SelectSingleNode("//ZBGY:ItemCode", nsmgr).InnerText = ChuanHuo;
xmlSAPDoc.SelectSingleNode("//ZBGY:PriceAfterVAT", nsmgr).InnerText = xn.Attributes["Price"].Value;
xmlSAPDoc.SelectSingleNode("//ZBGY:Quantity", nsmgr).InnerText = dbEmptyQty.ToString();
xmlSAPDoc.SelectSingleNode("//ZBGY:VatGroup", nsmgr).InnerText = "x0";
xmlSAPDoc.SelectSingleNode("//ZBGY:WarehouseCode", nsmgr).InnerText = m_Depart.Store;
xmlSAPDoc.SelectSingleNode("//ZBGY:U_001", nsmgr).InnerText = xn.Attributes["OrderID"].Value; //订单号
xmlSAPDoc.SelectSingleNode("//ZBGY:U_002", nsmgr).InnerText = sl["U_002"].ToString(); //
xmlSAPDoc.SelectSingleNode("//ZBGY:U_003", nsmgr).InnerText = xn.Attributes["Saler"].Value;
xmlSAPDoc.SelectSingleNode("//ZBGY:U_004", nsmgr).InnerText = sl["U_004"].ToString();
xmlSAPDoc.SelectSingleNode("//ZBGY:U_005", nsmgr).InnerText = xn.Attributes["VIPID"].Value;
xmlSAPDoc.SelectSingleNode("//ZBGY:U_006", nsmgr).InnerText = xn.Attributes["Casher"].Value;
xmlSAPDoc.SelectSingleNode("//ZBGY:U_007", nsmgr).InnerText = xn.Attributes["Class"].Value;
xmlSAPDoc.SelectSingleNode("//ZBGY:U_008", nsmgr).InnerText = xn.Attributes["Item"].Value;
//xmlSAPDoc.SelectSingleNode("//ZBGY:U_009", nsmgr).InnerText = dbEmptyQty.ToString();
F1 = true;
i = i + 1;
}
else
{
xmlNodeList = GetEmptyOrderLineXML(xmlSAPDocCopy);
InsertBatchLine(ref xmlSAPDoc, xmlSAPDocCopy, i, ChuanHuoPiCi, dbEmptyQty, "N");
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:ItemCode", nsmgr).InnerText = ChuanHuo;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:PriceAfterVAT", nsmgr).InnerText = xn.Attributes["Price"].Value;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:Quantity", nsmgr).InnerText = dbEmptyQty.ToString();
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:VatGroup", nsmgr).InnerText = "x0";
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:WarehouseCode", nsmgr).InnerText = m_Depart.Store;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_001", nsmgr).InnerText = xn.Attributes["OrderID"].Value; //订单号
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_002", nsmgr).InnerText = sl["U_002"].ToString(); //
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_003", nsmgr).InnerText = xn.Attributes["Saler"].Value;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_004", nsmgr).InnerText = sl["U_004"].ToString();
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_005", nsmgr).InnerText = xn.Attributes["VIPID"].Value;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_006", nsmgr).InnerText = xn.Attributes["Casher"].Value;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_007", nsmgr).InnerText = xn.Attributes["Class"].Value;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_008", nsmgr).InnerText = xn.Attributes["Item"].Value;
//xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_009", nsmgr).InnerText = dbEmptyQty.ToString();
xmlSAPDoc = DIxmlObj.InsertNodeToXMLDocument(xmlSAPDoc, xmlNodeList.Item(0), "Document_Lines");
i = i + 1;
}
}
else if (Convert.ToDecimal(xn.Attributes["Quantity"].Value )<0)
{
if (m == 0)
{
InsertReturnBatchLine(ref xmlSAPReturns, xmlSAPReturnsCopy, m, ChuanHuoPiCi, dbEmptyQty, "Y");
xmlSAPReturns.SelectSingleNode("//ZBGY:ItemCode", nsmgr1).InnerText = ChuanHuo;
xmlSAPReturns.SelectSingleNode("//ZBGY:PriceAfterVAT", nsmgr1).InnerText = xn.Attributes["Price"].Value;
xmlSAPReturns.SelectSingleNode("//ZBGY:Quantity", nsmgr1).InnerText = dbEmptyQty.ToString();
xmlSAPReturns.SelectSingleNode("//ZBGY:VatGroup", nsmgr1).InnerText = "x0";
xmlSAPReturns.SelectSingleNode("//ZBGY:WarehouseCode", nsmgr1).InnerText = m_Depart.Store;
xmlSAPReturns.SelectSingleNode("//ZBGY:U_001", nsmgr1).InnerText = xn.Attributes["OrderID"].Value; //订单号
xmlSAPReturns.SelectSingleNode("//ZBGY:U_002", nsmgr1).InnerText = sl["U_002"].ToString(); //
xmlSAPReturns.SelectSingleNode("//ZBGY:U_003", nsmgr1).InnerText = xn.Attributes["Saler"].Value;
xmlSAPReturns.SelectSingleNode("//ZBGY:U_004", nsmgr1).InnerText = sl["U_004"].ToString();
xmlSAPReturns.SelectSingleNode("//ZBGY:U_005", nsmgr1).InnerText = xn.Attributes["VIPID"].Value;
xmlSAPReturns.SelectSingleNode("//ZBGY:U_006", nsmgr1).InnerText = xn.Attributes["Casher"].Value;
xmlSAPReturns.SelectSingleNode("//ZBGY:U_007", nsmgr1).InnerText = xn.Attributes["Class"].Value;
xmlSAPReturns.SelectSingleNode("//ZBGY:U_008", nsmgr1).InnerText = xn.Attributes["Item"].Value;
//xmlSAPReturns.SelectSingleNode("//ZBGY:U_009", nsmgr1).InnerText = dbEmptyQty.ToString();
F2 = true;
m = m + 1;
}
else
{
xmlNodeList = GetEmptyReturnOrderLineXML(xmlSAPReturnsCopy);
InsertReturnBatchLine(ref xmlSAPReturns, xmlSAPReturnsCopy, m, ChuanHuoPiCi, dbEmptyQty, "N");
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:ItemCode", nsmgr1).InnerText = ChuanHuo;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:PriceAfterVAT", nsmgr1).InnerText = xn.Attributes["Price"].Value;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:Quantity", nsmgr1).InnerText = dbEmptyQty.ToString();
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:VatGroup", nsmgr1).InnerText = "x0";
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:WarehouseCode", nsmgr1).InnerText = m_Depart.Store;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_001", nsmgr1).InnerText = xn.Attributes["OrderID"].Value; //订单号
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_002", nsmgr1).InnerText = sl["U_002"].ToString(); //
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_003", nsmgr1).InnerText = xn.Attributes["Saler"].Value;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_004", nsmgr1).InnerText = sl["U_004"].ToString();
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_005", nsmgr1).InnerText = xn.Attributes["VIPID"].Value;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_006", nsmgr1).InnerText = xn.Attributes["Casher"].Value;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_007", nsmgr1).InnerText = xn.Attributes["Class"].Value;
xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_008", nsmgr1).InnerText = xn.Attributes["Item"].Value;
//xmlNodeList.Item(0).SelectSingleNode("//ZBGY:U_009", nsmgr1).InnerText = dbEmptyQty.ToString();
xmlSAPReturns = DIxmlObj.InsertNodeToXMLDocument(xmlSAPReturns, xmlNodeList.Item(0), "Document_Lines");
m = m + 1;
}