/// <summary>
        /// Deletes a vendor review
        /// </summary>
        /// <param name="vendorReview">Vendor Review</param>
        public virtual void DeleteVendorReview(VendorReviewRecord vendorReview)
        {
            if (vendorReview == null)
            {
                throw new ArgumentNullException(nameof(vendorReview));
            }

            _vendorReviewRepository.Delete(vendorReview);
        }
        public virtual IActionResult VendorReviewAdd(VendorReviewModel model)
        {
            var vendor = _vendorService.GetVendorById(model.VendorID);

            if (vendor != null)
            {
                model.VendorName   = vendor.Name;
                model.VendorSeName = _urlRecordService.GetSeName(vendor);
            }

            var customerID = _workContext.CurrentCustomer.Id;

            if (ModelState.IsValid)
            {
                var vendorReview = new VendorReviewRecord
                {
                    CustomerID = customerID,
                    VendorID   = model.VendorID,
                    StoreID    = model.StoreID,
                    IsApproved = model.IsApproved,
                    Title      = model.Title,
                    ReviewText = model.ReviewText,
                    ReplyText  = model.ReplyText,
                    CustomerNotifiedOfReply = model.CustomerNotifiedOfReply,
                    Rating          = model.Rating,
                    HelpfulYesTotal = model.HelpfulYesTotal,
                    HelpfulNoTotal  = model.HelpfulNoTotal,
                    CreatedOnUtc    = DateTime.Now
                };

                _vendorReviewService.InsertVendorReview(vendorReview);

                model.SuccessfullyVendorReviewed = true;
                model.Result = _localizationService.GetResource("VendorEnhanced.SuccessfullyVendorReviewed");
            }

            return(View("~/Plugins/Nop.Plugin.Misc.VendorEnhanced/Views/VendorReview.cshtml", model));
        }