Exemplo n.º 1
0
        private void BindOrderStatuses()
        {
            IList <OrderStatus> orderStatuses = OrderStatusDataSource.LoadAll("Name");
            int index = orderStatuses.IndexOf(_OrderStatusId);

            if (index > -1)
            {
                orderStatuses.RemoveAt(index);
            }
            OrderStatusList.DataSource = orderStatuses;
            OrderStatusList.DataBind();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Binds the form.
        /// </summary>
        private void BindForm()
        {
            /*
             * WorkflowList.DataSource = WorkflowConfiguration.Instance.Workflows;
             * WorkflowList.DataBind();
             * */

            // Bind Status
            OrderStatusList.DataSource = OrderStatusManager.GetOrderStatus();
            OrderStatusList.DataBind();

            // Bind Currency
            OrderCurrencyList.DataSource = CatalogContext.Current.GetCurrencyDto();
            OrderCurrencyList.DataBind();

            OrderGroup order = _order;

            if (order != null)
            {
                LoadAddresses();

                ComboBoxItem item = CustomerName.Items.FindByValue(order.CustomerId.ToString());
                if (item != null)
                {
                    CustomerName.SelectedItem = item;
                }
                else
                {
                    ComboBoxItem newItem = new ComboBoxItem();
                    newItem.Text  = order.CustomerName;
                    newItem.Value = order.CustomerId.ToString();
                    CustomerName.Items.Add(newItem);
                    CustomerName.SelectedItem = newItem;
                }

                CustomerName.Text = order.CustomerName;
                //TrackingNo.Text = order.TrackingNumber;

                OrderSubTotal.Text      = CurrencyFormatter.FormatCurrency(order.SubTotal, order.BillingCurrency);
                OrderTaxTotal.Text      = CurrencyFormatter.FormatCurrency(order.TaxTotal, order.BillingCurrency);
                OrderShippingTotal.Text = CurrencyFormatter.FormatCurrency(order.ShippingTotal, order.BillingCurrency);
                OrderHandlingTotal.Text = CurrencyFormatter.FormatCurrency(order.HandlingTotal, order.BillingCurrency);

                OrderTotal.Text = CurrencyFormatter.FormatCurrency(order.Total, order.BillingCurrency);
                //OrderExpires.Value = order.ExpirationDate;

                if (_order.OrderForms.Count > 0)
                {
                    if (AddressesList.Items.Count > 0)
                    {
                        ManagementHelper.SelectListItem(AddressesList, _order.OrderForms[0].BillingAddressId);
                    }
                    DiscountTotal.Text = CurrencyFormatter.FormatCurrency(order.OrderForms[0].DiscountAmount, order.BillingCurrency);
                }

                ManagementHelper.SelectListItem(OrderStatusList, order.Status);
                ManagementHelper.SelectListItem(OrderCurrencyList, order.BillingCurrency);

                /*
                 * if (po.Status == OrderConfiguration.Instance.NewOrderStatus)
                 * {
                 *      WorkflowDisabledDescription.Visible = false;
                 *      RunWorkflowButton.Enabled = true;
                 * }
                 * else
                 * {
                 *      RunWorkflowButton.Enabled = false;
                 *      WorkflowDisabledDescription.Visible = true;
                 *      WorkflowDisabledDescription.Text = String.Format("Can only run workflow for orders with \"{0}\" status", OrderConfiguration.Instance.NewOrderStatus);
                 * }
                 * */
            }
            else
            {
                ManagementHelper.SelectListItem(OrderCurrencyList, CommonSettingsManager.GetDefaultCurrency());
            }
        }