<?xml version="1.0" encoding="UTF-8"?>
-<InvoiceOrder xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OrderId xmlns="http://24sevenOffice.com/webservices">88844165</OrderId>
<CustomerId xmlns="http://24sevenOffice.com/webservices">7</CustomerId>
<CustomerName xmlns="http://24sevenOffice.com/webservices">Test Company</CustomerName>
-<Addresses xmlns="http://24sevenOffice.com/webservices">
-<Invoice>
<Street>Chestnut Avenue</Street>
<State>Hampshire</State>
<PostalCode>SO53 ABC</PostalCode>
<Name>Test House</Name>
<City>Eastleigh</City>
<Country>UK</Country>
</Invoice>
-<Delivery>
<Street> 56 Test Street</Street>
<PostalCode>BL4 8BE</PostalCode>
<Name>Mrs Hughes</Name>
<City>bolton</City>
<Country>UK</Country>
</Delivery>
</Addresses>
<OrderStatus xmlns="http://24sevenOffice.com/webservices">Invoiced</OrderStatus>
<DateOrdered xmlns="http://24sevenOffice.com/webservices">2015-11-02</DateOrdered>
<PaymentTime>30</PaymentTime>
<IncludeVAT xmlns="http://24sevenOffice.com/webservices">True</IncludeVAT>
-<Currency xmlns="http://24sevenOffice.com/webservices">
<Symbol>LOCAL</Symbol>
</Currency>
<TypeOfSaleId xmlns="http://24sevenOffice.com/webservices">-100</TypeOfSaleId>
-<InvoiceRows xmlns="http://24sevenOffice.com/webservices">
-<InvoiceRow>
<ProductId>H1023</ProductId>
<RowId>1</RowId>
<Price>708.93</Price>
<Name>CADENCE RAD</Name>
<DiscountRate>0.0000</DiscountRate>
<Quantity>1</Quantity>
<Cost>0.0000</Cost>
<InPrice>0.0000</InPrice>
</InvoiceRow>
-<InvoiceRow>
<ProductId>H1206</ProductId>
<RowId>2</RowId>
<Price>188.81</Price>
<Name>DAISY 6 TOWEL WARMER</Name>
<DiscountRate>0.0000</DiscountRate>
<Quantity>1</Quantity>
<Cost>0.0000</Cost>
<InPrice>0.0000</InPrice>
</InvoiceRow>
</InvoiceRows>
</InvoiceOrder>
bool orderidfound = false; //checks whether order already exists
for (int k = 0; k < po.Length; k++)
{
if (po[k].OrderId == Convert.ToInt32(fileref.importList["OrderId"].InnerText)) //if order number is equal
{
orderidfound = true;
}
}
if (orderidfound == false) //ensures duplicate invoice rows are not added
{
newInvoice.InvoiceRows = order.Elements(ns + "InvoiceRows")
.Elements(ns + "InvoiceRow")
.Select(e => new Invoices.InvoiceRow
{
ProductId = e.Element(ns + "ProductId") == null ? 0 : (int)e.Element(ns + "ProductId"),
RowId = e.Element(ns + "RowId") == null ? 0 : (int)e.Element(ns + "RowId"),
Price = e.Element(ns + "Price") == null ? decimal.Zero : (decimal)e.Element(ns + "Price"),
Name = e.Element(ns + "Name") == null ? string.Empty : (string)e.Element(ns + "Name"),
DiscountRate = e.Element(ns + "DiscountRate") == null ? decimal.Zero : (decimal)e.Element(ns + "DiscountRate"),
Quantity = e.Element(ns + "Quantity") == null ? decimal.Zero : (decimal)e.Element(ns + "Quantity"),
Cost = e.Element(ns + "Cost") == null ? decimal.Zero : (decimal)e.Element(ns + "Cost"),
InPrice = e.Element(ns + "InPrice") == null ? decimal.Zero : (decimal)e.Element(ns + "InPrice"),
ChangeState = invState,
})
.ToArray();
}
Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>
Our community of experts have been thoroughly vetted for their expertise and industry experience.