我一直在为朋友制作应用程序,但最近卡住了。出于某种原因,当我尝试测试“itemSubtotalAddRq”时,出现以下错误:
请求 [3]:ItemSubtotalAddRq ItemSubtotalAdd 名称:缺少必需的文件 End of ItemSubtotalAdd
我不确定它是什么,但我知道它是 ItemSubtotalAddRq 行之一,或者我使用 iItemSubtotalAdd 错误。
public void SalesInfoAdd(IMsgSetRequest requestMsgSet)
{
ISalesReceiptAdd salesReceiptAddRq = requestMsgSet.AppendSalesReceiptAddRq();
//IItemSubtotalAdd itemSubtotalAddRq = requestMsgSet.AppendItemSubtotalAddRq();
salesReceiptAddNew = new List<ISalesReceiptLineAdd>();
salesReceiptAddRq.CustomerRef.FullName.SetValue(Form.phoneNumber.Text);
salesReceiptAddRq.IsPending.SetValue(true);
salesReceiptAddRq.IsTaxIncluded.SetValue(false);
salesReceiptAddRq.FOB.SetValue(Form.orderID.Text);
salesReceiptAddNew.Clear();
int cnt = 0;
//while (i < Form.productID.Count)
for (int j = 0; j < Form.productID.Count; j++)
{
salesReceiptAddNew.Add(salesReceiptAddRq.ORSalesReceiptLineAddList.Append().SalesReceiptLineAdd);
salesReceiptAddNew[j].ItemRef.FullName.SetValue(Form.productID[j].ToString());
salesReceiptAddNew[j].ORRatePriceLevel.Rate.SetValue(Convert.ToDouble(Form.pricesList.Items[j]));
salesReceiptAddNew[j].Quantity.SetValue(Form.QBqt[j]);
salesReceiptAddNew[j].Desc.SetValue(Form.productsList.Items[j].ToString().ToUpper() + " -" + " " +
Form.QBsku[j].ToString().ToUpper());
cnt = j;
}
if (Form.DiscountType.Text != "None" || Form.DiscountType.Text != " ")
{
if (Form.productID.Count >= 2)
{
cnt++;
salesReceiptAddNew.Add(salesReceiptAddRq.ORSalesReceiptLineAddList.Append().SalesReceiptLineAdd);
salesReceiptAddNew[cnt].ItemRef.FullName.SetValue("SUBTOTAL");
salesReceiptAddNew[cnt].ORRatePriceLevel.Rate.SetValue(Form.totalOfAllItems);
//itemSubtotalAddRq.Name.SetValue("SUBTOTAL");
//itemSubtotalAddRq.IsActive.SetValue(true);
}
else
itemSubtotalAddRq.IsActive.SetValue(false);
cnt++;
salesReceiptAddNew.Add(salesReceiptAddRq.ORSalesReceiptLineAddList.Append().SalesReceiptLineAdd);
salesReceiptAddNew[cnt].ItemRef.FullName.SetValue(Form.DiscountType.Text);
}
if(Form.freeShipping.Checked == false)
{
cnt++;
salesReceiptAddNew.Add(salesReceiptAddRq.ORSalesReceiptLineAddList.Append().SalesReceiptLineAdd);
salesReceiptAddNew[cnt].ItemRef.FullName.SetValue("SHIPPING");
salesReceiptAddNew[cnt].ORRatePriceLevel.Rate.SetValue(Convert.ToDouble(Form.shipping.Text));
}
IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet);
}
这是我能想到的唯一解决方案,但它仍然不起作用。有什么想法吗?