public IActionResult Editar(ProductParentEditViewModel productParent)
        {
            if (!ModelState.IsValid)
            {
                ViewBag.Brands     = _brandService.GetSelectList();
                ViewBag.Categories = _categoryService.GetSelectList();
                return(View(productParent));
            }

            var result = _productParentService.Edit(productParent);

            TempData.Put("Notification", result);
            return(RedirectToAction("Principal"));
        }
        public NotificationViewModel Edit(ProductParentEditViewModel product)
        {
            var existingProductParent = _unitOfWork.ProductParent.Get(p => p.Id == product.Id).FirstOrDefault();

            existingProductParent.Name       = product.Name;
            existingProductParent.Code       = product.Code;
            existingProductParent.CategoryId = product.CategoryId;
            existingProductParent.BrandId    = product.BrandId;

            _unitOfWork.ProductParent.Edit(existingProductParent);
            _unitOfWork.Commit();

            _fileService.UploadFiles(product.Files, existingProductParent.Id, "Product");
            return(new NotificationViewModel()
            {
                Status = true,
                Title = "Sucesso!",
                Message = "Vista Explodida editada com sucesso."
            });
        }