Пример #1
0
        public CreatedExchangeOrder CreateExchange(string rmaNo, string externalDocNo, string lineValues, int zendeskTicketNo)
        {
            CreatedExchangeOrder eo = new CreatedExchangeOrder();

            functions.CreateExchangeOrder(rmaNo, ref eo, externalDocNo, SessionID(), lineValues, zendeskTicketNo);

            return(eo);
        }
Пример #2
0
        public CreatedExchangeHeader CreateExchangeOrder(string rmaNo, string externalDocumentNo, string lineValues, int zendeskTicketNo)
        {
            CreatedExchangeOrder  ceo = new CreatedExchangeOrder();
            CreatedExchangeHeader ceh = new CreatedExchangeHeader();

            ceo = webService.CreateExchange(rmaNo, externalDocumentNo, lineValues, zendeskTicketNo);

            ceh = CreateExchange(ceo);
            return(ceh);
        }
Пример #3
0
        protected List <CreatedExchangeLines> CreateExchangeOrderLines(CreatedExchangeOrder eo)
        {
            List <CreatedExchangeLines> cel = new List <CreatedExchangeLines>();

            string itemNo      = string.Empty;
            string description = string.Empty;
            int    quantity    = 0;
            double price       = 0;
            double lineAmount  = 0;

            if (eo.SalesLine != null)
            {
                for (int sl = 0; sl < eo.SalesLine.Length; sl++)
                {
                    int.TryParse(eo.SalesLine[sl].Qty, out quantity);
                    if (quantity > 0)
                    {
                        itemNo      = eo.SalesLine[sl].ItemNo;
                        description = eo.SalesLine[sl].Description;

                        double.TryParse(eo.SalesLine[sl].UnitPrice.Replace(",", ""), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out price);
                        lineAmount = quantity * price;

                        cel.Add(new CreatedExchangeLines(itemNo, description, quantity, price, lineAmount));
                    }

                    itemNo      = string.Empty;
                    description = string.Empty;
                    quantity    = 0;
                    price       = 0;
                    lineAmount  = 0;
                }
            }

            return(cel);
        }
Пример #4
0
        protected CreatedExchangeHeader CreateExchange(CreatedExchangeOrder eo)
        {
            CreatedExchangeHeader ceh = new CreatedExchangeHeader();
            string orderNo            = string.Empty;
            string externalDocumentNo = string.Empty;
            string orderDate          = string.Empty;
            string channelName        = string.Empty;
            string shipMethod         = string.Empty;
            string rmaNo                      = string.Empty;
            string shipToName                 = string.Empty;
            string shipToAddress1             = string.Empty;
            string shipToAddress2             = string.Empty;
            string shipToContact              = string.Empty;
            string shipToCity                 = string.Empty;
            string shipToZip                  = string.Empty;
            string shipToState                = string.Empty;
            string shipToCountry              = string.Empty;
            List <CreatedExchangeLines> lines = new List <CreatedExchangeLines>();

            if (eo.SalesHeader != null)
            {
                orderNo            = eo.SalesHeader[0].No;
                externalDocumentNo = eo.SalesHeader[0].ExtDocNo;
                orderDate          = eo.SalesHeader[0].DocDate;
                channelName        = eo.SalesHeader[0].SellToCustomerName;
                shipMethod         = eo.SalesHeader[0].ShippingAgent;
                shipMethod        += " " + eo.SalesHeader[0].ShippingService;
                rmaNo          = eo.SalesHeader[0].RMANo1;
                lines          = CreateExchangeOrderLines(eo);
                shipToName     = eo.SalesHeader[0].ShipToName;
                shipToAddress1 = eo.SalesHeader[0].ShipToAddress;
                shipToAddress2 = eo.SalesHeader[0].ShipToAddress2;
                shipToContact  = eo.SalesHeader[0].ShipToContact;
                shipToCity     = eo.SalesHeader[0].ShipToCity;
                shipToZip      = eo.SalesHeader[0].ShipToZip;
                shipToState    = eo.SalesHeader[0].ShipToState;
                shipToCountry  = eo.SalesHeader[0].ShipToCountry;

                ceh.OrderNo            = orderNo;
                ceh.ExternalDocumentNo = externalDocumentNo;
                ceh.OrderDate          = orderDate;
                ceh.ChannelName        = channelName;
                ceh.ShipMethod         = shipMethod;
                ceh.RMANo          = rmaNo;
                ceh.ExchangeLines  = lines;
                ceh.ShipToName     = shipToName;
                ceh.ShipToAddress1 = shipToAddress1;
                ceh.ShipToAddress2 = shipToAddress2;
                ceh.ShipToContact  = shipToContact;
                ceh.ShipToCity     = shipToCity;
                ceh.ShipToZip      = shipToZip;
                ceh.ShipToState    = shipToState;
                ceh.ShipToCountry  = shipToCountry;

                orderNo            = string.Empty;
                externalDocumentNo = string.Empty;
                orderDate          = string.Empty;
                channelName        = string.Empty;
                shipMethod         = string.Empty;
                rmaNo          = string.Empty;
                shipToAddress1 = string.Empty;
                shipToAddress2 = string.Empty;
                shipToContact  = string.Empty;
                shipToCity     = string.Empty;
                shipToZip      = string.Empty;
                shipToState    = string.Empty;
                shipToCountry  = string.Empty;
                lines          = new List <CreatedExchangeLines>();
            }

            return(ceh);
        }