public String updateSupplierFields(DOXAPI.TreeItemWithDocType SupplierBinder) { string debugStep = "k10-0"; try { SupplierBinder.Title = SupplierName; debugStep = "k10-1"; DOXFields.SetField(SupplierBinder, "Suppliers name", SupplierName); debugStep = "k10-2"; DOXFields.SetField(SupplierBinder, "Address", SupplierAddress); debugStep = "k10-3"; DOXFields.SetField(SupplierBinder, "Purchasing person", SupplierContact); debugStep = "k10-4"; DOXFields.SetField(SupplierBinder, "Phone no", SupplierPhone); debugStep = "k10-5"; DOXFields.SetField(SupplierBinder, "Email address", SupplierEmail); debugStep = "k10-6"; DOXFields.SetField(SupplierBinder, "Search key", SearchKey); debugStep = "k10-7"; return(""); } catch (Exception ex) { return(debugStep + " " + ex.Message); } }
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 static object GetField(DOXAPI.TreeItemWithDocType entity, string fname) { foreach (DOXAPI.Field f in entity.Fields) { if (f.Attr.Name == fname) { return(f.Value); } } return(null); }
public DOXAPI.TreeItemWithDocType asFetchItem() { // Create DOX-Pro object with key DocType DOXAPI.TreeItemWithDocType t = new DOXAPI.TreeItemWithDocType(); t.DocType = flexSupplierBinderType; DOXAPI.Field f = new DOXAPI.Field(); f.Attr = flexSupplierBinder_supplierID; f.Value = SupplierNo; t.Fields = new DOXAPI.Field[1]; t.Fields[0] = f; return(t); }
public DOXAPI.TreeItemWithDocType asFetchItem() { // Create DOX-Pro object with key DocType DOXAPI.TreeItemWithDocType t = new DOXAPI.TreeItemWithDocType(); t.DocType = flexClientBinderType; DOXAPI.Field f = new DOXAPI.Field(); f.Attr = flexClientBinder_customerID; f.Value = FullID; t.Fields = new DOXAPI.Field[1]; t.Fields[0] = f; return(t); }
public DOXAPI.TreeItemWithDocType asFetchItem() { // Create DOX-Pro object with key DocType from local object DOXAPI.TreeItemWithDocType t = new DOXAPI.TreeItemWithDocType(); t.DocType = flexOrder99Type; DOXAPI.Field f = new DOXAPI.Field(); f.Attr = flexOrder99_Order99No; f.Value = Order99No; t.Fields = new DOXAPI.Field[1]; t.Fields[0] = f; return(t); }
public DOXAPI.TreeItemWithDocType asFetchItem() { // Create DOX-Pro object with key DocType from local object DOXAPI.TreeItemWithDocType t = new DOXAPI.TreeItemWithDocType(); t.DocType = flexPackingSlipType; DOXAPI.Field f = new DOXAPI.Field(); f.Attr = flexPackSlip_PackSlipNo; f.Value = FullID; t.Fields = new DOXAPI.Field[1]; t.Fields[0] = f; return(t); }
public static bool SetField(DOXAPI.TreeItemWithDocType entity, string fname, object value) { if (entity.Fields == null) { return(false); } foreach (DOXAPI.Field f in entity.Fields) { if (f.Attr.Name == fname) { f.Value = value; return(true); } } return(false); }
public String updateCustomerFields(DOXAPI.TreeItemWithDocType customerBinder) { string debugStep = "k10-0"; try { customerBinder.Title = ClientName; debugStep = "k10-1"; DOXFields.SetField(customerBinder, "Name", ClientName); debugStep = "k10-2"; DOXFields.SetField(customerBinder, "Address", ClientAddress); debugStep = "k10-3"; DOXFields.SetField(customerBinder, "Project Manager", ProjectManager); debugStep = "k10-4"; DOXFields.SetField(customerBinder, "Controller", Controller); debugStep = "k10-5"; return(""); } catch (Exception ex) { return(debugStep + " " + ex.Message); } }