public void Add_Customer_And_Order()
        {
            var c = new Customer()
            {
                Email = "*****@*****.**",
                InvoiceEmail = "*****@*****.**",
                MobileNumber = "12345678",
                PhoneNumber = "12345678",
                Name = "Testkunde (DELETE ME)",
                PhysicalAddress1 = "Eksempeladdresse",
                PhysicalCity = "Andeby",
                PhysicalPostalNumber = "1234",
                PhysicalCountryCode = "NO",
                PostalAddress1 = "Postboks 9000",
                PostalCity = "Andeby",
                PostalNumber = "1234",
                PostalCountryCode = "NO",
                LanguageCode = "NO",
                AccountManagerId = "",
                CurrencyCode = "NOK",
                CustomerAccountNumber = "0",
                CustomerCategoryId1 = "0",
                CustomerCategoryId2 = "0",
                CustomerCategoryId3 = "0",
                FaxNumber = "",
                OrganizationNumber = "",
                PhysicalAddress2 = "",
                PostalAddress2 = "",
                VendorAccountNumber = "0"
            };

            _tripleTexFacade.GetCompanyService().SaveCustomerVendor(c);

            var customer = _tripleTexFacade.GetCompanyService()
                                           .SearchForCustomersAndVendors(CustomerVendorType.All, CustomerIsActive.All,
                                                                         "" + c.Name);

            var customers = customer as IList<Customer> ?? customer.ToList();
            if (!customers.Any()) throw new Exception("No Customers where returned");

            var o = new Order()
            {
                CustomerNumber = "" + customers.FirstOrDefault().CustomerAccountNumber,
                ContactFirstName = "Donald",
                ContactLastName = "Duck",
                OrderComment = "Dette er en testordre, DELETE ME",
                OrderDate = DateTime.Now.ToString("yyyy-MM-dd"),
                ProductNumber = "300000",
                VatType = "3",
                Count = "1",
                UnitPrice = "2200,00"
            };

            _tripleTexFacade.GetOrderService().ImportOrdersTripletexCsv(o);

            Assert.Pass();
        }
Пример #2
0
 public Order ImportOrdersTripletexCsv(Order order)
 {
     return _service.Call<Order>("Project.importOrdersTripletexCSV", Helpers.ObjectToCsvString(order), "UTF-8", false, false, true);
 }