Exemplo n.º 1
0
        private orderSaveResult savePO(Database database, orderSaveParameters orderSaveParameters)
        {
            orderSaveResult res = new orderSaveResult();

            WebServices3pl pkg = new WebServices3pl(database);

            pkg.Savepo(orderSaveParameters.clientId,
                       orderSaveParameters.order.poid,
                       orderSaveParameters.order.poSeq,
                       orderSaveParameters.order.shipFromPartyid,
                       orderSaveParameters.order.reqDelDate,
                       orderSaveParameters.order.text,
                       orderSaveParameters.order.receivingWhid);

            foreach (orderLine x in orderSaveParameters.order.orderLines)
            {
                pkg.Savepoline(orderSaveParameters.clientId,
                               x.partNo,
                               x.partDescr1,
                               x.text,
                               (Nullable <double>)x.qtyUnit,
                               x.unit,
                               orderSaveParameters.order.poid,
                               orderSaveParameters.order.poSeq,
                               x.linePos,
                               x.lineSeq,
                               orderSaveParameters.order.reqDelDate,
                               orderSaveParameters.order.receivingWhid);
            }

            return(res);
        }
Exemplo n.º 2
0
        public order saveOrder(orderSaveParameters orderSaveParameters)
        {
            Order           p = new Order();
            orderSaveResult orderSaveResult = (orderSaveResult)PackageHelper.GetResult(orderSaveParameters, p.saveOrder, p.find);

            switch (orderSaveParameters.order.orderType)
            {
            case orderType.CO:
                throw new Exception("Order type CO not supported");

            case orderType.CO3PL:
                orderSaveResult orderSignalResult = (orderSaveResult)PackageHelper.GetResult(orderSaveParameters, p.SignalProcess, p.find);
                break;

            case orderType.PO:
                break;

            default:
                throw new Exception("Unknown order type");
            }

            // reload it
            orderSearchParameters orderSearchParameters = new orderSearchParameters();

            orderSearchParameters.clientId      = orderSaveParameters.clientId;
            orderSearchParameters.returnDetails = true;
            orderSearchParameters.orderType     = orderSaveParameters.order.orderType;

            switch (orderSaveParameters.order.orderType)
            {
            case orderType.CO:
                throw new Exception("Order type CO not supported");

            case orderType.CO3PL:
                orderSearchParameters.orderNo = orderSaveParameters.order.coNo;
                break;

            case orderType.PO:
                orderSearchParameters.orderNo = orderSaveParameters.order.poid;
                break;

            default:
                throw new Exception("Unknown order type");
            }

            orderSearchResult orderSearchResult = (orderSearchResult)PackageHelper.GetResult(orderSearchParameters, p.getOrderDetails, p.find);

            if (orderSearchResult.list.GetLength(0) != 1)
            {
                return(null);
            }
            else
            {
                return(orderSearchResult.list[0]);
            }
        }
Exemplo n.º 3
0
        public ISyncWSResult SignalProcess(Database database, ISyncWSParameter dataParameter)
        {
            orderSaveParameters orderSaveParameters = (orderSaveParameters)dataParameter;
            orderSaveResult     res = new orderSaveResult();

            WebServices3pl pkg = new WebServices3pl(database);

            pkg.SignalProcess("CO");

            res.totalHits = 0;
            return(res);
        }
Exemplo n.º 4
0
        public ISyncWSResult saveOrder(Database database, ISyncWSParameter dataParameter)
        {
            orderSaveParameters orderSaveParameters = (orderSaveParameters)dataParameter;
            orderSaveResult     res = null;

            switch (orderSaveParameters.order.orderType)
            {
            case orderType.CO:
                throw new Exception("orderType CO not supported");

            case orderType.CO3PL:
                res = saveCO3PL(database, orderSaveParameters);
                break;

            case orderType.PO:
                res = savePO(database, orderSaveParameters);
                break;

            default:
                throw new Exception("unknown orderType");
            }

            return(res);
        }
Exemplo n.º 5
0
        private orderSaveResult saveCO3PL(Database database, orderSaveParameters orderSaveParameters)
        {
            orderSaveResult res = new orderSaveResult();

            int            COSEQ_W = 0;
            WebServices3pl pkg     = new WebServices3pl(database);

            shippingAddress shippingAddress = orderSaveParameters.order.shippingAddress;

            if (shippingAddress == null)
            {
                shippingAddress = new shippingAddress();
            }

            if (shippingAddress.address == null)
            {
                shippingAddress.address = new address();
            }

            pkg.Saveco(orderSaveParameters.clientId,
                       orderSaveParameters.order.coNo,
                       orderSaveParameters.order.customer,
                       orderSaveParameters.order.cuRef,
                       orderSaveParameters.order.yourCono,
                       orderSaveParameters.order.reqDelDate,
                       orderSaveParameters.order.text,
                       orderSaveParameters.order.coMark,
                       orderSaveParameters.stockNo,
                       orderSaveParameters.order.methodOfShipmentId,
                       orderSaveParameters.order.customerOrderTypeId,
                       COSEQ_W,
                       shippingAddress.address.name1,
                       shippingAddress.address.name2,
                       shippingAddress.address.street1,
                       shippingAddress.address.street2,
                       shippingAddress.address.street3,
                       shippingAddress.address.zipCode,
                       shippingAddress.address.city,
                       shippingAddress.address.countryCd,
                       null // phone
                       );

            foreach (orderLine x in orderSaveParameters.order.orderLines)
            {
                pkg.Savecoline(orderSaveParameters.clientId,
                               x.partNo,
                               x.partDescr1,
                               x.partDescr2,
                               x.custPartNo,
                               x.custPartDescr1,
                               x.custPartDescr2,
                               x.text,
                               (Nullable <double>)x.qtyUnit,
                               (Nullable <int>)x.originalQtyUnit,
                               x.unit,
                               null, ///////// unitDescr
                               x.linePos,
                               x.lineSeq,
                               x.lineId,
                               x.sellingUnit,
                               x.sellingUnitDesc,
                               x.delDate,
                               Convert.ToString(x.lineStatus),
                               orderSaveParameters.order.coNo,
                               COSEQ_W,
                               x.blockCod,
                               x.serial,
                               x.serNumb,
                               x.prodLot,
                               x.promotn,
                               x.storBat,
                               x.prodLotReq);
            }

            return(res);
        }