Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public customerSearchResult findCustomerById(ISyncWSParameter dataParam, string clientId, string customerId)
        {
            IDataReader          reader = null;
            int                  totalRows;
            customerSearchResult res = new customerSearchResult();

            Findcustomersbyid(
                clientId,
                customerId,
                out reader);

            ArrayList list = ReaderHelper.Read(
                reader,
                new customer(),
                dataParam.GetSkipNoFirstRows(),
                dataParam.GetMaxRows(),
                out totalRows);

            res.list = list.ToArray(typeof(customer)) as customer[];
            res.SetTotalRows(totalRows);

            return(res);
        }