Exemplo n.º 1
0
        void FillOrderOptions(OrderInfo orderInfo)
        {
            orderInfo.OrderOptions.Clear();
            IList <OrderLookupItemInfo> selectedOptions = orderOptionList.SelectedOptions;

            if ((selectedOptions != null) && (selectedOptions.Count > 0))
            {
                foreach (OrderLookupItemInfo info in selectedOptions)
                {
                    OrderOptionInfo item = new OrderOptionInfo();
                    item.AdjustedPrice = 0M;
                    if (info.AppendMoney.HasValue)
                    {
                        if (info.CalculateMode.Value == 1)
                        {
                            item.AdjustedPrice = info.AppendMoney.Value;
                        }
                        else
                        {
                            item.AdjustedPrice = orderInfo.GetDiscountedAmount() * (info.AppendMoney.Value / 100M);
                        }
                    }
                    item.CustomerDescription = info.UserInputContent;
                    item.CustomerTitle       = info.UserInputTitle;
                    item.ItemDescription     = info.Name;
                    OrderLookupListInfo orderLookupList = ShoppingProcessor.GetOrderLookupList(info.LookupListId);
                    if (orderLookupList != null)
                    {
                        item.ListDescription = orderLookupList.Name;
                    }
                    item.LookupItemId = info.LookupItemId;
                    item.LookupListId = info.LookupListId;
                    item.OrderId      = orderInfo.OrderId;
                    orderInfo.OrderOptions.Add(item);
                }
            }
        }