コード例 #1
0
        private void FillDropDowns()
        {
            this.ddlBaseWeight.Items.Clear();
            MeasureWeightCollection measureWeightCollection = MeasureManager.GetAllMeasureWeights();

            foreach (MeasureWeight measureWeight in measureWeightCollection)
            {
                ListItem ddlMeasureWeightItem2 = new ListItem(measureWeight.Name, measureWeight.MeasureWeightID.ToString());
                this.ddlBaseWeight.Items.Add(ddlMeasureWeightItem2);
            }

            this.ddlBaseDimension.Items.Clear();
            MeasureDimensionCollection measureDimensionCollection = MeasureManager.GetAllMeasureDimensions();

            foreach (MeasureDimension measureDimension in measureDimensionCollection)
            {
                ListItem ddlMeasureDimensionItem2 = new ListItem(measureDimension.Name, measureDimension.MeasureDimensionID.ToString());
                this.ddlBaseDimension.Items.Add(ddlMeasureDimensionItem2);
            }

            this.ddlDefaultStoreTimeZone.Items.Clear();
            ReadOnlyCollection <TimeZoneInfo> timeZones = DateTimeHelper.GetSystemTimeZones();

            foreach (TimeZoneInfo timeZone in timeZones)
            {
                string   timeZoneName = timeZone.DisplayName;
                ListItem ddlDefaultStoreTimeZoneItem2 = new ListItem(timeZoneName, timeZone.Id);
                this.ddlDefaultStoreTimeZone.Items.Add(ddlDefaultStoreTimeZoneItem2);
            }

            CommonHelper.FillDropDownWithEnum(this.ddlCustomerNameFormat, typeof(CustomerNameFormatEnum));
        }
コード例 #2
0
        private void BindDimensions()
        {
            MeasureDimensionCollection dimensions = MeasureManager.GetAllMeasureDimensions();

            gvDimensions.DataSource = dimensions;
            gvDimensions.DataBind();
        }
コード例 #3
0
        private static MeasureDimensionCollection DBMapping(DBMeasureDimensionCollection dbCollection)
        {
            if (dbCollection == null)
                return null;

            MeasureDimensionCollection collection = new MeasureDimensionCollection();
            foreach (DBMeasureDimension dbItem in dbCollection)
            {
                MeasureDimension item = DBMapping(dbItem);
                collection.Add(item);
            }

            return collection;
        }
コード例 #4
0
        private static MeasureDimensionCollection DBMapping(DBMeasureDimensionCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            var collection = new MeasureDimensionCollection();

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

            return(collection);
        }
コード例 #5
0
        /// <summary>
        /// Gets all measure dimensions
        /// </summary>
        /// <returns>Measure dimension collection</returns>
        public static MeasureDimensionCollection GetAllMeasureDimensions()
        {
            string key  = MEASUREDIMENSIONS_ALL_KEY;
            object obj2 = NopCache.Get(key);

            if (MeasureManager.CacheEnabled && (obj2 != null))
            {
                return((MeasureDimensionCollection)obj2);
            }

            DBMeasureDimensionCollection dbCollection = DBProviderManager <DBMeasureProvider> .Provider.GetAllMeasureDimensions();

            MeasureDimensionCollection measureDimensionCollection = DBMapping(dbCollection);

            if (MeasureManager.CacheEnabled)
            {
                NopCache.Max(key, measureDimensionCollection);
            }
            return(measureDimensionCollection);
        }