Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inOrder"></param>
        /// <returns></returns>
        WebOrderDBInfo createWebOrderDBInfo(WebOrder inOrder)
        {
            WebOrderDBInfo result = new WebOrderDBInfo();

            //....................................................

            DTO_WebOrderHeader  headerSection  = inOrder.GetCompleteHeaderSection();
            DTO_WebOrderAccount accountSection = inOrder.GetCompleteAccountSection();

            result.GUID         = inOrder.Handle;
            result.Name         = accountSection.Name;
            result.StoreName    = headerSection.StoreName;
            result.OrderDate    = headerSection.OrderDate;
            result.ExpectedDate = headerSection.ExpectedDate;
            result.Status       = WebOrderDB.WebOrderStatus.ewosReceived;

            result.Recipient  = accountSection.Delivery.Recipient;
            result.StreetNo   = accountSection.Delivery.StreetNo;
            result.StreetName = accountSection.Delivery.StreetName;
            result.Suburb     = accountSection.Delivery.Suburb;
            result.City       = accountSection.Delivery.City;
            result.Country    = accountSection.Delivery.Country;
            result.Note       = accountSection.Delivery.Note;
            result.Phone      = accountSection.Delivery.Phone;

            result.Comments        = accountSection.Comments;
            result.PaymentRequired = accountSection.Payments.PaymentRequired;

            result.OrderTotal = headerSection.OrderTotal;
            result.Email      = accountSection.Email;
            result.OrderType  = accountSection.OrderType;
            //....................................................

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inOrder"></param>
        /// <returns></returns>
        WebOrderDBItem[] createWebOrderDBItems(WebOrder inOrder, WebOrderDB inWebOrderDB, int inMenuKey) //changes for menu_key
        {
            List <WebOrderDBItem> result = new List <WebOrderDBItem>();

            //....................................................

            DTO_WebOrderAccount accountSection = inOrder.GetCompleteAccountSection();
            DTO_WebOrderHeader  headerSection  = inOrder.GetCompleteHeaderSection();

            foreach (DTO_WebOrderItem orderItem in accountSection.OrderItems)
            {
                WebOrderDBItem item = new WebOrderDBItem();
                item.ThirdPartyCodeKey = dbGetThirdPartyCodeKey(orderItem.UID, inWebOrderDB, inMenuKey); //changes for menu_key
                item.Qty         = orderItem.Qty;
                item.Price       = orderItem.BasePrice;
                item.PriceLevel0 = orderItem.BasePrice;
                item.PriceLevel1 = orderItem.BasePrice;
                item.TabName     = accountSection.Name;
                item.TimeStamp   = headerSection.OrderDate;
                item.Note        = orderItem.Note;

                //--------------------------------------------------------
                // Options are ignored in this version of Webmate
                //--------------------------------------------------------

                /*
                 * foreach (DTO_WebOrderItemOption orderItemOption in orderItem.ItemOptions)
                 * {
                 *  WebOrderDBItemOption option = new WebOrderDBItemOption();
                 *  option.OptionKey = Convert.ToInt32(orderItemOption.UID);
                 *  item.ItemOptions.Add(option);
                 * }
                 */

                foreach (DTO_WebOrderItemSide orderItemSide in orderItem.ItemSides)
                {
                    WebOrderDBItemSide side = new WebOrderDBItemSide();
                    side.ThirdPartyCodeKey = dbGetThirdPartyCodeKey(orderItemSide.UID, inWebOrderDB, inMenuKey); //changes for menu_key
                    side.Qty               = orderItemSide.Qty;
                    side.Price             = orderItemSide.BasePrice;
                    side.PriceLevel0       = orderItemSide.BasePrice;
                    side.PriceLevel1       = orderItemSide.BasePrice;
                    side.TimeStamp         = headerSection.OrderDate;
                    side.TransactionNumber = orderItemSide.UID;
                    side.TabName           = accountSection.Name;
                    side.Note              = orderItem.Note;
                    item.ItemSides.Add(side);
                }

                result.Add(item);
            }

            //....................................................

            return(result.ToArray());
        }