Example #1
0
        public async Task <bool> EditProduct(ProductDTO product, HttpPostedFileBase image)
        {
            bool result = default;

            if (product == null)
            {
                return(result);
            }

            string productImagePath = null;

            if (image != null)
            {
                productImagePath = FileUploaderHelper.UploadImage(image);
            }
            if (!string.IsNullOrWhiteSpace(productImagePath))
            {
                product.Photo = productImagePath;
            }
            if (await WebRequestHelper.SendPutRequest(product))
            {
                result = true;
            }

            return(result);
        }
 private List <string> GetFiles()
 {
     return(FileUploaderHelper.GetFiles());
 }
        //Attachament Management
        public FileResult Download(string file)
        {
            var path = FileUploaderHelper.Download(file);

            return(File(path, "application/force- download", Path.GetFileName(path)));
        }
 public ActionResult DeleteConfirmed(int id, string file, int ticketId)
 {
     TicketAttachmentHelper.Delete(id);
     FileUploaderHelper.Delete(file);
     return(RedirectToAction("Index", new { ticketId }));
 }
Example #5
0
 public ProductAppService()
 {
     FileUploaderHelper = new FileUploaderHelper();
     WebRequestHelper   = new WebRequestHelper();
 }