コード例 #1
0
        private void UploadImage(Product p)
        {
            if (ucImageUploadLarge.HasFile)
            {
                var fileName = Text.CleanFileName(Path.GetFileName(ucImageUploadLarge.FileName));

                if (
                    !DiskStorage.CopyProductImage(HccApp.CurrentStore.Id, p.Bvin, ucImageUploadLarge.TempImagePath,
                                                  fileName))
                {
                    ucMessageBox.ShowError("Only .PNG, .JPG, .GIF file types are allowed for icon images");
                }
            }
        }
コード例 #2
0
        private void UploadImage(Product p)
        {
            if (ucImageUploadLarge.HasFile)
            {
                var fileName = Text.CleanFileName(Path.GetFileName(ucImageUploadLarge.FileName));

                if (
                    !DiskStorage.CopyProductImage(HccApp.CurrentStore.Id, p.Bvin, ucImageUploadLarge.TempImagePath,
                                                  fileName))
                {
                    ucMessageBox.ShowError(Localization.GetString("ImageFileTypeError"));
                }
            }
        }
コード例 #3
0
            private void ImportImageFile(string productId, string filename)
            {
                var importPath = ImagesImportPath;

                if (string.IsNullOrEmpty(importPath))
                {
                    importPath = DiskStorage.GetStoreDataVirtualPath(_hccApp.CurrentStore.Id, "import/");
                }

                var filePath   = importPath + filename;
                var mappedPath = HostingEnvironment.MapPath(filePath);

                if (File.Exists(mappedPath))
                {
                    DiskStorage.CopyProductImage(_hccApp.CurrentStore.Id, productId, filePath, filename);
                }
            }