public string ExportLogidata(int StockOrderID) { string Result = "Export Failed"; Wrapper WS = new Wrapper(); DataSet ds = WS.GetExportData(StockOrderID); string OrderRef = ds.Tables[0].Rows[0]["OrderReference"].ToString(); if (WS.IsTest()) { OrderRef = "Test" + OrderRef; } int OrderID = WS.AddOrderColibri(OrderRef, ds.Tables[0].Rows[0]["CustomerReference"].ToString(), ds.Tables[0].Rows[0]["Name"].ToString(), ds.Tables[0].Rows[0]["Address2"].ToString(), ds.Tables[0].Rows[0]["Address3"].ToString(), ds.Tables[0].Rows[0]["Address4"].ToString(), ds.Tables[0].Rows[0]["PostalCode"].ToString(), ds.Tables[0].Rows.Count.ToString(), ds.Tables[0].Rows[0]["shipperReference"].ToString()); for (int x = 0; x < ds.Tables[0].Rows.Count; x++) { WS.AddColibriParcel(ds.Tables[0].Rows[x]["ItemBarCode"].ToString(), OrderID, int.Parse(ds.Tables[0].Rows[x]["Weight"].ToString())); } Result = "Success"; return(Result); }