private static ShippingStatusCollection DBMapping(DBShippingStatusCollection dbCollection)
        {
            if (dbCollection == null)
                return null;

            ShippingStatusCollection collection = new ShippingStatusCollection();
            foreach (DBShippingStatus dbItem in dbCollection)
            {
                ShippingStatus item = DBMapping(dbItem);
                collection.Add(item);
            }

            return collection;
        }
Exemple #2
0
        private static ShippingStatusCollection DBMapping(DBShippingStatusCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            var collection = new ShippingStatusCollection();

            foreach (var dbItem in dbCollection)
            {
                var item = DBMapping(dbItem);
                collection.Add(item);
            }

            return(collection);
        }
        /// <summary>
        /// Gets all shipping statuses
        /// </summary>
        /// <returns>Shipping status collection</returns>
        public static ShippingStatusCollection GetAllShippingStatuses()
        {
            string key  = string.Format(SHIPPINGTATUSES_ALL_KEY);
            object obj2 = NopCache.Get(key);

            if (ShippingStatusManager.CacheEnabled && (obj2 != null))
            {
                return((ShippingStatusCollection)obj2);
            }

            DBShippingStatusCollection dbCollection = DBProviderManager <DBShippingStatusProvider> .Provider.GetAllShippingStatuses();

            ShippingStatusCollection shippingStatusCollection = DBMapping(dbCollection);

            if (ShippingStatusManager.CacheEnabled)
            {
                NopCache.Max(key, shippingStatusCollection);
            }
            return(shippingStatusCollection);
        }
Exemple #4
0
        protected void FillDropDowns()
        {
            this.ddlOrderStatus.Items.Clear();
            ListItem itemOrderStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");

            this.ddlOrderStatus.Items.Add(itemOrderStatus);
            OrderStatusCollection orderStatuses = OrderManager.GetAllOrderStatuses();

            foreach (OrderStatus orderStatus in orderStatuses)
            {
                ListItem item2 = new ListItem(orderStatus.Name, orderStatus.OrderStatusID.ToString());
                this.ddlOrderStatus.Items.Add(item2);
            }

            this.ddlPaymentStatus.Items.Clear();
            ListItem itemPaymentStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");

            this.ddlPaymentStatus.Items.Add(itemPaymentStatus);
            PaymentStatusCollection paymentStatuses = PaymentStatusManager.GetAllPaymentStatuses();

            foreach (PaymentStatus paymentStatus in paymentStatuses)
            {
                ListItem item2 = new ListItem(paymentStatus.Name, paymentStatus.PaymentStatusID.ToString());
                this.ddlPaymentStatus.Items.Add(item2);
            }

            this.ddlShippingStatus.Items.Clear();
            ListItem itemShippingStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");

            this.ddlShippingStatus.Items.Add(itemOrderStatus);
            ShippingStatusCollection shippingStatuses = ShippingStatusManager.GetAllShippingStatuses();

            foreach (ShippingStatus shippingStatus in shippingStatuses)
            {
                ListItem item2 = new ListItem(shippingStatus.Name, shippingStatus.ShippingStatusID.ToString());
                this.ddlShippingStatus.Items.Add(item2);
            }
        }
        protected void FillDropDowns()
        {
            OrderStatusCollection    orderStatuses    = OrderManager.GetAllOrderStatuses();
            PaymentStatusCollection  paymentStatuses  = PaymentStatusManager.GetAllPaymentStatuses();
            ShippingStatusCollection shippingStatuses = ShippingStatusManager.GetAllShippingStatuses();

            //by order total
            this.ddlOrderStatusByOrderTotal.Items.Clear();
            ListItem itemOrderStatusByOrderTotal = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");

            this.ddlOrderStatusByOrderTotal.Items.Add(itemOrderStatusByOrderTotal);
            foreach (OrderStatus orderStatus in orderStatuses)
            {
                ListItem item2 = new ListItem(OrderManager.GetOrderStatusName(orderStatus.OrderStatusId), orderStatus.OrderStatusId.ToString());
                this.ddlOrderStatusByOrderTotal.Items.Add(item2);
            }

            this.ddlPaymentStatusByOrderTotal.Items.Clear();
            ListItem itemPaymentStatusByOrderTotal = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");

            this.ddlPaymentStatusByOrderTotal.Items.Add(itemPaymentStatusByOrderTotal);
            foreach (PaymentStatus paymentStatus in paymentStatuses)
            {
                ListItem item2 = new ListItem(PaymentStatusManager.GetPaymentStatusName(paymentStatus.PaymentStatusId), paymentStatus.PaymentStatusId.ToString());
                this.ddlPaymentStatusByOrderTotal.Items.Add(item2);
            }

            this.ddlShippingStatusByOrderTotal.Items.Clear();
            ListItem itemShippingStatusByOrderTotal = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");

            this.ddlShippingStatusByOrderTotal.Items.Add(itemShippingStatusByOrderTotal);
            foreach (ShippingStatus shippingStatus in shippingStatuses)
            {
                ListItem item2 = new ListItem(ShippingStatusManager.GetShippingStatusName(shippingStatus.ShippingStatusId), shippingStatus.ShippingStatusId.ToString());
                this.ddlShippingStatusByOrderTotal.Items.Add(item2);
            }


            //by number of orders
            this.ddlOrderStatusByNumberOfOrder.Items.Clear();
            ListItem itemOrderStatusByNumberOfOrder = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");

            this.ddlOrderStatusByNumberOfOrder.Items.Add(itemOrderStatusByNumberOfOrder);
            foreach (OrderStatus orderStatus in orderStatuses)
            {
                ListItem item2 = new ListItem(OrderManager.GetOrderStatusName(orderStatus.OrderStatusId), orderStatus.OrderStatusId.ToString());
                this.ddlOrderStatusByNumberOfOrder.Items.Add(item2);
            }

            this.ddlPaymentStatusByNumberOfOrder.Items.Clear();
            ListItem itemPaymentStatusByNumberOfOrder = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");

            this.ddlPaymentStatusByNumberOfOrder.Items.Add(itemPaymentStatusByNumberOfOrder);
            foreach (PaymentStatus paymentStatus in paymentStatuses)
            {
                ListItem item2 = new ListItem(PaymentStatusManager.GetPaymentStatusName(paymentStatus.PaymentStatusId), paymentStatus.PaymentStatusId.ToString());
                this.ddlPaymentStatusByNumberOfOrder.Items.Add(item2);
            }

            this.ddlShippingStatusByNumberOfOrder.Items.Clear();
            ListItem itemShippingStatusByNumberOfOrder = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");

            this.ddlShippingStatusByNumberOfOrder.Items.Add(itemShippingStatusByNumberOfOrder);
            foreach (ShippingStatus shippingStatus in shippingStatuses)
            {
                ListItem item2 = new ListItem(ShippingStatusManager.GetShippingStatusName(shippingStatus.ShippingStatusId), shippingStatus.ShippingStatusId.ToString());
                this.ddlShippingStatusByNumberOfOrder.Items.Add(item2);
            }
        }