示例#1
0
        public List <ShippingServiceRateType> GetAllRateTypes()
        {
            //List<ShippingServiceRateType> rateTypes = this.ShippingServiceRateTypeCollectionByShippingServiceId;
            //rateTypes.Sort((left, right) => left.DisplayName.CompareTo(right.DisplayName));
            //return rateTypes;

            var q = new ShippingServiceRateTypeQuery();

            q.Where(q.ShippingServiceId == this.Id);
            q.OrderBy(q.SortOrder.Ascending, q.DisplayName.Ascending);

            var collection = new ShippingServiceRateTypeCollection();

            collection.Load(q);

            return(collection.ToList());
        }
示例#2
0
        public static List <ShippingServiceRateType> GetList(int storeId)
        {
            //SELECT
            //rt.*
            //FROM DNNspot_Store_ShippingServiceRateType rt
            //INNER JOIN DNNspot_Store_ShippingService s ON rt.ShippingServiceId = s.Id
            //WHERE s.StoreId = 1

            var rt = new ShippingServiceRateTypeQuery("rt");
            var s  = new ShippingServiceQuery("s");

            rt.Select(rt).InnerJoin(s).On(rt.ShippingServiceId == s.Id).Where(s.StoreId == storeId);
            rt.OrderBy(rt.DisplayName.Ascending);

            var collection = new ShippingServiceRateTypeCollection();

            collection.Load(rt);

            return(collection.ToList());
        }