public List <OrderPackage> FindForOrder(string orderBvin)
        {
            var orderGuid = DataTypeHelper.BvinToGuid(orderBvin);

            return(FindListPoco(q =>
            {
                return q.Where(y => y.OrderId == orderGuid)
                .OrderBy(y => y.Id);
            }));
        }
        internal List <ProductPropertyValue> FindByProductId(string productId, long storeId)
        {
            var productBvin = DataTypeHelper.BvinToGuid(productId);

            return(FindListPoco(q =>
            {
                return q.Where(y => y.Item.StoreId == storeId)
                .Where(y => y.Item.ProductBvin == productBvin);
            }));
        }
 /// <summary>
 ///     Copy view model to the database object model
 /// </summary>
 /// <param name="data"><see cref="hcc_ProductFileXProduct" /> instance</param>
 /// <param name="model"><see cref="ProductFileAssociation" /> instance</param>
 protected override void CopyModelToData(hcc_ProductFileXProduct data, ProductFileAssociation model)
 {
     data.Id               = model.Id;
     data.StoreId          = model.StoreId;
     data.AvailableMinutes = model.AvailableMinutes;
     data.ProductFileId    = DataTypeHelper.BvinToGuid(model.FileId);
     data.LastUpdated      = model.LastUpdatedUtc;
     data.MaxDownloads     = model.MaxDownloads;
     data.ProductId        = DataTypeHelper.BvinToGuid(model.ProductId);
 }
        public bool UnrelateProducts(string productId, string relatedProductId)
        {
            var storeId            = Context.CurrentStore.Id;
            var productGuid        = DataTypeHelper.BvinToGuid(productId);
            var relatedProductGuid = DataTypeHelper.BvinToGuid(relatedProductId);

            return
                (Delete(
                     y => y.RelatedProductId == relatedProductGuid && y.ProductId == productGuid && y.StoreId == storeId));
        }
 protected override void CopyModelToData(hcc_ProductRelationship data, ProductRelationship model)
 {
     data.Id                   = model.Id;
     data.StoreId              = model.StoreId;
     data.IsSubstitute         = model.IsSubstitute;
     data.MarketingDescription = model.MarketingDescription;
     data.ProductId            = DataTypeHelper.BvinToGuid(model.ProductId);
     data.RelatedProductId     = DataTypeHelper.BvinToGuid(model.RelatedProductId);
     data.SortOrder            = model.SortOrder;
 }
Esempio n. 6
0
        /// <summary>
        ///     Find list of option items by given option id
        /// </summary>
        /// <param name="optionId">option unique identifier</param>
        /// <returns></returns>
        public List <OptionItem> FindForOption(string optionId)
        {
            var optionGuid = DataTypeHelper.BvinToGuid(optionId);

            return(FindListPoco(q =>
            {
                return q.Where(y => y.Item.OptionBvin == optionGuid)
                .OrderBy(y => y.Item.SortOrder);
            }));
        }
Esempio n. 7
0
        public List <OrderCoupon> FindForOrder(string orderBvin)
        {
            var guid = DataTypeHelper.BvinToGuid(orderBvin);

            return(FindListPoco(q =>
            {
                return q.Where(y => y.OrderBvin == guid)
                .OrderBy(y => y.Id);
            }));
        }
Esempio n. 8
0
 protected override void CopyModelToData(hcc_OrderNote data, OrderNote model)
 {
     data.AuditDate      = model.AuditDate;
     data.Id             = model.Id;
     data.IsPublic       = model.IsPublic;
     data.LastUpdatedUtc = model.LastUpdatedUtc;
     data.Note           = model.Note;
     data.OrderId        = DataTypeHelper.BvinToGuid(model.OrderID);
     data.StoreId        = model.StoreId;
 }
Esempio n. 9
0
        /// <summary>
        ///     Update optionitem
        /// </summary>
        /// <param name="item"><see cref="OptionItem" /> reference</param>
        /// <returns>Returns true if optionitem updated successfully.</returns>
        public bool Update(OptionItem item)
        {
            if (item.IsDefault)
            {
                ClearOtherDefaultItems(item);
            }
            var guid = DataTypeHelper.BvinToGuid(item.Bvin);

            return(base.Update(item, y => y.bvin == guid));
        }
Esempio n. 10
0
 protected override void CopyModelToData(hcc_WishListItem data, WishListItem model)
 {
     data.Id            = model.Id;
     data.CustomerId    = model.CustomerId;
     data.LastUpdated   = model.LastUpdatedUtc;
     data.ProductId     = DataTypeHelper.BvinToGuid(model.ProductId);
     data.Quantity      = model.Quantity;
     data.SelectionData = model.SelectionData.SerializeToXml();
     data.StoreId       = model.StoreId;
 }
Esempio n. 11
0
        public List <ContentBlock> FindManyForContentColumns(List <string> bvins)
        {
            var guids = bvins.Select(b => DataTypeHelper.BvinToGuid(b)).ToList();

            return(FindListPoco(q =>
            {
                return q.Where(cb => guids.Contains(cb.Item.ColumnID))
                .OrderBy(cb => cb.Item.SortOrder);
            }));
        }
 protected override void CopyModelToData(hcc_ProductVolumeDiscounts data, ProductVolumeDiscount model)
 {
     data.Amount       = model.Amount;
     data.bvin         = DataTypeHelper.BvinToGuid(model.Bvin);
     data.DiscountType = (int)model.DiscountType;
     data.LastUpdated  = model.LastUpdated;
     data.ProductID    = DataTypeHelper.BvinToGuid(model.ProductId);
     data.Qty          = model.Qty;
     data.StoreId      = model.StoreId;
 }
Esempio n. 13
0
 protected override void CopyModelToData(hcc_Variants data, Variant model)
 {
     data.bvin           = DataTypeHelper.BvinToGuid(model.Bvin);
     data.Price          = model.Price;
     data.ProductId      = DataTypeHelper.BvinToGuid(model.ProductId);
     data.SelectionData  = Json.ObjectToJson(model.Selections);
     data.Sku            = model.Sku;
     data.StoreId        = model.StoreId;
     data.CustomProperty = model.CustomProperty;
 }
Esempio n. 14
0
        public bool Update(Variant c)
        {
            if (c.StoreId != Context.CurrentStore.Id)
            {
                return(false);
            }
            var guid = DataTypeHelper.BvinToGuid(c.Bvin);

            return(Update(c, y => y.bvin == guid));
        }
Esempio n. 15
0
        public List <ProductInventory> FindByProductId(string productId, long storeId)
        {
            var productBvin = DataTypeHelper.BvinToGuid(productId);

            return(FindListPoco(q =>
            {
                return q.Where(y => y.StoreId == storeId)
                .Where(y => y.ProductBvin == productBvin);
            }));
        }
Esempio n. 16
0
 protected override void CopyModelToItem(JoinedItem <hcc_Country, hcc_CountryTranslation> data, Country model)
 {
     data.Item.CountryId   = DataTypeHelper.BvinToGuid(model.Bvin);
     data.Item.CultureCode = model.CultureCode;
     data.Item.SystemName  = model.SystemName;
     data.Item.IsoCode     = model.IsoCode;
     data.Item.IsoAlpha3   = model.IsoAlpha3;
     data.Item.IsoNumeric  = model.IsoNumeric;
     data.Item.PostalCodeValidationRegex = model.PostalCodeValidationRegex;
 }
 public List<OrderNote> FindForOrders(List<string> orderBvins)
 {
     var orderGuids = orderBvins.Select(bvin => DataTypeHelper.BvinToGuid(bvin)).ToList();
     return FindListPoco(q =>
     {
         return q.Where(y => orderGuids.Contains(y.OrderId))
             .OrderBy(y => y.OrderId)
             .ThenBy(y => y.Id);
     });
 }
Esempio n. 18
0
 protected override void CopyModelToData(hcc_Manufacturer data, VendorManufacturer model)
 {
     data.Address                 = model.Address.ToXml(true);
     data.bvin                    = DataTypeHelper.BvinToGuid(model.Bvin);
     data.DisplayName             = model.DisplayName;
     data.DropShipEmailTemplateId = model.DropShipEmailTemplateId;
     data.EmailAddress            = model.EmailAddress;
     data.LastUpdated             = model.LastUpdated;
     data.StoreId                 = model.StoreId;
 }
Esempio n. 19
0
 protected override void CopyModelToData(hcc_OrderCoupon data, OrderCoupon model)
 {
     data.Id             = model.Id;
     data.CouponCode     = model.CouponCode;
     data.IsUsed         = model.IsUsed;
     data.LastUpdatedUtc = model.LastUpdatedUtc;
     data.OrderBvin      = DataTypeHelper.BvinToGuid(model.OrderBvin);
     data.StoreId        = model.StoreId;
     data.UserId         = model.UserId;
 }
        public List <RMA> FindForOrder(string orderBvin)
        {
            var orderGuid = DataTypeHelper.BvinToGuid(orderBvin);

            return(FindListPoco(q =>
            {
                return q.Where(y => y.OrderBvin == orderGuid)
                .OrderBy(y => y.DateOfReturn);
            }));
        }
Esempio n. 21
0
        public List <RMAItem> FindForRMA(string rmaBvin)
        {
            var rmaId = DataTypeHelper.BvinToGuid(rmaBvin);

            return(FindListPoco(q =>
            {
                return q.Where(y => y.RMABvin == rmaId)
                .OrderBy(y => y.LastUpdated);
            }));
        }
Esempio n. 22
0
        /// <summary>
        ///     Find products by product GUID. It will return the list of the products added to bundle
        /// </summary>
        /// <param name="productId">Product GUID string</param>
        /// <returns>Returns the list of the products in bundle</returns>
        public List <BundledProduct> FindForProduct(string productId)
        {
            var productGuid = DataTypeHelper.BvinToGuid(productId);

            return(FindListPoco(q =>
            {
                return q.Where(y => y.ProductId == productGuid)
                .OrderBy(y => y.SortOrder);
            }));
        }
        public bool Update(ProductVolumeDiscount c)
        {
            if (c.StoreId != Context.CurrentStore.Id)
            {
                return(false);
            }
            c.LastUpdated = DateTime.UtcNow;
            var guid = DataTypeHelper.BvinToGuid(c.Bvin);

            return(Update(c, y => y.bvin == guid));
        }
        internal List <ProductVolumeDiscount> FindByProductId(string productId, long storeId)
        {
            var productGuid = DataTypeHelper.BvinToGuid(productId);

            return(FindListPoco(q =>
            {
                return q.Where(y => y.StoreId == storeId)
                .Where(y => y.ProductID == productGuid)
                .OrderBy(y => y.Qty);
            }));
        }
 protected override void CopyModelToData(hcc_ProductImage data, ProductImage model)
 {
     data.AlternateText = model.AlternateText;
     data.bvin          = DataTypeHelper.BvinToGuid(model.Bvin);
     data.Caption       = model.Caption;
     data.FileName      = model.FileName;
     data.LastUpdated   = model.LastUpdatedUtc;
     data.ProductID     = DataTypeHelper.BvinToGuid(model.ProductId);
     data.SortOrder     = model.SortOrder;
     data.StoreId       = model.StoreId;
 }
Esempio n. 26
0
        public List <WishListItem> FindByProductIdPaged(string productId, int pageNumber, int pageSize, long storeId)
        {
            var productGuid = DataTypeHelper.BvinToGuid(productId);

            return(FindListPoco(q =>
            {
                return q.Where(y => y.ProductId == productGuid)
                .Where(y => y.StoreId == storeId)
                .OrderBy(y => y.ProductId);
            }, pageNumber, pageSize));
        }
        public List <RMA> FindMany(List <string> bvins)
        {
            var storeId = Context.CurrentStore.Id;
            var guids   = bvins.Select(bvin => DataTypeHelper.BvinToGuid(bvin)).ToList();

            return(FindListPoco(q =>
            {
                return q.Where(y => guids.Contains(y.bvin))
                .Where(y => y.StoreId == storeId).OrderBy(y => y.LastUpdated);
            }));
        }
        public List <RMA> FindForOrders(List <string> orderBvins)
        {
            var orderGuids = orderBvins.Select(bvin => DataTypeHelper.BvinToGuid(bvin)).ToList();

            return(FindListPoco(q =>
            {
                return q.Where(y => orderGuids.Contains(y.OrderBvin))
                .OrderBy(y => y.OrderBvin)
                .ThenBy(y => y.DateOfReturn);
            }));
        }
Esempio n. 29
0
        public bool Update(VendorManufacturer c)
        {
            if (c.StoreId != Context.CurrentStore.Id)
            {
                return(false);
            }
            c.LastUpdated = DateTime.UtcNow;
            var guid = DataTypeHelper.BvinToGuid(c.Bvin);

            return(Update(c, y => y.bvin == guid));
        }
Esempio n. 30
0
        /// <summary>
        ///     Find list of products by list of ids
        /// </summary>
        /// <param name="productIds">List of product GUIDs</param>
        /// <returns></returns>
        public List <BundledProduct> FindForProducts(List <string> productIds)
        {
            var productGuids = productIds.Select(id => DataTypeHelper.BvinToGuid(id)).ToList();

            return(FindListPoco(q =>
            {
                return q.Where(y => productGuids.Contains(y.ProductId))
                .OrderBy(y => y.ProductId)
                .ThenBy(y => y.SortOrder);
            }));
        }