コード例 #1
0
 public List <ProductImagesWM> FindProductImages(Expression <Func <ProductImages, bool> > predicate)
 {
     try
     {
         return(ProductImagesMapping.MaptoWM(_productImagesOperations.FindProductImages(predicate)));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }
コード例 #2
0
 public List <ProductImagesWM> GetAllProductImages()
 {
     try
     {
         return(ProductImagesMapping.MaptoWM(_productImagesOperations.GetAllProductImages()));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }
コード例 #3
0
 public ProductImagesWM GetProductImage(int id)
 {
     try
     {
         return(ProductImagesMapping.MaptoWM(_productImagesOperations.GetProductImage(id)));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }
コード例 #4
0
 public void UpdateProductImage(ProductImagesWM webModel)
 {
     try
     {
         _productImagesOperations.UpdateProductImage(ProductImagesMapping.MapToEntity(webModel));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }
コード例 #5
0
 public void DeteleProductImages(List <ProductImagesWM> webModelList)
 {
     try
     {
         _productImagesOperations.DeleteProductImages(ProductImagesMapping.MapToEntity(webModelList));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }
コード例 #6
0
        public void AddProductImage(string filePath)
        {
            try
            {
                ProductImagesWM webModel = new ProductImagesWM();

                Bitmap file = new Bitmap(filePath);
                webModel.ProductPicture = ImageConverter(file);

                _productImagesOperations.AddProductImage(ProductImagesMapping.MapToEntity(webModel));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }
コード例 #7
0
        public void AddProductImages(string[] filePaths)
        {
            try
            {
                List <ProductImagesWM> webModelList = new List <ProductImagesWM>();

                foreach (string path in filePaths)
                {
                    Bitmap file = new Bitmap(path);
                    webModelList.Add(new ProductImagesWM()
                    {
                        ProductPicture = ImageConverter(file)
                    });
                }

                _productImagesOperations.AddProductImages(ProductImagesMapping.MapToEntity(webModelList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }