Пример #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);
        }
Пример #2
0
        public ISyncWSResult getCustomerOrderTypes(Database database, ISyncWSParameter dataParameter)
        {
            customerOrderSearchParameters customerOrderSearchParameters = (customerOrderSearchParameters)dataParameter;

            WebServices3pl pkg = new WebServices3pl(database);

            customerOrderTypeSearchResult res = pkg.Findcustomerordertype(dataParameter);

            return(res);
        }
Пример #3
0
        public ISyncWSResult getMethodOfShipments(Database database, ISyncWSParameter dataParameter)
        {
            methodOfShipmentSearchParameters methodOfShipmentSearchParameters = (methodOfShipmentSearchParameters)dataParameter;

            WebServices3pl pkg = new WebServices3pl(database);

            methodOfShipmentSearchResult res = (methodOfShipmentSearchResult)pkg.Findmethodofshipmentbyclient(dataParameter,
                                                                                                              methodOfShipmentSearchParameters.clientId);

            return(res);
        }
Пример #4
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);
        }
Пример #5
0
        public ISyncWSResult getOrderDetails(Database database, ISyncWSParameter dataParameter)
        {
            orderSearchParameters orderSearchParameters = (orderSearchParameters)dataParameter;

            WebServices3pl pkg = new WebServices3pl(database);

            orderSearchResult res = pkg.getOrderDetails(dataParameter,
                                                        orderSearchParameters.orderType,
                                                        orderSearchParameters.clientId,
                                                        orderSearchParameters.orderNo,
                                                        boolToYesNo(orderSearchParameters.ordersFromHistory),
                                                        boolToYesNo(orderSearchParameters.ordersFromProduction));

            Details(dataParameter, orderSearchParameters, res, pkg);

            return((searchResult)res);
        }
Пример #6
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);
        }
Пример #7
0
        private void Details(ISyncWSParameter dataParameter, orderSearchParameters orderSearchParameters, orderSearchResult res, WebServices3pl pkg)
        {
            if (dataParameter.GetReturnDetails())
            {
                foreach (order item in res.list)
                {
                    orderSearchParameters subParams = new orderSearchParameters();
                    subParams.firstResult = null;
                    subParams.maxResult   = null;

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

                    case orderType.CO3PL:

                        if (!String.IsNullOrEmpty(item.customer))
                        {
                            address[] address = pkg.getAddresses(
                                subParams,
                                orderSearchParameters.clientId,
                                item.customer);

                            if (address.GetLength(0) == 1)
                            {
                                item.shippingAddress            = new shippingAddress();
                                item.shippingAddress.shipCustNo = item.customer;
                                item.shippingAddress.shiptoNo   = "0";
                                item.shippingAddress.address    = address[0];
                            }
                        }

                        break;

                    case orderType.PO:
                    {
                        address[] address = pkg.Getpartyaddress(
                            subParams,
                            item.shipFromPartyid,
                            item.shipFromPartyQualifier,
                            orderSearchParameters.clientId);

                        if (address.GetLength(0) == 1)
                        {
                            item.orderShipFrom = new orderShipFrom();
                            item.orderShipFrom.shipFromPartyid                 = item.shipFromPartyid;
                            item.orderShipFrom.shipFromPartyQualifier          = ConvertPartyType(item.shipFromPartyQualifier);
                            item.orderShipFrom.shipFromPartyQualifierSpecified = true;
                            item.orderShipFrom.address = address[0];
                        }
                    }
                    break;

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

                    item.orderLines = pkg.GetOrderLines(subParams,
                                                        orderSearchParameters.orderType,
                                                        orderSearchParameters.clientId,
                                                        item.coNo,
                                                        item.poid,
                                                        item.poSeq,
                                                        boolToYesNo(orderSearchParameters.ordersFromHistory),
                                                        boolToYesNo(orderSearchParameters.ordersFromProduction));
                }
            }
        }