public static OrderOptionInfo PopulateOrderOption(IDataRecord reader) { if (reader == null) { return null; } OrderOptionInfo info = new OrderOptionInfo(); info.OrderId = (string) reader["OrderId"]; info.LookupListId = (int) reader["LookupListId"]; info.LookupItemId = (int) reader["LookupItemId"]; info.ListDescription = (string) reader["ListDescription"]; info.ItemDescription = (string) reader["ItemDescription"]; info.AdjustedPrice = (decimal) reader["AdjustedPrice"]; if (reader["CustomerTitle"] != DBNull.Value) { info.CustomerTitle = (string) reader["CustomerTitle"]; } if (reader["CustomerDescription"] != DBNull.Value) { info.CustomerDescription = (string) reader["CustomerDescription"]; } return info; }
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); } } }