Пример #1
0
        public DOXAPI.Binder asBinder()
        {
            // Convert local class object to DOX-Pro binder object
            DOXAPI.Binder binder = new DOXAPI.Binder();
            binder.DocType = flexOrder99Type;
            binder.Title   = supplierID + "/" + Order99No;;
            // Create and set binder fileds according to its doc-type
            binder.Fields = new DOXAPI.Field[flexOrder99Type.Attributes.Length];

            for (int i = 0; i < flexOrder99Type.Attributes.Length; i++)
            {
                DOXAPI.Field f = new DOXAPI.Field();
                f.Attr = flexOrder99Type.Attributes[i];
                switch (f.Attr.Name)
                {
                case "Order99No":
                    f.Value = Order99No;
                    break;

                case "SupplierID":
                    f.Value = supplierID;
                    break;

                default:
                    f.Value = null;
                    break;
                }
                binder.Fields[i] = f;
            }
            return(binder);
        }
Пример #2
0
        public DOXAPI.Document asDocument()
        {
            // Convert local class object to DOX-Pro document object
            DOXAPI.Document SupplierInvoiceDoc = new DOXAPI.Document();
            SupplierInvoiceDoc.DocType = SuppInvoiceDocType;
            // Set documents fields according to doc-type
            SupplierInvoiceDoc.Fields = new DOXAPI.Field[SuppInvoiceDocType.Attributes.Length];
            for (int i = 0; i < SupplierInvoiceDoc.Fields.Length; i++)
            {
                DOXAPI.Field f = new DOXAPI.Field();
                f.Attr = SuppInvoiceDocType.Attributes[i];
                System.Diagnostics.EventLog.WriteEntry("Supplier Invoice- as docoument", "f.Attr.Name: " + f.Attr.Name, System.Diagnostics.EventLogEntryType.Information);
                switch (f.Attr.Name)
                {
                case "Invoice No":
                    f.Value = invoiceNo;
                    break;

                case "Supplier No":
                    f.Value = SupplierID;
                    break;

                default:
                    f.Value = null;
                    break;
                }
                SupplierInvoiceDoc.Fields[i] = f;
            }

            SupplierInvoiceDoc.Title    = supplierID + "/" + invoiceNo;
            SupplierInvoiceDoc.FileName = filename;
            return(SupplierInvoiceDoc);
        }
Пример #3
0
        public DOXAPI.Document asDocument()
        {
            // Convert local class object to DOX-Pro document object
            DOXAPI.Document docOrd99 = new DOXAPI.Document();
            docOrd99.DocType = flexOrder99Type;
            // Set documents fields according to doc-type
            docOrd99.Fields = new DOXAPI.Field[flexOrder99Type.Attributes.Length];
            for (int i = 0; i < docOrd99.Fields.Length; i++)
            {
                DOXAPI.Field f = new DOXAPI.Field();
                f.Attr = flexOrder99Type.Attributes[i];
                switch (f.Attr.Name)
                {
                case "Order99No":
                    f.Value = Order99No;
                    break;

                case "Supplier No":
                    f.Value = SupplierID;
                    break;

                default:
                    f.Value = null;
                    break;
                }
                docOrd99.Fields[i] = f;
            }


            docOrd99.Title    = supplierID + "/" + Order99No;
            docOrd99.FileName = filename;
            return(docOrd99);
        }
Пример #4
0
 public static DOXAPI.Field newField(string name, DOXAPI.DocTypeAttribute att, object value)
 {
     DOXAPI.Field f = new DOXAPI.Field();
     f.Attr      = att;
     f.Attr.Name = name;
     f.Value     = value;
     return(f);
 }
Пример #5
0
        public DOXAPI.Document asDocument()
        {
            // Convert local class object to DOX-Pro document object
            DOXAPI.Document docPS = new DOXAPI.Document();
            docPS.DocType = flexPackingSlipType;
            // Set documents fields according to doc-type
            docPS.Fields = new DOXAPI.Field[flexPackingSlipType.Attributes.Length];
            for (int i = 0; i < docPS.Fields.Length; i++)
            {
                DOXAPI.Field f = new DOXAPI.Field();
                f.Attr = flexPackingSlipType.Attributes[i];
                switch (f.Attr.Name)
                {
                case "Packing Slip No":
                    f.Value = FullID;
                    break;

                case "Customer ID":
                    f.Value = Company + CustomerID;
                    break;

                case "Customer Order No":
                    f.Value = CustomerOrderNo;
                    break;

                case "Issue Date":
                    f.Value = IssueDate;
                    break;

                case "Items":
                    if (itemList.Length > 255)
                    {
                        f.Value = ItemList.Substring(0, 255);
                    }
                    else
                    {
                        f.Value = ItemList;
                    }
                    break;

                case "Return Date":
                    f.Value = DateTime.Now;
                    break;

                case "Invoice No":
                    f.Value = "";     // This item is set later
                    break;

                default:
                    f.Value = null;
                    break;
                }
                docPS.Fields[i] = f;
            }
            docPS.Title    = CustomerID + "/" + PackingSlipNo + "/" + DateTime.Now.ToShortDateString();
            docPS.FileName = filename;
            return(docPS);
        }
Пример #6
0
 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);
 }
Пример #7
0
 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);
 }
Пример #8
0
        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);
        }
Пример #9
0
        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);
        }
Пример #10
0
        public DOXAPI.Document asDocument()
        {
            // Convert local class object to DOX-Pro document object
            DOXAPI.Document ShipmentDoc = new DOXAPI.Document();
            ShipmentDoc.DocType = SuppShipmentDocType;
            // Set documents fields according to doc-type
            ShipmentDoc.Fields = new DOXAPI.Field[SuppShipmentDocType.Attributes.Length];
            for (int i = 0; i < ShipmentDoc.Fields.Length; i++)
            {
                DOXAPI.Field f = new DOXAPI.Field();
                f.Attr = SuppShipmentDocType.Attributes[i];
                System.Diagnostics.EventLog.WriteEntry("shipment- as docoument", "f.Attr.Name: " + f.Attr.Name, System.Diagnostics.EventLogEntryType.Information);
                switch (f.Attr.Name)
                {
                case "Shipment Doc No":
                    f.Value = ShippmentNo;
                    break;

                case "Supplier No":
                    f.Value = SupplierID;
                    break;

                //Ayala 13.04.2015
                case "Lot":
                    f.Value = LotNo;
                    break;

                case "Item No":
                    f.Value = Makat;
                    break;

                case "Date":
                    f.Value = DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss");
                    break;

                //End Ayala 13.04.2015
                default:
                    f.Value = null;
                    break;
                }
                ShipmentDoc.Fields[i] = f;
            }

            // ShipmentDoc.Title = supplierID + "/" + ShippmentNo;
            //Ayala 13.04.2015
            ShipmentDoc.Title = filenameWithoutExt;
            //End Ayala 13.04.2015
            ShipmentDoc.FileName = filename;
            return(ShipmentDoc);
        }
Пример #11
0
        public DOXAPI.Binder asBinder()
        {
            // Convert local class object to DOX-Pro binder object
            DOXAPI.Binder binder = new DOXAPI.Binder();
            binder.DocType = flexSupplierBinderType;
            binder.Title   = SupplierName;
            // Create and set binder fileds according to its doc-type
            binder.Fields = new DOXAPI.Field[flexSupplierBinderType.Attributes.Length];

            for (int i = 0; i < flexSupplierBinderType.Attributes.Length; i++)
            {
                DOXAPI.Field f = new DOXAPI.Field();
                f.Attr = flexSupplierBinderType.Attributes[i];
                switch (f.Attr.Name)
                {
                case "Supplier No":
                    f.Value = supplierNo;
                    break;

                case "Name":
                    f.Value = supplierName;
                    break;

                case "Address":
                    f.Value = supplierAddress;
                    break;

                case "Purchasing Person":
                    f.Value = purchasingPerson;
                    break;

                case "Contact":
                    f.Value = supplierContact;
                    break;

                default:
                    f.Value = null;
                    break;
                }
                binder.Fields[i] = f;
            }
            return(binder);
        }
Пример #12
0
        public DOXAPI.Binder asBinder()
        {
            // Convert local class object to DOX-Pro binder object
            DOXAPI.Binder binder = new DOXAPI.Binder();
            binder.DocType = flexClientBinderType;
            binder.Title   = clientName;
            // Create and set binder fileds according to its doc-type
            binder.Fields = new DOXAPI.Field[flexClientBinderType.Attributes.Length];

            for (int i = 0; i < flexClientBinderType.Attributes.Length; i++)
            {
                DOXAPI.Field f = new DOXAPI.Field();
                f.Attr = flexClientBinderType.Attributes[i];
                switch (f.Attr.Name)
                {
                case "Customer ID":
                    f.Value = FullID;
                    break;

                case "Name":
                    f.Value = ClientName;
                    break;

                case "Address":
                    f.Value = ClientAddress;
                    break;

                case "Project Manager":
                    f.Value = ProjectManager;
                    break;

                case "Controller":
                    f.Value = Controller;
                    break;

                default:
                    f.Value = null;
                    break;
                }
                binder.Fields[i] = f;
            }
            return(binder);
        }
Пример #13
0
        public DOXAPI.Document asDocument(string customerID, string customerName, string filename)
        {
            // Convert local class object to DOX-Pro document object
            DOXAPI.Document docInv = new DOXAPI.Document();
            docInv.DocType = flexInvoiceType;
            // Set documents fields according to doc-type
            docInv.Fields = new DOXAPI.Field[flexInvoiceType.Attributes.Length];
            for (int i = 0; i < docInv.Fields.Length; i++)
            {
                DOXAPI.Field f = new DOXAPI.Field();
                f.Attr = flexInvoiceType.Attributes[i];
                switch (f.Attr.Name)
                {
                case "Customer ID":
                    f.Value = customerID;
                    break;

                case "Invoice No":
                    f.Value = company + InvoiceNo;
                    break;

                case "Packing Slips":
                    f.Value = removeDuplicates(PackingSlips);
                    break;

                case "Issue Date":
                    f.Value = IssueDate;
                    break;

                default:
                    f.Value = null;
                    break;
                }
                docInv.Fields[i] = f;
            }
            docInv.Title    = InvoiceNo + "/" + IssueDate.ToShortDateString();
            docInv.FileName = filename;
            return(docInv);
        }