示例#1
0
        private void UpdateAOMProducts(string companyID)
        {
            string lastErrorMessage = "";

            uploadAOMInventTable          = new Ax2012WCFService.Service.UploadAOMInventTable();
            uploadAOMInventTable.Changed += new EventHandler(ListChanged);
            uploadAOMInventTable.Upload(companyID, out lastErrorMessage);
        }
示例#2
0
        private void DoSomething(string companyID = "", bool validCompany = false, string iInterface = "", bool validSelection = false)
        {
            string lastErrorMessage = "";

            while (validCompany == false)
            {
                Console.WriteLine("Please enter Company - e.g. 008");
                companyID = Console.ReadLine();
                if (Constants.validCompanies.Contains(companyID))
                {
                    validCompany = true;
                }
            }

            while (validSelection == false)
            {
                Console.WriteLine("Please select an interface");
                foreach (string oInterface in Constants.validInterfacesSC)
                {
                    Console.Write(string.Format("{0}:", oInterface));
                }
                iInterface = Console.ReadLine();
                if (Constants.validInterfacesSC.Contains(iInterface))
                {
                    validSelection = true;
                }
            }

            switch (iInterface)
            {
            case "APD":
                uploadAOMPurchaseDeliveries          = new Ax2012WCFService.Service.UploadAOMPurchaseDeliveries();
                uploadAOMPurchaseDeliveries.Changed += new EventHandler(ListChanged);
                uploadAOMPurchaseDeliveries.Upload(companyID, out lastErrorMessage, false);
                uploadAOMPurchaseDeliveries.Dispose();
                break;

            case "CUS":
                uploadCustomers          = new Ax2012WCFService.Service.UploadCustomer();
                uploadCustomers.Changed += new EventHandler(ListChanged);
                uploadCustomers.Upload(companyID, out lastErrorMessage);
                uploadCustomers.Dispose();
                break;

            case "SLJ":
                uploadSalesInvoice          = new Ax2012WCFService.Service.UploadSalesInvoice();
                uploadSalesInvoice.Changed += new EventHandler(ListChanged);
                uploadSalesInvoice.Upload(companyID, out lastErrorMessage);
                uploadSalesInvoice.Dispose();
                break;

            case "ADD":
                uploadAddress          = new Ax2012WCFService.Service.UploadAddress();
                uploadAddress.Changed += new EventHandler(ListChanged);
                uploadAddress.Upload(companyID, out lastErrorMessage);
                uploadAddress.Dispose();
                break;

            case "PRD":
                uploadAOMInventTable          = new Ax2012WCFService.Service.UploadAOMInventTable();
                uploadAOMInventTable.Changed += new EventHandler(ListChanged);
                uploadAOMInventTable.Upload(companyID, out lastErrorMessage);
                uploadAOMInventTable.Dispose();
                break;
            }
        }