//contact vendor page
        public virtual async Task <IActionResult> ContactVendor(string vendorId, [FromServices] IVendorService vendorService)
        {
            if (!_vendorSettings.AllowCustomersToContactVendors)
            {
                return(RedirectToRoute("HomePage"));
            }

            var vendor = await vendorService.GetVendorById(vendorId);

            if (vendor == null || !vendor.Active || vendor.Deleted)
            {
                return(RedirectToRoute("HomePage"));
            }

            var model = await _commonViewModelService.PrepareContactVendor(vendor);

            return(View(model));
        }
Beispiel #2
0
        //contact vendor page
        public virtual IActionResult ContactVendor(string vendorId)
        {
            if (!_vendorSettings.AllowCustomersToContactVendors)
            {
                return(RedirectToRoute("HomePage"));
            }

            var vendor = EngineContext.Current.Resolve <IVendorService>().GetVendorById(vendorId);

            if (vendor == null || !vendor.Active || vendor.Deleted)
            {
                return(RedirectToRoute("HomePage"));
            }

            var model = _commonViewModelService.PrepareContactVendor(vendor);

            return(View(model));
        }