コード例 #1
0
        private NetSuiteConnector.com.netsuite.webservices.Address CreateBillAddress(MG2Connector.Address billing_address)
        {
            var billAddress = new NetSuiteConnector.com.netsuite.webservices.Address()
            {
                country   = Country._unitedStates,
                zip       = billing_address.postcode,
                addrPhone = (billing_address.telephone == null) ? "" : billing_address.telephone,
                state     = billing_address.region_code,
                city      = billing_address.city,
                addressee = billing_address.firstname + " " + billing_address.middlename + " " + billing_address.lastname
            };

            if (billing_address.street.Count > 0)
            {
                billAddress.addr1 = billing_address.street[0];
            }
            if (billing_address.street.Count > 1)
            {
                billAddress.addr2 = billing_address.street[1];
            }
            if (billing_address.street.Count > 2)
            {
                //billAddress.addr3 = billing_address.street[2];
                billAddress.addr2 = billing_address.street[1] + " " + billing_address.street[2];
            }

            return(billAddress);
        }
コード例 #2
0
        private NetSuiteConnector.com.netsuite.webservices.Address CreateShippinhAddress(MG2Connector.Address mShippingAddress)
        {
            StringCustomFieldRef receiving_phone = new StringCustomFieldRef()
            {
                scriptId   = "custrecord14",
                internalId = "1691",
                value      = (mShippingAddress.telephone == null) ? "" : mShippingAddress.telephone
            };
            StringCustomFieldRef receiving_name = new StringCustomFieldRef()
            {
                scriptId = "custrecord13",
                value    = mShippingAddress.firstname + " " + mShippingAddress.lastname
            };

            var shippingAddress = new NetSuiteConnector.com.netsuite.webservices.Address()
            {
                country         = Country._unitedStates,
                addressee       = mShippingAddress.firstname + " " + mShippingAddress.middlename + " " + mShippingAddress.lastname,
                city            = mShippingAddress.city,
                state           = mShippingAddress.region_code,
                zip             = mShippingAddress.postcode,
                customFieldList = new CustomFieldRef[] { receiving_phone, receiving_name },
            };

            if (mShippingAddress.street.Count > 0)
            {
                shippingAddress.addr1 = mShippingAddress.street[0];
            }
            if (mShippingAddress.street.Count > 1)
            {
                shippingAddress.addr2 = mShippingAddress.street[1];
            }
            if (mShippingAddress.street.Count > 2)
            {
                //shippingAddress.addr3 = mShippingAddress.street[2];
                shippingAddress.addr2 = mShippingAddress.street[1] + " " + mShippingAddress.street[2];
            }

            return(shippingAddress);
        }