コード例 #1
0
        /// <summary>
        /// Add many image in product image table
        /// </summary>
        /// <param name="httpPostedFileBases">list image post</param>
        /// <param name="ProVaId">Product variation id</param>
        public void AddImageOnProductImageTable(IEnumerable <HttpPostedFileBase> httpPostedFileBases, Guid ProVaId)
        {
            string local = Server.MapPath("~/Content/img/product-men");

            foreach (var file in httpPostedFileBases)
            {
                var model = new ProductImage
                {
                    Id                  = Guid.NewGuid(),
                    ImagePath           = _productImageService.UpFile(file, local),
                    ProductVariation_Id = ProVaId,
                    CreatedDate         = DateTime.Now,
                    IsActive            = true
                };
                _productImageService.Insert(model);
            }
        }