Esempio n. 1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!IsPostBack)
            {
                OrderStatusSelectorControl.LoadOrderStatuses(_order.StoreId);
                LoadEmails();

                if (!OrderStatusSelectorControl.Items.TrySelectByValue(_order.OrderStatusId))
                {
                    OrderStatus orderStatus = OrderStatusService.Instance.Get(_order.StoreId, _order.OrderStatusId);
                    if (orderStatus != null)
                    {
                        OrderStatusSelectorControl.Items.Add(new ListItem("* " + orderStatus.Name, orderStatus.Id.ToString(CultureInfo.InvariantCulture)));
                        OrderStatusSelectorControl.Items.TrySelectByValue(_order.OrderStatusId);
                    }
                }

                PaymentMethod paymentMethod = null;
                if (_order.PaymentInformation.PaymentMethodId != null)
                {
                    paymentMethod = PaymentMethodService.Instance.Get(_order.StoreId, _order.PaymentInformation.PaymentMethodId.Value);
                    paymentMethod.GetStatus(_order);
                    LblTransactionPaymentName.Text = paymentMethod.Name;
                    BtnFinalize.Visible            = !_order.IsFinalized;
                }
                LblCartName.Text = _order.CartNumber;
                SetTransactionPayment(paymentMethod);
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!IsPostBack)
            {
                PnlLicenseCheck.Visible = !LicenseService.Instance.ValidateLicenseFeatures(Feature.Basic);

                LoadOrderStages();
                PaymentStatusSelectorControl.LoadPaymentStatuses();
                OrderStatusSelectorControl.LoadOrderStatuses(StoreId);
                OrderStatusSelectorControl.CssClass = "guiInputText guiInputSmallSize";
                OrderStatusSelectorControl.Items.Insert(0, new ListItem("----", ""));

                #region Load search filters in session

                string       orderNumber   = (string)Session["Search_OrderNumber"];
                string       firstName     = (string)Session["Search_FirstName"];
                string       lastName      = (string)Session["Search_LastName"];
                PaymentState?paymentStatus = (PaymentState?)Session["Search_PaymentStatus"];
                bool?        orderStage    = (bool?)Session["Search_OrderStage"];
                long?        pageSize      = (long?)Session["Search_PageSize"];
                DateTime?    startDate     = (DateTime?)Session["Search_StartDate"];
                DateTime?    endDate       = (DateTime?)Session["Search_EndDate"];

                TxtOrderNumber.Text = orderNumber;
                TxtFirstName.Text   = firstName;
                TxtLastName.Text    = lastName;
                PaymentStatusSelectorControl.Items.TrySelectByValue(paymentStatus);
                DrpOrderStages.Items.TrySelectByValue(orderStage);
                DrpPageSize.Items.TrySelectByValue(pageSize);
                DPStart.DateTime = startDate ?? DateTime.MinValue;

                if (endDate != null)
                {
                    DPEnd.DateTime = endDate.Value.AddDays(-1);
                }

                #endregion

                CurrentPage = 1;
                Search();
            }
        }