Beispiel #1
0
        public ISyncWSResult getAddresses(Database database, ISyncWSParameter dataParameter)
        {
            customerSearchParameters customerSearchParameters = (customerSearchParameters)dataParameter;

            WebServices3pl pkg = new WebServices3pl(database);

            addressSearchResult res = pkg.getAddresses(dataParameter, customerSearchParameters.clientId, customerSearchParameters.customerId);

            return((searchResult)res);
        }
Beispiel #2
0
        public ISyncWSResult findCustomerById(Database database, ISyncWSParameter dataParameter)
        {
            customerSearchParameters customerSearchParameters = (customerSearchParameters)dataParameter;

            WebServices3pl pkg = new WebServices3pl(database);

            customerSearchResult res = pkg.findCustomerById(dataParameter, customerSearchParameters.clientId, customerSearchParameters.customerId);

            if (dataParameter.GetReturnDetails())
            {
                foreach (customer item in res.list)
                {
                    customerSearchParameters subParams = new customerSearchParameters();
                    subParams.firstResult = null;
                    subParams.maxResult   = null;

                    addressSearchResult addressResult;

                    if (customerSearchParameters.customerId != null)
                    {
                        addressResult = pkg.getAddresses(subParams, customerSearchParameters.clientId, item.id);
                    }
                    else
                    {
                        addressResult = pkg.getAddresses(subParams, customerSearchParameters.clientId, null);
                    }

                    int i = 0;
                    foreach (address address in addressResult.list)
                    {
                        item.shippingAddress            = new shippingAddress();
                        item.shippingAddress.shipCustNo = item.id;
                        item.shippingAddress.shiptoNo   = Convert.ToString(i);
                        item.shippingAddress.address    = address;
                    }
                }
            }

            return((searchResult)res);
        }