public List <ProductImagesWM> FindProductImages(Expression <Func <ProductImages, bool> > predicate) { try { return(ProductImagesMapping.MaptoWM(_productImagesOperations.FindProductImages(predicate))); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
public List <ProductImagesWM> GetAllProductImages() { try { return(ProductImagesMapping.MaptoWM(_productImagesOperations.GetAllProductImages())); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
public ProductImagesWM GetProductImage(int id) { try { return(ProductImagesMapping.MaptoWM(_productImagesOperations.GetProductImage(id))); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
public void UpdateProductImage(ProductImagesWM webModel) { try { _productImagesOperations.UpdateProductImage(ProductImagesMapping.MapToEntity(webModel)); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
public void DeteleProductImages(List <ProductImagesWM> webModelList) { try { _productImagesOperations.DeleteProductImages(ProductImagesMapping.MapToEntity(webModelList)); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
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()); } }
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()); } }