Пример #1
0
        public static async Task <long> AddProductImage(productimage image)
        {
            using (var db = new VendorsConfigEntities())
            {
                db.productimages.Add(image);
                await db.SaveChangesAsync();

                return(image.Id);
            }
        }
Пример #2
0
        private async Task InsertProductImages(IList <string> rowValues, long vendorProductId)
        {
            foreach (var imageConfig in _imagefileconfig)
            {
                var image = new productimage
                {
                    ImagePath       = rowValues[(int)imageConfig.ColumnNo],
                    ImageType       = imageConfig.ImageType,
                    VendorProductId = vendorProductId
                };

                await VendorsConfig.AddProductImage(image);
            }
        }
Пример #3
0
        private async Task InsertProductImages(long vendorProductId, int row)
        {
            foreach (var imageConfig in _imagefileconfig)
            {
                var image = new productimage
                {
                    ImagePath       = Convert.ToString((_range.Cells[row, (imageConfig.ColumnNo + 1)] as Range).Value2),
                    ImageType       = imageConfig.ImageType,
                    VendorProductId = vendorProductId
                };

                await VendorsConfig.AddProductImage(image);
            }
        }
Пример #4
0
        private void addProductImage(string fileName, string eisSku, int order, string caption, string imageType, bool isPush = false)
        {
            var productImage = new productimage
            {
                EisSKU    = eisSku,
                Caption   = caption,
                FileName  = fileName,
                ImageType = imageType,
                Order_    = order
            };

            _context.productimages.Add(productImage);

            if (!isPush)
            {
                _context.SaveChanges();
            }
        }