Ejemplo n.º 1
0
        public Get_Quotations(string companyName)
        {
            SageDataObject220.SDOEngine oSDO = new SageDataObject220.SDOEngine();
            SageDataObject220.WorkSpace oWS;
            SageDataObject220.SopData   oSopData;

            String szDataPath;

            //Instantiate WorkSpace
            oWS = (SageDataObject220.WorkSpace)oSDO.Workspaces.Add("Example");

            //Show select company dialog
            szDataPath = oSDO.SelectCompany(companyName);
            string res = "";

            //Try a connection, will throw an exception if it fails
            try
            {
                //Leaving the username and password blank generates a login dialog
                if (szDataPath != string.Empty)
                {
                    //Connect to the Data Files
                    if (oWS.Connect(szDataPath, "Manager", "", "Demodata"))
                    {
                        //Instantiate Objects
                        oSopData = (SageDataObject220.SopData)oWS.CreateObject("SopData");

                        oSopData.MoveFirst();

                        //Find the first record

                        do
                        {
                            //Populate the fields copying from the existing records
                            if (SDOHelper.Read(oSopData, "QUOTE_STATUS").ToString() != "0")
                            {
                                res = SDOHelper.Read(oSopData, "NAME").ToString() + "  ";
                                Console.WriteLine(res);
                            }
                        } while (oSopData.MoveNext());

                        //Disconnect
                        oWS.Disconnect();
                    }
                    else
                    {
                        Console.WriteLine("Failed to connect");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("SDO Generated the Following Error: \n\n" + ex.Message, "Error!");
            }
        }
Ejemplo n.º 2
0
        public Get_Transactions(string companyName)
        {
            //Declare Variables
            SageDataObject220.SDOEngine   oSDO = new SageDataObject220.SDOEngine();
            SageDataObject220.WorkSpace   oWS;
            SageDataObject220.StockRecord oStockRecord;
            SageDataObject220.StockTran   oStockTran;

            String szDataPath;

            //Instantiate WorkSpace
            oWS = (SageDataObject220.WorkSpace)oSDO.Workspaces.Add("Example");

            //Show select company dialog
            szDataPath = oSDO.SelectCompany(companyName);

            //Try a connection, will throw an exception if it fails
            try

            {
                //Leaving the username and password blank generates a login dialog
                oWS.Connect(szDataPath, "Manager", "", "SDO EXAMPLE");

                //Instantiate Stock Record Object
                oStockRecord = (SageDataObject220.StockRecord)oWS.CreateObject("StockRecord");
                var count = oStockRecord.Count;

                //Read the first stock record
                oStockRecord.MoveFirst();

                //Read the first transaction
                oStockTran = (SageDataObject220.StockTran)oStockRecord.Link;
                oStockTran.MoveFirst();
                var isWhile = true;

                //Loop through the transactions
                do
                {
                    //You need to call read before you can return the data
                    oStockTran.Read(oStockTran.RecordNumber);

                    //Display the description
                    Console.WriteLine("Description:  " + (string)SDOHelper.Read(oStockTran, "DETAILS"));
                    isWhile = oStockTran.MoveNext();
                } while (isWhile);

                //Disconnect
                oWS.Disconnect();
            }
            catch (Exception ex)
            {
                Console.WriteLine("SDO Generated the Following Error: \n\n" + ex.Message, "Error!");
            }
        }
Ejemplo n.º 3
0
        public Get_Suppliers(string companyName)
        {
            //const string clientId = "b4b7919a-f51c-4272-9576-dbcccffb8764";
            //const string clientSecret = "eWfc7W7BQXYZ";

            ////This can be any url as long as it is identical to the callback url you specified for your app in the App Center.
            //var callbackUrl = new Uri("http://websocketclient.local");

            //var connector = new Connector(clientId, clientSecret, callbackUrl);
            //var client = new ExactOnlineClient(connector.EndPoint, connector.GetAccessToken);

            //Declare Objects
            SageDataObject220.SDOEngine       oSDO = new SageDataObject220.SDOEngine();
            SageDataObject220.WorkSpace       oWS;
            SageDataObject220.SupplierAddress oSupplierAddress;
            SageDataObject220.PurchaseRecord  oPurchaseRecord;

            //Decalre Variables
            String szDataPath;

            //Create the SDO Engine Object
            oSDO = new SageDataObject220.SDOEngine();

            //Create the Workspace
            oWS = (SageDataObject220.WorkSpace)oSDO.Workspaces.Add("Example");

            //Select company. The select company method taked the program install folder
            //as a parameter
            szDataPath = oSDO.SelectCompany(companyName);
            string res = "";

            if (szDataPath != string.Empty)
            {
                //Connect to the Data Files
                if (oWS.Connect(szDataPath, "Manager", "", "Demodata"))
                {
                    //Create an instance of the PurchaseRecord
                    oPurchaseRecord = (SageDataObject220.PurchaseRecord)oWS.CreateObject("PurchaseRecord");
                    var oPurchaseRecordCount = oPurchaseRecord.Count;
                    //Move to the first PurchaseRecord
                    oPurchaseRecord.MoveFirst();
                    int count = 0;
                    //Loop through the Sales Records

                    do
                    {
                        count++;

                        if (SDOHelper.Read(oPurchaseRecord, "INACTIVE_FLAG").ToString() == "1")
                        {
                            continue;
                        }

                        //res += SDOHelper.Read(oPurchaseRecord, "ACCOUNT_MANAGER") + ";";
                        res += SDOHelper.Read(oPurchaseRecord, "ACCOUNT_ON_HOLD") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "ACCOUNT_OPENED") + ";";
                        res += SDOHelper.Read(oPurchaseRecord, "ACCOUNT_REF") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "ACCOUNT_STATUS") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "ACCOUNT_TYPE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "ANALYSIS_1") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "ANALYSIS_2") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "ANALYSIS_3") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BACS") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BACS_REFERENCE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BALANCE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_ACCOUNT_NAME") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_ACCOUNT_NUMBER") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_ADDITIONAL_REF1") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_ADDITIONAL_REF2") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_ADDITIONAL_REF3") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_ADDRESS_1") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_ADDRESS_2") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_ADDRESS_3") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_ADDRESS_4") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_ADDRESS_5") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_BICSWIFT") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_IBAN") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_NAME") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_ROLL_NUMBER") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BANK_SORT_CODE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BUILD_SOCIETY_REF") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "BUILDING_SOCIETY") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CAN_APPLY_CHARGES") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CONTACT_NAME") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "COUNTRY_CODE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_APP_RECEIVED") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_APPLIED_FOR") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_BF") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_BUREAU") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_CARD_NO") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_CF") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_LIMIT") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH1") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH10") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH11") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH12") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH2") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH3") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH4") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH5") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH6") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH7") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH8") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_MTH9") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_POSITION") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CREDIT_REFERENCE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "CURRENCY") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DATE_CREDIT_APP_RECEIVED") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DECLARATION_VALID_FROM") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DEF_NOM_CODE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DEF_TAX_CODE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DELETED_FLAG") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DEPT_NUMBER") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DISCOUNT_RATE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DISCOUNT_TYPE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DISPUTED") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DONOR_FORENAME") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DONOR_SURNAME") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DONOR_TITLE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "DUNS_NUMBER") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "E_MAIL") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "E_MAIL2") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "E_MAIL3") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "EC_CODE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "EXTERNAL_USAGE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "FAX") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "FIRST_HEADER") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "FIRST_INVOICE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "GIFT_AID_ENABLED") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "HOLD_MAIL") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INACTIVE_FLAG") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_BF") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_CF") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH1") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH10") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH11") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH12") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH2") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH3") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH4") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH5") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH6") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH7") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH8") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "INVOICE_MTH9") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "LAST_CREDIT_REV") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "LAST_HEADER") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "LAST_INV_DATE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "LAST_PAY_DATE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "LAST_UPDATED") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "MEMBER_REMINDER_DATE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "MEMBER_RENEWAL_DATE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "MEMBER_SINCE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "MEMO_OFFSET") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "MEMO_SIZE") + ";";
                        res += SDOHelper.Read(oPurchaseRecord, "MODIFY") + ";";
                        res += SDOHelper.Read(oPurchaseRecord, "NAME") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "NEXT_CREDIT_REV") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "NO_OF_HEADER") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "OVERRIDE_PRODUCT_NOMINAL") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "OVERRIDE_PRODUCT_TAX") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_BF") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_CF") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_DUE_DAYS") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH1") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH10") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH11") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH12") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH2") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH3") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH4") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH5") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH6") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH7") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH8") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_MTH9") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PAYMENT_TYPE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PRICE_LIST_REF") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PRIOR_YEAR") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "PRIORITY_TRADER") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_BF") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_CF") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH1") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH2") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH3") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH4") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH5") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH6") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH7") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH8") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH9") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH10") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH11") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECEIPT_MTH12") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECORD_CREATE_DATE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECORD_DELETED") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "RECORD_MODIFY_DATE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "SALES_REP") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "SEND_INVOICES_ELECTRONICALLY") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "SEND_LETTERS_ELECTRONICALLY") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "SETTLEMENT_DISC_RATE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "SETTLEMENT_DUE_DAYS") + ";";
                        res += SDOHelper.Read(oPurchaseRecord, "TELEPHONE") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "TELEPHONE_2") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "TERMS") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "TERMS_AGREED_FLAG") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "TRADE_CONTACT") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "TURNOVER_MTD") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "TURNOVER_YTD") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "VAT_REG_NUMBER") + ";";
                        //res += SDOHelper.Read(oPurchaseRecord, "WWW") + ";";
                        //res += Environment.NewLine;

                        Console.WriteLine(res);

                        if (count > 2)
                        {
                            break;
                        }

                        //    string accountManagerFullName = SDOHelper.Read(oPurchaseRecord, "ACCOUNT_MANAGER").ToString();
                        //    bool blocked = new bool();
                        //    bool.TryParse(SDOHelper.Read(oPurchaseRecord, "ACCOUNT_ON_HOLD").ToString(), out blocked);
                        //    DateTime created = new DateTime();
                        //    DateTime.TryParse(SDOHelper.Read(oPurchaseRecord, "ACCOUNT_OPENED").ToString(), out created);
                        //    string type = SDOHelper.Read(oPurchaseRecord, "ACCOUNT_TYPE").ToString();

                        //    List<BankAccount> bankAccount = new List<BankAccount>(); //SDOHelper.Read(oPurchaseRecord, "BANK_ACCOUNT_NAME")
                        //    double creditLinePurchase = new double();
                        //    double.TryParse(SDOHelper.Read(oPurchaseRecord, "CREDIT_LIMIT").ToString(), out creditLinePurchase);

                        //    string currency = SDOHelper.Read(oPurchaseRecord, "CURRENCY").ToString();

                        //    Guid gLAccountPurchase = new Guid();
                        //    Guid.TryParse(SDOHelper.Read(oPurchaseRecord, "DEF_NOM_CODE").ToString(), out gLAccountPurchase);

                        //    double discountPurchase = new double();
                        //    double.TryParse(SDOHelper.Read(oPurchaseRecord, "DISCOUNT_RATE").ToString(), out discountPurchase);

                        //    string email = SDOHelper.Read(oPurchaseRecord, "E_MAIL").ToString();
                        //    if (email.IndexOf(';') != -1)
                        //        email = email.Remove(email.IndexOf(';'));

                        //    string fax = SDOHelper.Read(oPurchaseRecord, "FAX").ToString();


                        //    DateTime? endDate = null;
                        //    //DateTime.TryParse(SDOHelper.Read(oSalesRecord, "INACTIVE_FLAG").ToString(), out endDate);
                        //    if (SDOHelper.Read(oPurchaseRecord, "INACTIVE_FLAG").ToString() == "1")
                        //    {
                        //        endDate = new DateTime(2018, 01, 01);
                        //    }

                        //    string name = SDOHelper.Read(oPurchaseRecord, "NAME").ToString();

                        //    string paymentConditionPurchase = SDOHelper.Read(oPurchaseRecord, "PAYMENT_DUE_DAYS").ToString();

                        //    int invoicingMethod = new int();
                        //    int.TryParse(SDOHelper.Read(oPurchaseRecord, "SEND_INVOICES_ELECTRONICALLY").ToString(), out invoicingMethod);

                        //    string vATNumber = SDOHelper.Read(oPurchaseRecord, "VAT_REG_NUMBER").ToString();

                        //    string website = SDOHelper.Read(oPurchaseRecord, "WWW").ToString();


                        //    if (website.IndexOf(" ") != -1)
                        //        website = website.Remove(website.IndexOf(" "));

                        //    //Regex r = new Regex(@"/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/");
                        //    //// Match the regular expression pattern against a text string.
                        //    //Match m = r.Match(website);
                        //    //while (m.Success)
                        //    //{
                        //    //    //do things with your matching text
                        //    //    m = m.NextMatch();
                        //    //}

                        //    Account document = new Account
                        //    {
                        //        AccountManagerFullName = accountManagerFullName,
                        //        Blocked = blocked,
                        //        Created = created,
                        //        Type = type,
                        //        BankAccounts = bankAccount,
                        //        CreditLinePurchase = creditLinePurchase,
                        //        Currency = currency,
                        //        GLAccountPurchase = gLAccountPurchase,
                        //        DiscountPurchase = discountPurchase,
                        //        Email = email,
                        //        Fax = fax,
                        //        //EndDate = endDate,
                        //        Name = name,
                        //        PaymentConditionPurchase = paymentConditionPurchase,
                        //        InvoicingMethod = invoicingMethod,
                        //        Website = website,
                        //        IsSupplier = true
                        //    };

                        //    bool createdClient = client.For<Account>().Insert(ref document);
                    } while (oPurchaseRecord.MoveNext());

                    System.IO.File.WriteAllText(@"E:\Get_Suppliers.csv", res);

                    oWS.Disconnect();
                }
                else
                {
                    Console.WriteLine("Failed to connect");
                }
            }
        }
Ejemplo n.º 4
0
        public Get_Customers(string companyName)
        {
            const string clientId     = "b4b7919a-f51c-4272-9576-dbcccffb8764";
            const string clientSecret = "eWfc7W7BQXYZ";

            //This can be any url as long as it is identical to the callback url you specified for your app in the App Center.
            var callbackUrl = new Uri("http://websocketclient.local");

            var connector = new Connector(clientId, clientSecret, callbackUrl);
            var client    = new ExactOnlineClient(connector.EndPoint, connector.GetAccessToken);

            //Declare Variables
            SageDataObject220.SDOEngine           oSDO = new SageDataObject220.SDOEngine();
            SageDataObject220.WorkSpace           oWS;
            SageDataObject220.SalesRecord         oSalesRecord;
            SageDataObject220.SalesDeliveryRecord oSalesDeliveryRecord;
            SageDataObject220.AgedBalances        oAgedBalances;

            String szDataPath;

            //Instantiate WorkSpace
            oWS = (SageDataObject220.WorkSpace)oSDO.Workspaces.Add("Demodata");

            //Show select company dialog
            szDataPath = oSDO.SelectCompany(companyName);

            //Try a connection, will throw an exception if it fails
            try
            {
                //Leaving the username and password blank generates a login dialog
                oWS.Connect(szDataPath, "Manager", "", "Demodata");
                //Instantiate the Sales Record and Sales Delivery Record objects
                oSalesRecord         = (SageDataObject220.SalesRecord)oWS.CreateObject("SalesRecord");
                oSalesDeliveryRecord = (SageDataObject220.SalesDeliveryRecord)oWS.CreateObject("SalesDeliveryRecord");
                var zxc = oSalesRecord.Count;
                // var zxcs = fffffff.Count;
                //Read the first supplier record
                oSalesRecord.MoveFirst();

                var cvb = oSalesDeliveryRecord.Count;
                oSalesDeliveryRecord.MoveFirst();

                oAgedBalances = (SageDataObject220.AgedBalances)oSalesRecord.GetAgedBalances();

                bool   movNext2;
                string res = "";

                int cou = 0;

                do
                {
                    cou++;
                    //    new Guid("")
                    // Guid.TryParse();
                    res += SDOHelper.Read(oSalesRecord, "ACCOUNT_MANAGER") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ACCOUNT_ON_HOLD") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ACCOUNT_OPENED") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ACCOUNT_REF") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ACCOUNT_STATUS") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ACCOUNT_TYPE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ACCOUNT_TYPE_CUSTOMER") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ACCOUNT_TYPE_DONOR") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ACCOUNT_TYPE_MEMBER") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ADDRESS_1") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ADDRESS_2") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ADDRESS_3") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ADDRESS_4") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ADDRESS_5") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ANALYSIS_1") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ANALYSIS_2") + ";";
                    res += SDOHelper.Read(oSalesRecord, "ANALYSIS_3") + ";";
                    res += SDOHelper.Read(oSalesRecord, "COUNTRY_CODE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_APP_RECEIVED") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_APPLIED_FOR") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_BF") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_BUREAU") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_CARD_NO") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_CF") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_LIMIT") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH1") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH10") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH11") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH12") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH2") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH3") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH4") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH5") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH6") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH7") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH8") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_MTH9") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_POSITION") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CREDIT_REFERENCE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "CURRENCY") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DATE_CREDIT_APP_RECEIVED") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DECLARATION_VALID_FROM") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEF_NOM_CODE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEF_TAX_CODE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEL_ADDRESS_1") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEL_ADDRESS_2") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEL_ADDRESS_3") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEL_ADDRESS_4") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEL_ADDRESS_5") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEL_CONTACT_NAME") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEL_FAX") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEL_NAME") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEL_TELEPHONE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DELETED_FLAG") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DEPT_NUMBER") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DISCOUNT_RATE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DISCOUNT_TYPE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DISPUTED") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DONOR_FORENAME") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DONOR_SURNAME") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DONOR_TITLE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "DUNS_NUMBER") + ";";
                    res += SDOHelper.Read(oSalesRecord, "E_MAIL") + ";";
                    res += SDOHelper.Read(oSalesRecord, "E_MAIL2") + ";";
                    res += SDOHelper.Read(oSalesRecord, "E_MAIL3") + ";";
                    res += SDOHelper.Read(oSalesRecord, "EC_CODE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "EXTERNAL_USAGE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "FAX") + ";";
                    res += SDOHelper.Read(oSalesRecord, "FIRST_HEADER") + ";";
                    res += SDOHelper.Read(oSalesRecord, "FIRST_INVOICE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "GIFT_AID_ENABLED") + ";";
                    res += SDOHelper.Read(oSalesRecord, "HOLD_MAIL") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INACTIVE_FLAG") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_BF") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_CF") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH1") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH2") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH3") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH4") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH5") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH6") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH7") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH8") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH9") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH10") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH11") + ";";
                    res += SDOHelper.Read(oSalesRecord, "INVOICE_MTH12") + ";";
                    res += SDOHelper.Read(oSalesRecord, "LAST_CREDIT_REV") + ";";
                    res += SDOHelper.Read(oSalesRecord, "LAST_HEADER") + ";";
                    res += SDOHelper.Read(oSalesRecord, "LAST_INV_DATE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "LAST_PAY_DATE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "LAST_UPDATED") + ";";
                    res += SDOHelper.Read(oSalesRecord, "MEMBER_REMINDER_DATE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "MEMBER_RENEWAL_DATE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "MEMBER_SINCE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "MEMO_OFFSET") + ";";
                    res += SDOHelper.Read(oSalesRecord, "MEMO_SIZE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "MODIFY") + ";";
                    res += SDOHelper.Read(oSalesRecord, "NAME") + ";";
                    res += SDOHelper.Read(oSalesRecord, "NEXT_CREDIT_REV") + ";";
                    res += SDOHelper.Read(oSalesRecord, "NO_OF_HEADER") + ";";
                    res += SDOHelper.Read(oSalesRecord, "OVERRIDE_PRODUCT_TAX") + ";";
                    res += SDOHelper.Read(oSalesRecord, "OVERRIDE_PRODUCT_NOMINAL") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_BF") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_CF") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_DUE_DAYS") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH1") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH2") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH3") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH4") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH5") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH6") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH7") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH8") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH9") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH10") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH11") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_MTH12") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PAYMENT_TYPE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PRICE_LIST_REF") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PRIOR_YEAR") + ";";
                    res += SDOHelper.Read(oSalesRecord, "PRIORITY_TRADER") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_BF") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_CF") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH1") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH2") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH3") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH4") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH5") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH6") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH7") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH8") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH9") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH10") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH11") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECEIPT_MTH12") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECORD_CREATE_DATE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECORD_DELETED") + ";";
                    res += SDOHelper.Read(oSalesRecord, "RECORD_MODIFY_DATE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "SALES_REP") + ";";
                    res += SDOHelper.Read(oSalesRecord, "SEND_INVOICES_ELECTRONICALLY") + ";";
                    res += SDOHelper.Read(oSalesRecord, "SEND_LETTERS_ELECTRONICALLY") + ";";
                    res += SDOHelper.Read(oSalesRecord, "SETTLEMENT_DISC_RATE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "SETTLEMENT_DUE_DAYS") + ";";
                    res += SDOHelper.Read(oSalesRecord, "TELEPHONE") + ";";
                    res += SDOHelper.Read(oSalesRecord, "TELEPHONE_2") + ";";
                    res += SDOHelper.Read(oSalesRecord, "TERMS") + ";";
                    res += SDOHelper.Read(oSalesRecord, "TERMS_AGREED_FLAG") + ";";
                    res += SDOHelper.Read(oSalesRecord, "TRADE_CONTACT") + ";";
                    res += SDOHelper.Read(oSalesRecord, "TURNOVER_MTD") + ";";
                    res += SDOHelper.Read(oSalesRecord, "TURNOVER_YTD") + ";";
                    res += SDOHelper.Read(oSalesRecord, "VAT_REG_NUMBER") + ";";
                    res += SDOHelper.Read(oSalesRecord, "WWW") + ";";
                    res += Environment.NewLine;

                    Console.WriteLine(res);

                    if (cou > 2)
                    {
                        break;
                    }

                    Guid accountManager = new Guid();
                    Guid.TryParse(SDOHelper.Read(oSalesRecord, "ACCOUNT_MANAGER").ToString(), out accountManager);
                    bool blocked = new bool();
                    Boolean.TryParse(SDOHelper.Read(oSalesRecord, "ACCOUNT_ON_HOLD").ToString(), out blocked);
                    DateTime created = new DateTime();
                    DateTime.TryParse(SDOHelper.Read(oSalesRecord, "ACCOUNT_OPENED").ToString(), out created);
                    string remarks      = SDOHelper.Read(oSalesRecord, "ACCOUNT_REF").ToString();
                    string type         = SDOHelper.Read(oSalesRecord, "ACCOUNT_TYPE").ToString();
                    Guid   businessType = new Guid();
                    Guid.TryParse(SDOHelper.Read(oSalesRecord, "ACCOUNT_TYPE_CUSTOMER").ToString(), out businessType);

                    string addressLine1 = SDOHelper.Read(oSalesRecord, "ADDRESS_1").ToString();
                    string addressLine2 = SDOHelper.Read(oSalesRecord, "ADDRESS_2").ToString();
                    string addressLine3 = SDOHelper.Read(oSalesRecord, "ADDRESS_3").ToString();
                    string city         = SDOHelper.Read(oSalesRecord, "ADDRESS_4").ToString();
                    string country      = SDOHelper.Read(oSalesRecord, "COUNTRY_CODE").ToString();

                    double creditLineSales = new double();
                    double.TryParse(SDOHelper.Read(oSalesRecord, "CREDIT_LIMIT").ToString(), out creditLineSales);

                    double discountSales = new double();
                    double.TryParse(SDOHelper.Read(oSalesRecord, "DISCOUNT_TYPE").ToString(), out discountSales);

                    string email = SDOHelper.Read(oSalesRecord, "E_MAIL").ToString();

                    if (email.IndexOf(';') != -1)
                    {
                        email = email.Remove(email.IndexOf(';'));
                    }

                    string fax = SDOHelper.Read(oSalesRecord, "FAX").ToString();

                    DateTime?endDate = null;
                    //DateTime.TryParse(SDOHelper.Read(oSalesRecord, "INACTIVE_FLAG").ToString(), out endDate);

                    if (SDOHelper.Read(oSalesRecord, "INACTIVE_FLAG").ToString() == "1")
                    {
                        endDate = new DateTime(2018, 01, 01);
                    }


                    string name = SDOHelper.Read(oSalesRecord, "NAME").ToString();

                    string paymentConditionSales = SDOHelper.Read(oSalesRecord, "PAYMENT_DUE_DAYS").ToString();

                    Account document = new Account
                    {
                        AccountManager = accountManager,
                        Blocked        = blocked,
                        Created        = created,
                        Remarks        = remarks,
                        Type           = type,
                        BusinessType   = businessType,
                        AddressLine1   = addressLine1,
                        AddressLine2   = addressLine2,
                        AddressLine3   = addressLine3,
                        City           = city,
                        // BankAccounts =
                        // Contactname =
                        Country               = country,
                        CreditLineSales       = creditLineSales,
                        DiscountSales         = discountSales,
                        Email                 = email,
                        Fax                   = fax,
                        EndDate               = endDate,
                        Name                  = name,
                        PaymentConditionSales = paymentConditionSales,
                        Status                = "C",
                    };

                    bool createdClient = client.For <Account>().Insert(ref document);


                    movNext2 = oSalesRecord.MoveNext();
                } while (movNext2 == true);

                System.IO.File.WriteAllText(@"E:\Get_Customers.csv", res);

                oWS.Disconnect();
            }
            catch (Exception ex)
            {
                Console.WriteLine("SDO Generated the Following Error: \n\n" + ex.Message, "Error!");
            }
        }
Ejemplo n.º 5
0
        public Get_Products(string companyName)
        {
            //Declare Variables
            SageDataObject220.SDOEngine   oSDO = new SageDataObject220.SDOEngine();
            SageDataObject220.WorkSpace   oWS;
            SageDataObject220.StockRecord oStockRecord;
            String szDataPath;

            //Create the SDO Engine Object
            oSDO = new SageDataObject220.SDOEngine();

            //Create the Workspace
            oWS = (SageDataObject220.WorkSpace)oSDO.Workspaces.Add("Example");

            //Select company. The select company method taked the program install folder
            //as a parameter
            szDataPath = oSDO.SelectCompany(companyName);
            string res = "";

            res += ("ASSEMBLY_LEVEL") + ";";
            res += ("AVERAGE_COST_PRICE") + ";";
            res += ("BUDGET_QTY_SOLD_BF") + ";";
            res += ("BUDGET_QTY_SOLD_FUTURE") + ";";
            res += ("BUDGET_QTY_SOLD_MTH1") + ";";
            res += ("BUDGET_QTY_SOLD_MTH10") + ";";
            res += ("BUDGET_QTY_SOLD_MTH11") + ";";
            res += ("BUDGET_QTY_SOLD_MTH12") + ";";
            res += ("BUDGET_QTY_SOLD_MTH2") + ";";
            res += ("BUDGET_QTY_SOLD_MTH3") + ";";
            res += ("BUDGET_QTY_SOLD_MTH4") + ";";
            res += ("BUDGET_QTY_SOLD_MTH5") + ";";
            res += ("BUDGET_QTY_SOLD_MTH6") + ";";
            res += ("BUDGET_QTY_SOLD_MTH7") + ";";
            res += ("BUDGET_QTY_SOLD_MTH8") + ";";
            res += ("BUDGET_QTY_SOLD_MTH9") + ";";
            res += ("BUDGET_SALES_BF") + ";";
            res += ("BUDGET_SALES_FUTURE") + ";";
            res += ("BUDGET_SALES_MTH1") + ";";
            res += ("BUDGET_SALES_MTH10") + ";";
            res += ("BUDGET_SALES_MTH11") + ";";
            res += ("BUDGET_SALES_MTH12") + ";";
            res += ("BUDGET_SALES_MTH2") + ";";
            res += ("BUDGET_SALES_MTH3") + ";";
            res += ("BUDGET_SALES_MTH4") + ";";
            res += ("BUDGET_SALES_MTH5") + ";";
            res += ("BUDGET_SALES_MTH6") + ";";
            res += ("BUDGET_SALES_MTH7") + ";";
            res += ("BUDGET_SALES_MTH8") + ";";
            res += ("BUDGET_SALES_MTH9") + ";";
            res += ("COMMODITY_CODE") + ";";
            res += ("COMPONENT_CODE_1") + ";";
            res += ("COMPONENT_CODE_2") + ";";
            res += ("COMPONENT_CODE_3") + ";";
            res += ("COMPONENT_CODE_4") + ";";
            res += ("COMPONENT_CODE_5") + ";";
            res += ("COMPONENT_CODE_6") + ";";
            res += ("COMPONENT_CODE_7") + ";";
            res += ("COMPONENT_CODE_8") + ";";
            res += ("COMPONENT_CODE_9") + ";";
            res += ("COMPONENT_CODE_10") + ";";
            res += ("COMPONENT_Code_11") + ";";
            res += ("COMPONENT_Code_12") + ";";
            res += ("COMPONENT_Code_13") + ";";
            res += ("COMPONENT_Code_14") + ";";
            res += ("COMPONENT_Code_15") + ";";
            res += ("COMPONENT_Code_16") + ";";
            res += ("COMPONENT_Code_17") + ";";
            res += ("COMPONENT_Code_18") + ";";
            res += ("COMPONENT_Code_19") + ";";
            res += ("COMPONENT_CODE_20") + ";";
            res += ("COMPONENT_Code_21") + ";";
            res += ("COMPONENT_Code_22") + ";";
            res += ("COMPONENT_Code_23") + ";";
            res += ("COMPONENT_Code_24") + ";";
            res += ("COMPONENT_Code_25") + ";";
            res += ("COMPONENT_Code_26") + ";";
            res += ("COMPONENT_Code_27") + ";";
            res += ("COMPONENT_Code_28") + ";";
            res += ("COMPONENT_Code_29") + ";";
            res += ("COMPONENT_CODE_30") + ";";
            res += ("COMPONENT_Code_31") + ";";
            res += ("COMPONENT_Code_32") + ";";
            res += ("COMPONENT_Code_33") + ";";
            res += ("COMPONENT_Code_34") + ";";
            res += ("COMPONENT_Code_35") + ";";
            res += ("COMPONENT_Code_36") + ";";
            res += ("COMPONENT_Code_37") + ";";
            res += ("COMPONENT_Code_38") + ";";
            res += ("COMPONENT_Code_39") + ";";
            res += ("COMPONENT_CODE_40") + ";";
            res += ("COMPONENT_Code_41") + ";";
            res += ("COMPONENT_Code_42") + ";";
            res += ("COMPONENT_Code_43") + ";";
            res += ("COMPONENT_Code_44") + ";";
            res += ("COMPONENT_Code_45") + ";";
            res += ("COMPONENT_Code_46") + ";";
            res += ("COMPONENT_Code_47") + ";";
            res += ("COMPONENT_Code_48") + ";";
            res += ("COMPONENT_Code_49") + ";";
            res += ("COMPONENT_Code_50") + ";";
            res += ("COMPONENT_QTY_1") + ";";
            res += ("COMPONENT_QTY_2") + ";";
            res += ("COMPONENT_QTY_3") + ";";
            res += ("COMPONENT_QTY_4") + ";";
            res += ("COMPONENT_QTY_5") + ";";
            res += ("COMPONENT_QTY_6") + ";";
            res += ("COMPONENT_QTY_7") + ";";
            res += ("COMPONENT_QTY_8") + ";";
            res += ("COMPONENT_QTY_9") + ";";
            res += ("COMPONENT_QTY_10") + ";";
            res += ("COMPONENT_QTY_11") + ";";
            res += ("COMPONENT_QTY_12") + ";";
            res += ("COMPONENT_QTY_13") + ";";
            res += ("COMPONENT_QTY_14") + ";";
            res += ("COMPONENT_QTY_15") + ";";
            res += ("COMPONENT_QTY_16") + ";";
            res += ("COMPONENT_QTY_17") + ";";
            res += ("COMPONENT_QTY_18") + ";";
            res += ("COMPONENT_QTY_19") + ";";
            res += ("COMPONENT_QTY_20") + ";";
            res += ("COMPONENT_QTY_21") + ";";
            res += ("COMPONENT_QTY_22") + ";";
            res += ("COMPONENT_QTY_23") + ";";
            res += ("COMPONENT_QTY_24") + ";";
            res += ("COMPONENT_QTY_25") + ";";
            res += ("COMPONENT_QTY_26") + ";";
            res += ("COMPONENT_QTY_27") + ";";
            res += ("COMPONENT_QTY_28") + ";";
            res += ("COMPONENT_QTY_29") + ";";
            res += ("COMPONENT_QTY_30") + ";";
            res += ("COMPONENT_QTY_31") + ";";
            res += ("COMPONENT_QTY_32") + ";";
            res += ("COMPONENT_QTY_33") + ";";
            res += ("COMPONENT_QTY_34") + ";";
            res += ("COMPONENT_QTY_35") + ";";
            res += ("COMPONENT_QTY_36") + ";";
            res += ("COMPONENT_QTY_37") + ";";
            res += ("COMPONENT_QTY_38") + ";";
            res += ("COMPONENT_QTY_39") + ";";
            res += ("COMPONENT_QTY_40") + ";";
            res += ("COMPONENT_QTY_41") + ";";
            res += ("COMPONENT_QTY_42") + ";";
            res += ("COMPONENT_QTY_43") + ";";
            res += ("COMPONENT_QTY_44") + ";";
            res += ("COMPONENT_QTY_45") + ";";
            res += ("COMPONENT_QTY_46") + ";";
            res += ("COMPONENT_QTY_47") + ";";
            res += ("COMPONENT_QTY_48") + ";";
            res += ("COMPONENT_QTY_49") + ";";
            res += ("COMPONENT_QTY_50") + ";";
            res += ("COST_BF") + ";";
            res += ("COST_FUTURE") + ";";
            res += ("COST_MTH1") + ";";
            res += ("COST_MTH10") + ";";
            res += ("COST_MTH11") + ";";
            res += ("COST_MTH12") + ";";
            res += ("COST_MTH2") + ";";
            res += ("COST_MTH3") + ";";
            res += ("COST_MTH4") + ";";
            res += ("COST_MTH5") + ";";
            res += ("COST_MTH6") + ";";
            res += ("COST_MTH7") + ";";
            res += ("COST_MTH8") + ";";
            res += ("COST_MTH9") + ";";
            res += ("COUNTRY_CODE_OF_ORIGIN") + ";";
            res += ("CUSTOM_1") + ";";
            res += ("CUSTOM_2") + ";";
            res += ("CUSTOM_3") + ";";
            res += ("DELETED_FLAG") + ";";
            res += ("DEPT_NUMBER") + ";";
            res += ("DESCRIPTION") + ";";
            res += ("DISC_A_LEVEL_10_QTY") + ";";
            res += ("DISC_A_LEVEL_10_RATE") + ";";
            res += ("DISC_A_LEVEL_1_QTY") + ";";
            res += ("DISC_A_LEVEL_1_RATE") + ";";
            res += ("DISC_A_LEVEL_2_QTY") + ";";
            res += ("DISC_A_LEVEL_2_RATE") + ";";
            res += ("DISC_A_LEVEL_3_QTY") + ";";
            res += ("DISC_A_LEVEL_3_RATE") + ";";
            res += ("DISC_A_LEVEL_4_QTY") + ";";
            res += ("DISC_A_LEVEL_4_RATE") + ";";
            res += ("DISC_A_LEVEL_5_QTY") + ";";
            res += ("DISC_A_LEVEL_5_RATE") + ";";
            res += ("DISC_A_LEVEL_6_QTY") + ";";
            res += ("DISC_A_LEVEL_6_RATE") + ";";
            res += ("DISC_A_LEVEL_7_QTY") + ";";
            res += ("DISC_A_LEVEL_7_RATE") + ";";
            res += ("DISC_A_LEVEL_8_QTY") + ";";
            res += ("DISC_A_LEVEL_8_RATE") + ";";
            res += ("DISC_A_LEVEL_9_QTY") + ";";
            res += ("DISC_A_LEVEL_9_RATE") + ";";
            res += ("DISC_B_LEVEL_10_QTY") + ";";
            res += ("DISC_B_LEVEL_10_RATE") + ";";
            res += ("DISC_B_LEVEL_1_QTY") + ";";
            res += ("DISC_B_LEVEL_1_RATE") + ";";
            res += ("DISC_B_LEVEL_2_QTY") + ";";
            res += ("DISC_B_LEVEL_2_RATE") + ";";
            res += ("DISC_B_LEVEL_3_QTY") + ";";
            res += ("DISC_B_LEVEL_3_RATE") + ";";
            res += ("DISC_B_LEVEL_4_QTY") + ";";
            res += ("DISC_B_LEVEL_4_RATE") + ";";
            res += ("DISC_B_LEVEL_5_QTY") + ";";
            res += ("DISC_B_LEVEL_5_RATE") + ";";
            res += ("DISC_B_LEVEL_6_QTY") + ";";
            res += ("DISC_B_LEVEL_6_RATE") + ";";
            res += ("DISC_B_LEVEL_7_QTY") + ";";
            res += ("DISC_B_LEVEL_7_RATE") + ";";
            res += ("DISC_B_LEVEL_8_QTY") + ";";
            res += ("DISC_B_LEVEL_8_RATE") + ";";
            res += ("DISC_B_LEVEL_9_QTY") + ";";
            res += ("DISC_B_LEVEL_9_RATE") + ";";
            res += ("DISC_C_LEVEL_10_QTY") + ";";
            res += ("DISC_C_LEVEL_10_RATE") + ";";
            res += ("DISC_C_LEVEL_1_QTY") + ";";
            res += ("DISC_C_LEVEL_1_RATE") + ";";
            res += ("DISC_C_LEVEL_2_QTY") + ";";
            res += ("DISC_C_LEVEL_2_RATE") + ";";
            res += ("DISC_C_LEVEL_3_QTY") + ";";
            res += ("DISC_C_LEVEL_3_RATE") + ";";
            res += ("DISC_C_LEVEL_4_QTY") + ";";
            res += ("DISC_C_LEVEL_4_RATE") + ";";
            res += ("DISC_C_LEVEL_5_QTY") + ";";
            res += ("DISC_C_LEVEL_5_RATE") + ";";
            res += ("DISC_C_LEVEL_6_QTY") + ";";
            res += ("DISC_C_LEVEL_6_RATE") + ";";
            res += ("DISC_C_LEVEL_7_QTY") + ";";
            res += ("DISC_C_LEVEL_7_RATE") + ";";
            res += ("DISC_C_LEVEL_8_QTY") + ";";
            res += ("DISC_C_LEVEL_8_RATE") + ";";
            res += ("DISC_C_LEVEL_9_QTY") + ";";
            res += ("DISC_C_LEVEL_9_RATE") + ";";
            res += ("DISC_D_LEVEL_10_QTY") + ";";
            res += ("DISC_D_LEVEL_10_RATE") + ";";
            res += ("DISC_D_LEVEL_1_QTY") + ";";
            res += ("DISC_D_LEVEL_1_RATE") + ";";
            res += ("DISC_D_LEVEL_2_QTY") + ";";
            res += ("DISC_D_LEVEL_2_RATE") + ";";
            res += ("DISC_D_LEVEL_3_QTY") + ";";
            res += ("DISC_D_LEVEL_3_RATE") + ";";
            res += ("DISC_D_LEVEL_4_QTY") + ";";
            res += ("DISC_D_LEVEL_4_RATE") + ";";
            res += ("DISC_D_LEVEL_5_QTY") + ";";
            res += ("DISC_D_LEVEL_5_RATE") + ";";
            res += ("DISC_D_LEVEL_6_QTY") + ";";
            res += ("DISC_D_LEVEL_6_RATE") + ";";
            res += ("DISC_D_LEVEL_7_QTY") + ";";
            res += ("DISC_D_LEVEL_7_RATE") + ";";
            res += ("DISC_D_LEVEL_8_QTY") + ";";
            res += ("DISC_D_LEVEL_8_RATE") + ";";
            res += ("DISC_D_LEVEL_9_QTY") + ";";
            res += ("DISC_D_LEVEL_9_RATE") + ";";
            res += ("DISC_E_LEVEL_10_QTY") + ";";
            res += ("DISC_E_LEVEL_10_RATE") + ";";
            res += ("DISC_E_LEVEL_1_QTY") + ";";
            res += ("DISC_E_LEVEL_1_RATE") + ";";
            res += ("DISC_E_LEVEL_2_QTY") + ";";
            res += ("DISC_E_LEVEL_2_RATE") + ";";
            res += ("DISC_E_LEVEL_3_QTY") + ";";
            res += ("DISC_E_LEVEL_3_RATE") + ";";
            res += ("DISC_E_LEVEL_4_QTY") + ";";
            res += ("DISC_E_LEVEL_4_RATE") + ";";
            res += ("DISC_E_LEVEL_5_QTY") + ";";
            res += ("DISC_E_LEVEL_5_RATE") + ";";
            res += ("DISC_E_LEVEL_6_QTY") + ";";
            res += ("DISC_E_LEVEL_6_RATE") + ";";
            res += ("DISC_E_LEVEL_7_QTY") + ";";
            res += ("DISC_E_LEVEL_7_RATE") + ";";
            res += ("DISC_E_LEVEL_8_QTY") + ";";
            res += ("DISC_E_LEVEL_8_RATE") + ";";
            res += ("DISC_E_LEVEL_9_QTY") + ";";
            res += ("DISC_E_LEVEL_9_RATE") + ";";
            res += ("EXTERNAL_USAGE") + ";";
            res += ("FIRST_TRAN") + ";";
            res += ("IGNORE_STK_LVL_FLAG") + ";";
            res += ("INACTIVE_FLAG") + ";";
            res += ("INTRASTAT_COMMODITY_CODE") + ";";
            res += ("INTRASTAT_IMPORT_DUTY_CODE") + ";";
            res += ("ITEM_TYPE") + ";";
            res += ("LAST_COST_DISCOUNT") + ";";
            res += ("LAST_ORDER_QUANTITY") + ";";
            res += ("LAST_PURCHASE_DATE") + ";";
            res += ("LAST_PURCHASE_PRICE") + ";";
            res += ("LAST_SALE_DATE") + ";";
            res += ("LAST_TRAN") + ";";
            res += ("LAST_UPDATED") + ";";
            res += ("LINK_LEVEL") + ";";
            res += ("LOCATION") + ";";
            res += ("NO_OF_TRAN") + ";";
            res += ("NOMINAL_CODE") + ";";
            res += ("PRIOR_YR_COST_BF") + ";";
            res += ("PRIOR_YR_COST_FUTURE") + ";";
            res += ("PRIOR_YR_COST_MTH1") + ";";
            res += ("PRIOR_YR_COST_MTH10") + ";";
            res += ("PRIOR_YR_COST_MTH11") + ";";
            res += ("PRIOR_YR_COST_MTH12") + ";";
            res += ("PRIOR_YR_COST_MTH2") + ";";
            res += ("PRIOR_YR_COST_MTH3") + ";";
            res += ("PRIOR_YR_COST_MTH4") + ";";
            res += ("PRIOR_YR_COST_MTH5") + ";";
            res += ("PRIOR_YR_COST_MTH6") + ";";
            res += ("PRIOR_YR_COST_MTH7") + ";";
            res += ("PRIOR_YR_COST_MTH8") + ";";
            res += ("PRIOR_YR_COST_MTH9") + ";";
            res += ("PRIOR_YR_QTY_SOLD_BF") + ";";
            res += ("PRIOR_YR_QTY_SOLD_FUTURE") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH1") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH10") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH11") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH12") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH2") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH3") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH4") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH5") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH6") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH7") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH8") + ";";
            res += ("PRIOR_YR_QTY_SOLD_MTH9") + ";";
            res += ("PRIOR_YR_SALES_BF") + ";";
            res += ("PRIOR_YR_SALES_FUTURE") + ";";
            res += ("PRIOR_YR_SALES_MTH1") + ";";
            res += ("PRIOR_YR_SALES_MTH10") + ";";
            res += ("PRIOR_YR_SALES_MTH11") + ";";
            res += ("PRIOR_YR_SALES_MTH12") + ";";
            res += ("PRIOR_YR_SALES_MTH2") + ";";
            res += ("PRIOR_YR_SALES_MTH3") + ";";
            res += ("PRIOR_YR_SALES_MTH4") + ";";
            res += ("PRIOR_YR_SALES_MTH5") + ";";
            res += ("PRIOR_YR_SALES_MTH6") + ";";
            res += ("PRIOR_YR_SALES_MTH7") + ";";
            res += ("PRIOR_YR_SALES_MTH8") + ";";
            res += ("PRIOR_YR_SALES_MTH9") + ";";
            res += ("PRODUCT_BARCODE") + ";";
            res += ("PURCHASE_NOMINAL_CODE") + ";";
            res += ("PURCHASE_REF") + ";";
            res += ("QTY_ALLOCATED") + ";";
            res += ("QTY_IN_STOCK") + ";";
            res += ("QTY_LAST_ORDER") + ";";
            res += ("QTY_LAST_STOCK_TAKE") + ";";
            res += ("QTY_ON_ORDER") + ";";
            res += ("QTY_REORDER") + ";";
            res += ("QTY_REORDER_LEVEL") + ";";
            res += ("QTY_SOLD_BF") + ";";
            res += ("QTY_SOLD_FUTURE") + ";";
            res += ("QTY_SOLD_MTH1") + ";";
            res += ("QTY_SOLD_MTH10") + ";";
            res += ("QTY_SOLD_MTH11") + ";";
            res += ("QTY_SOLD_MTH12") + ";";
            res += ("QTY_SOLD_MTH2") + ";";
            res += ("QTY_SOLD_MTH3") + ";";
            res += ("QTY_SOLD_MTH4") + ";";
            res += ("QTY_SOLD_MTH5") + ";";
            res += ("QTY_SOLD_MTH6") + ";";
            res += ("QTY_SOLD_MTH7") + ";";
            res += ("QTY_SOLD_MTH8") + ";";
            res += ("QTY_SOLD_MTH9") + ";";
            res += ("RECORD_CREATE_DATE") + ";";
            res += ("RECORD_DELETED") + ";";
            res += ("RECORD_MODIFY_DATE") + ";";
            res += ("SALES_BF") + ";";
            res += ("SALES_FUTURE") + ";";
            res += ("SALES_MTH1") + ";";
            res += ("SALES_MTH10") + ";";
            res += ("SALES_MTH11") + ";";
            res += ("SALES_MTH12") + ";";
            res += ("SALES_MTH2") + ";";
            res += ("SALES_MTH3") + ";";
            res += ("SALES_MTH4") + ";";
            res += ("SALES_MTH5") + ";";
            res += ("SALES_MTH6") + ";";
            res += ("SALES_MTH7") + ";";
            res += ("SALES_MTH8") + ";";
            res += ("SALES_MTH9") + ";";
            res += ("SALES_PRICE") + ";";
            res += ("STOCK_CAT") + ";";
            res += ("STOCK_CODE") + ";";
            res += ("STOCK_TAKE_DATE") + ";";
            res += ("SUPP_UNIT_QTY") + ";";
            res += ("SUPPLIER_PART_NUMBER") + ";";
            res += ("TAX_CODE") + ";";
            res += ("UNIT_OF_SALE") + ";";
            res += ("UNIT_WEIGHT") + ";";
            res += ("WEB_DESCRIPTION") + ";";
            res += ("WEB_IMAGE") + ";";
            res += ("WEB_LONGDESCRIPTION") + ";";
            res += ("WEB_PUBLISH") + ";";
            res += ("WEB_SPECIAL_OFFER") + ";";

            res += Environment.NewLine;

            try
            {
                //Leaving the username and password blank generates a login dialog
                oWS.Connect(szDataPath, "Manager", "", "Demodata");

                //Instantiate Stock Record Object
                oStockRecord = (SageDataObject220.StockRecord)oWS.CreateObject("StockRecord");

                var oStockRecordCount = oStockRecord.Count;

                do
                {
                    res += SDOHelper.Read(oStockRecord, "ASSEMBLY_LEVEL") + ";";
                    res += SDOHelper.Read(oStockRecord, "AVERAGE_COST_PRICE") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_BF") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_FUTURE") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH1") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH10") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH11") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH12") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH2") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH3") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH4") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH5") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH6") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH7") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH8") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_QTY_SOLD_MTH9") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_BF") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_FUTURE") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH1") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH10") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH11") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH12") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH2") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH3") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH4") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH5") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH6") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH7") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH8") + ";";
                    res += SDOHelper.Read(oStockRecord, "BUDGET_SALES_MTH9") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMMODITY_CODE") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_1") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_2") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_3") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_4") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_5") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_6") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_7") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_8") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_9") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_10") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_11") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_12") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_13") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_14") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_15") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_16") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_17") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_18") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_19") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_20") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_21") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_22") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_23") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_24") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_25") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_26") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_27") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_28") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_29") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_30") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_31") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_32") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_33") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_34") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_35") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_36") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_37") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_38") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_39") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_CODE_40") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_41") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_42") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_43") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_44") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_45") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_46") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_47") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_48") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_49") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_Code_50") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_1") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_2") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_3") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_4") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_5") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_6") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_7") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_8") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_9") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_10") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_11") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_12") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_13") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_14") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_15") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_16") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_17") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_18") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_19") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_20") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_21") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_22") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_23") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_24") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_25") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_26") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_27") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_28") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_29") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_30") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_31") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_32") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_33") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_34") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_35") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_36") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_37") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_38") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_39") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_40") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_41") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_42") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_43") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_44") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_45") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_46") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_47") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_48") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_49") + ";";
                    res += SDOHelper.Read(oStockRecord, "COMPONENT_QTY_50") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_BF") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_FUTURE") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH1") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH10") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH11") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH12") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH2") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH3") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH4") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH5") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH6") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH7") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH8") + ";";
                    res += SDOHelper.Read(oStockRecord, "COST_MTH9") + ";";
                    res += SDOHelper.Read(oStockRecord, "COUNTRY_CODE_OF_ORIGIN") + ";";
                    res += SDOHelper.Read(oStockRecord, "CUSTOM_1") + ";";
                    res += SDOHelper.Read(oStockRecord, "CUSTOM_2") + ";";
                    res += SDOHelper.Read(oStockRecord, "CUSTOM_3") + ";";
                    res += SDOHelper.Read(oStockRecord, "DELETED_FLAG") + ";";
                    res += SDOHelper.Read(oStockRecord, "DEPT_NUMBER") + ";";
                    res += SDOHelper.Read(oStockRecord, "DESCRIPTION") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_10_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_10_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_1_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_1_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_2_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_2_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_3_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_3_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_4_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_4_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_5_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_5_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_6_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_6_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_7_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_7_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_8_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_8_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_9_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_A_LEVEL_9_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_10_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_10_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_1_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_1_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_2_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_2_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_3_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_3_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_4_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_4_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_5_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_5_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_6_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_6_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_7_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_7_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_8_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_8_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_9_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_B_LEVEL_9_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_10_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_10_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_1_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_1_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_2_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_2_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_3_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_3_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_4_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_4_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_5_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_5_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_6_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_6_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_7_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_7_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_8_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_8_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_9_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_C_LEVEL_9_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_10_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_10_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_1_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_1_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_2_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_2_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_3_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_3_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_4_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_4_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_5_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_5_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_6_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_6_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_7_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_7_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_8_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_8_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_9_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_D_LEVEL_9_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_10_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_10_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_1_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_1_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_2_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_2_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_3_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_3_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_4_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_4_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_5_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_5_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_6_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_6_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_7_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_7_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_8_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_8_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_9_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "DISC_E_LEVEL_9_RATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "EXTERNAL_USAGE") + ";";
                    res += SDOHelper.Read(oStockRecord, "FIRST_TRAN") + ";";
                    res += SDOHelper.Read(oStockRecord, "IGNORE_STK_LVL_FLAG") + ";";
                    res += SDOHelper.Read(oStockRecord, "INACTIVE_FLAG") + ";";
                    res += SDOHelper.Read(oStockRecord, "INTRASTAT_COMMODITY_CODE") + ";";
                    res += SDOHelper.Read(oStockRecord, "INTRASTAT_IMPORT_DUTY_CODE") + ";";
                    res += SDOHelper.Read(oStockRecord, "ITEM_TYPE") + ";";
                    res += SDOHelper.Read(oStockRecord, "LAST_COST_DISCOUNT") + ";";
                    res += SDOHelper.Read(oStockRecord, "LAST_ORDER_QUANTITY") + ";";
                    res += SDOHelper.Read(oStockRecord, "LAST_PURCHASE_DATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "LAST_PURCHASE_PRICE") + ";";
                    res += SDOHelper.Read(oStockRecord, "LAST_SALE_DATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "LAST_TRAN") + ";";
                    res += SDOHelper.Read(oStockRecord, "LAST_UPDATED") + ";";
                    res += SDOHelper.Read(oStockRecord, "LINK_LEVEL") + ";";
                    res += SDOHelper.Read(oStockRecord, "LOCATION") + ";";
                    res += SDOHelper.Read(oStockRecord, "NO_OF_TRAN") + ";";
                    res += SDOHelper.Read(oStockRecord, "NOMINAL_CODE") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_BF") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_FUTURE") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH1") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH10") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH11") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH12") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH2") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH3") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH4") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH5") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH6") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH7") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH8") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_COST_MTH9") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_BF") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_FUTURE") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH1") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH10") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH11") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH12") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH2") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH3") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH4") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH5") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH6") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH7") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH8") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_QTY_SOLD_MTH9") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_BF") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_FUTURE") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH1") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH10") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH11") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH12") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH2") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH3") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH4") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH5") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH6") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH7") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH8") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRIOR_YR_SALES_MTH9") + ";";
                    res += SDOHelper.Read(oStockRecord, "PRODUCT_BARCODE") + ";";
                    res += SDOHelper.Read(oStockRecord, "PURCHASE_NOMINAL_CODE") + ";";
                    res += SDOHelper.Read(oStockRecord, "PURCHASE_REF") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_ALLOCATED") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_IN_STOCK") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_LAST_ORDER") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_LAST_STOCK_TAKE") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_ON_ORDER") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_REORDER") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_REORDER_LEVEL") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_BF") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_FUTURE") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH1") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH10") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH11") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH12") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH2") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH3") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH4") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH5") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH6") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH7") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH8") + ";";
                    res += SDOHelper.Read(oStockRecord, "QTY_SOLD_MTH9") + ";";
                    res += SDOHelper.Read(oStockRecord, "RECORD_CREATE_DATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "RECORD_DELETED") + ";";
                    res += SDOHelper.Read(oStockRecord, "RECORD_MODIFY_DATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_BF") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_FUTURE") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH1") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH10") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH11") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH12") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH2") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH3") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH4") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH5") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH6") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH7") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH8") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_MTH9") + ";";
                    res += SDOHelper.Read(oStockRecord, "SALES_PRICE") + ";";
                    res += SDOHelper.Read(oStockRecord, "STOCK_CAT") + ";";
                    res += SDOHelper.Read(oStockRecord, "STOCK_CODE") + ";";
                    res += SDOHelper.Read(oStockRecord, "STOCK_TAKE_DATE") + ";";
                    res += SDOHelper.Read(oStockRecord, "SUPP_UNIT_QTY") + ";";
                    res += SDOHelper.Read(oStockRecord, "SUPPLIER_PART_NUMBER") + ";";
                    res += SDOHelper.Read(oStockRecord, "TAX_CODE") + ";";
                    res += SDOHelper.Read(oStockRecord, "UNIT_OF_SALE") + ";";
                    res += SDOHelper.Read(oStockRecord, "UNIT_WEIGHT") + ";";
                    res += SDOHelper.Read(oStockRecord, "WEB_DESCRIPTION") + ";";
                    res += SDOHelper.Read(oStockRecord, "WEB_IMAGE") + ";";
                    res += SDOHelper.Read(oStockRecord, "WEB_LONGDESCRIPTION") + ";";
                    res += SDOHelper.Read(oStockRecord, "WEB_PUBLISH") + ";";
                    res += SDOHelper.Read(oStockRecord, "WEB_SPECIAL_OFFER") + ";";

                    res += Environment.NewLine;

                    Console.WriteLine(res);
                }while (oStockRecord.MoveNext());

                System.IO.File.WriteAllText(@"E:\Get_Products.csv", res);
                //Disconnect
                oWS.Disconnect();
            }
            catch (Exception ex)
            {
                Console.WriteLine("SDO Generated the Following Error: \n\n" + ex.Message, "Error!");
            }
        }
Ejemplo n.º 6
0
        public Get_ProductsAndServices(string companyName)
        {
            //Declare Variables

            SageDataObject220.SDOEngine oSDO = new SageDataObject220.SDOEngine();

            SageDataObject220.WorkSpace   oWS;
            SageDataObject220.InvoiceItem oStockPost;

            SageDataObject220.StockTran oStockTran;

            SageDataObject220.StockRecord oStockRecord;
            SageDataObject220.StockData   oStockData;

            String szDataPath;

            //Instantiate WorkSpace
            oWS = (SageDataObject220.WorkSpace)oSDO.Workspaces.Add("Example");

            //Show select company dialog
            szDataPath = oSDO.SelectCompany(companyName);
            string res = "";

            //Try a connection, will throw an exception if it fails
            try
            {
                //Leaving the username and password blank generates a login dialog
                if (szDataPath != string.Empty)
                {
                    //Connect to the Data Files
                    if (oWS.Connect(szDataPath, "Manager", "", "Demodata"))
                    {
                        oStockTran = (SageDataObject220.StockTran)oWS.CreateObject("StockTran");
                        oStockData = (SageDataObject220.StockData)oWS.CreateObject("StockData");

                        oStockPost = (SageDataObject220.InvoiceItem)oWS.CreateObject("InvoiceItem");

                        oStockRecord = (SageDataObject220.StockRecord)oWS.CreateObject("StockRecord");

                        //Read the first stock code
                        oStockRecord.MoveFirst();
                        oStockPost.MoveFirst();
                        oStockData.MoveFirst();
                        do
                        {
                            //Fill in header information required
                            res  = SDOHelper.Read(oStockRecord, "DESCRIPTION") + " ";
                            res += SDOHelper.Read(oStockRecord, "STOCK_CODE") + " ";
                            Console.WriteLine(res);
                        } while (oStockRecord.MoveNext());


                        //Disconnect
                        oWS.Disconnect();
                    }
                    else
                    {
                        Console.WriteLine("Failed to connect");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("SDO Generated the Following Error: \n\n" + ex.Message, "Error!");
            }
        }