public AdminSaleRecordController() { this._unitOfWork = new UnitOfWork(_df); this._orderBusiness = new OrderBusiness(_df, this._unitOfWork); this._itemBusiness = new OrderedItemBusiness(_df, this._unitOfWork); this._productBusiness = new ProductBusiness(_df, this._unitOfWork); this._ImageBusiness = new ImageBusiness(_df, this._unitOfWork); }
public CartController() { this._unitOfWork = new UnitOfWork(_df); this._productBusiness = new ProductBusiness(_df, this._unitOfWork); this._ImageBusiness = new ImageBusiness(_df, this._unitOfWork); this._AddToCartBusiness = new AddToCartBusiness(_df, this._unitOfWork); this._WishListBusiness = new WishListBusiness(_df, this._unitOfWork); }
public CompareListController() { this._unitOfWork = new UnitOfWork(_df); this._productBusiness = new ProductBusiness(_df, this._unitOfWork); this._ImageBusiness = new ImageBusiness(_df, this._unitOfWork); this._AddToCartBusiness = new AddToCartBusiness(_df, this._unitOfWork); this._CompareListBusiness = new CompareListBusiness(_df, this._unitOfWork); this._CategoryBusiness = new CategoryBusiness(_df, this._unitOfWork); }
public CheckOutController() { this._unitOfWork = new UnitOfWork(_df); this._userBusiness = new UserBusiness(_df, this._unitOfWork); this._AddToCartBusiness = new AddToCartBusiness(_df, this._unitOfWork); this._productBusiness = new ProductBusiness(_df, this._unitOfWork); this._ImageBusiness = new ImageBusiness(_df, this._unitOfWork); this._OrderBusiness = new OrderBusiness(_df, this._unitOfWork); this._OrderedItemBusiness = new OrderedItemBusiness(_df, this._unitOfWork); }
public LoadPartialController() { this._unitOfWork = new UnitOfWork(_df); this._categoryBusiness = new CategoryBusiness(_df, this._unitOfWork); this._subCategoryBusiness = new SubCategoryBusiness(_df, this._unitOfWork); this._brandBusiness = new BrandBusiness(_df, this._unitOfWork); this._productBusiness = new ProductBusiness(_df, this._unitOfWork); this._sliderBusiness = new SliderBusiness(_df, this._unitOfWork); this._ImageBusiness = new ImageBusiness(_df, this._unitOfWork); }
public DetailController() { this._unitOfWork = new UnitOfWork(_df); this._productBusiness = new ProductBusiness(_df, this._unitOfWork); this._ImageBusiness = new ImageBusiness(_df, this._unitOfWork); this._ReviewBusiness = new ReviewBusiness(_df, this._unitOfWork); this._userBusiness = new UserBusiness(_df, this._unitOfWork); this._CategoryBusiness = new CategoryBusiness(_df, this._unitOfWork); this._SubCategoryBusiness = new SubCategoryBusiness(_df, this._unitOfWork); this._productSizeBusiness = new ProductSizeBusiness(_df, this._unitOfWork); this._productAttributeBusiness = new ProductAttributeBusiness(_df, this._unitOfWork); }
// // GET: /Product/ public AdminProductController() { this._unitOfWork = new UnitOfWork(_df); this._productBusiness = new ProductBusiness(_df, this._unitOfWork); this._productSizeBusiness = new ProductSizeBusiness(_df, this._unitOfWork); this._productAttributeBusiness = new ProductAttributeBusiness(_df, this._unitOfWork); this._brandBusiness = new BrandBusiness(_df, this._unitOfWork); this._categoryBusiness = new CategoryBusiness(_df, this._unitOfWork); this._imageBusiness = new ImageBusiness(_df, this._unitOfWork); this._sliderBusiness = new SliderBusiness(_df, this._unitOfWork); this._subCategoryBusiness = new SubCategoryBusiness(_df, this._unitOfWork); }
private void Dispose(bool dispose) { if (dispose) { if (_userBusiness != null) { _userBusiness = null; } if (_categoryBusiness != null) { _categoryBusiness = null; } if (_imageBusiness != null) { _imageBusiness = null; } if (_orderBusiness != null) { _orderBusiness = null; } if (_orderedProductBusiness != null) { _orderedProductBusiness = null; } if (_productBusiness != null) { _productBusiness = null; } if (_shoppingCartBusiness != null) { _shoppingCartBusiness = null; } if (_repositoryContext != null) { _repositoryContext.Dispose(); _repositoryContext = null; } if (_instance != null) { _instance = null; } } }
public ProductController() { this._unitOfWork = new UnitOfWork(_df); this._categoryBusiness = new CategoryBusiness(_df, this._unitOfWork); this._subCategoryBusiness = new SubCategoryBusiness(_df, this._unitOfWork); this._brandBusiness = new BrandBusiness(_df, this._unitOfWork); this._productBusiness = new ProductBusiness(_df, this._unitOfWork); this._productSizeBusiness = new ProductSizeBusiness(_df, this._unitOfWork); this._productAttributeBusiness = new ProductAttributeBusiness(_df, this._unitOfWork); this._ImageBusiness = new ImageBusiness(_df, this._unitOfWork); this._AddToCartBusiness = new AddToCartBusiness(_df, this._unitOfWork); this._WishListBusiness = new WishListBusiness(_df, this._unitOfWork); this._CompareListBusiness = new CompareListBusiness(_df, this._unitOfWork); }
private void Dispose(bool dispose) { if (dispose) { if (_departmentBusiness != null) { //_connection.Dispose(); _departmentBusiness = null; } if (_archiveBusiness != null) { _archiveBusiness = null; } if (_eventBusiness != null) { _eventBusiness = null; } if (_imageBusiness != null) { _imageBusiness = null; } if (_imgPhotoGalleryBusiness != null) { _imgPhotoGalleryBusiness = null; } if (_photoGalleryBusiness != null) { _photoGalleryBusiness = null; } if (_videoBusiness != null) { _videoBusiness = null; } if (_repositoryContext != null) { _repositoryContext.Dispose(); _repositoryContext = null; } if (_instance != null) { _instance = null; } } }
public async Task <IHttpActionResult> Post([FromBody] GaiaRequest gaiaRequest) { //byte[] bytes = System.IO.File.ReadAllBytes("C:\\Users\\dinowilliam\\Pictures\\Abellha_020.jpg"); //var str = System.Text.Encoding.Default.GetString(bytes); //var data = System.Convert.ToBase64String(bytes); var ImageBusiness = new ImageBusiness(); var image = new Image(); image.Name = gaiaRequest.NomeArquivo; image.ImageData = gaiaRequest.DataArquivo; ImageBusiness.ImageProcess(image); var gaiaResponse = new GaiaResponse(); return(Json(gaiaResponse)); }
void addImage(string fullFileName) { string fileName = "F" + Path.GetFileNameWithoutExtension(fullFileName); ProductBusiness productBusiness = new ProductBusiness(); long? productId = productBusiness.GetProductIdFromCode(fileName); if (productId == null) { absentProductCount++; return; } else { existProductCount++; } Guid uniqueId = Guid.NewGuid(); Image imgOriginal = Bitmap.FromFile(fullFileName); string fileTypeStr = Path.GetExtension(fullFileName).Replace(".", "").ToLower(); Enums.FileTypes fileTypeId = (Enums.FileTypes)Enum.Parse(typeof(Enums.FileTypes), fileTypeStr); string fileNameUnique = uniqueId.ToString().ToUpper() + "." + fileTypeId.ToString(); // We need to resize if image size higher than 1024. if (imgOriginal.Height > 640 && imgOriginal.Width > 480) { // We save the original image in case of any trouble in advance. string filePathOriginal = Path.Combine(Stc.ProductImageSourceUrl, "original", fileNameUnique); imgOriginal.Save(filePathOriginal); Image imgConverted = Img.FixedSize(imgOriginal, 640, 480); string filePath = Path.Combine(Stc.ProductImageSourceUrl, fileNameUnique); imgConverted.Save(filePath); imgConverted.Dispose(); } else { string filePath = Path.Combine(Stc.ProductImageSourceUrl, fileNameUnique); imgOriginal.Save(filePath); } Image thumbnail = Img.FixedSize(imgOriginal, 96, 96); string filePathThumbnail = Path.Combine(Stc.ProductImageSourceUrl, "thumbnail", fileNameUnique); thumbnail.Save(filePathThumbnail); thumbnail.Dispose(); Mh.Sessions.Session pseudoSession = new Sessions.Session(); pseudoSession.RealPerson = new Sessions.SessionRealPerson(); pseudoSession.RealPerson.Id = 1; // ismail pseudoSession.RealPerson.LanguageId = Enums.Languages.xTurkish; //ProductUpdateBo updateBo = new ProductUpdateBo() //{ // ProductId = productId.Value, // ProductUpdateTypeId = Enums.ProductUpdateTypes.xImage, // ImageUniqueId = uniqueId, // ImageFileTypeId = fileTypeId, // Session = pseudoSession //}; //ResponseBo responseBo = productBusiness.Update(updateBo); ImageBo imageBo = new ImageBo { ImageTypeId = Enums.ImageTypes.Product, UniqueId = uniqueId, FileTypeId = fileTypeId, ProductId = productId, //PersonId = personId, Session = pseudoSession }; ImageBusiness imageBusiness = new ImageBusiness(); ResponseBo responseBo = imageBusiness.Save(imageBo); imgOriginal.Dispose(); }