private static void FindInvoice(string company, string inv_no) { string token = null; DOXAPI.DocType flexInvoiceType = null; DOXAPI.ServiceSoapClient dox = new DOXAPI.ServiceSoapClient(); // Initialize web-service token = dox.Login("baanint", "fl3x8aan1n7", "Flex"); if (token == null) { Console.WriteLine("Cannot login to DOXPRO"); return; } Console.WriteLine("Login to DOXPRO succeeded, token is \"{0}\"", token); DOXAPI.DocType[] allTypes = dox.GetAllDocTypes(token); // Get a list of doc-types from DOX-Pro // Find and keep the types used in this program foreach (DOXAPI.DocType dt in allTypes) { if (dt.Name == "Customer Invoice") { flexInvoiceType = dox.GetDocType(token, dt.ID); break; } } if (flexInvoiceType == null) { Console.WriteLine("Cannot obtain invoice DocType"); return; } DOXAPI.SearchField[] fields = new DOXAPI.SearchField[1]; DOXAPI.SearchField field = new DOXAPI.SearchField(); field.FieldName = "Invoice No"; field.SearchType = DOXAPI.SearchTypes.StartWith; field.FieldValue = company + inv_no; fields[0] = field; Console.WriteLine("Searching for Document in DOXPRO..."); DOXAPI.TreeItemWithDocType[] invoices = dox.FindTreeItemWithDocType(token, fields, flexInvoiceType.DocTypeId); foreach (DOXAPI.TreeItemWithDocType ti in invoices) { // Fetch entity from result set DOXAPI.TreeItemWithDocType inv = dox.GetTreeItemWithDocType(token, ti); Console.WriteLine("Get Document ID={0}", inv.ID); DOXAPI.TreeItemWithDocType invFound = dox.GetTreeItemWithDocType(token, inv); DOXAPI.Document doc = invFound as DOXAPI.Document; if (doc != null) { DOXAPI.Document foundDoc = dox.GetDocument(token, doc); Console.WriteLine("FileName: {0}, FileName\"{1}\"", doc.FileName, foundDoc.FileName); } string url = dox.GetDocumentURL(token, inv.ID); Console.WriteLine("ID: {0}, url \"{1}\"", inv.ID, url); } }
public SupplierInvoice(DOXAPI.DocType SupplierInvoiceDocType, DOXAPI.DocTypeAttribute SupplierInvoiceDocNoField) { SuppInvoiceDocType = SupplierInvoiceDocType; SuppInvoiceAtt_SuppInvoiceDocNo = SupplierInvoiceDocNoField; }
public FlexOrder99(DOXAPI.DocType Order99Type, DOXAPI.DocTypeAttribute Order99_Order99No) { flexOrder99Type = Order99Type; flexOrder99_Order99No = Order99_Order99No; }
public FlexSupplier(DOXAPI.DocType supplierBinderType, DOXAPI.DocTypeAttribute SupplierIDField) { flexSupplierBinderType = supplierBinderType; flexSupplierBinder_supplierID = SupplierIDField; }
public FlexInvoice(DOXAPI.DocType invoiceType) { flexInvoiceType = invoiceType; }
public SupplierShipmentDoc(DOXAPI.DocType ShipmentDocType, DOXAPI.DocTypeAttribute ShipmentDocNoField) { SuppShipmentDocType = ShipmentDocType; SuppShipmentAtt_ShipmentDocNo = ShipmentDocNoField; }
public FlexPackingSlip(DOXAPI.DocType packingSlipType, DOXAPI.DocTypeAttribute PSNoType) { flexPackingSlipType = packingSlipType; flexPackSlip_PackSlipNo = PSNoType; }
public FlexCustomer(DOXAPI.DocType customerBinderType, DOXAPI.DocTypeAttribute customerIDField) { flexClientBinderType = customerBinderType; flexClientBinder_customerID = customerIDField; }