public ActionResult SaveVendor(ExtendedVendorModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageVendors))
            {
                return(Content("Access denied"));
            }

            var q = _extendedVendorService.GetExtendedVendor(model.VendorId) ?? new Domain.ExtendedVendor();

            q.AddressLine1         = model.AddressLine1;
            q.AddressLine2         = model.AddressLine2;
            q.City                 = model.City;
            q.CountryId            = model.CountryId;
            q.HelpfulnessEnabled   = model.HelpfulnessEnabled;
            q.VendorId             = model.VendorId;
            q.PhoneNumber          = model.PhoneNumber;
            q.ReviewsEnabled       = model.ReviewsEnabled;
            q.ServiceTaxNumber     = model.ServiceTaxNumber;
            q.ShortCode            = model.ShortCode;
            q.StateProvinceId      = model.StateProvinceId;
            q.TinNumber            = model.TinNumber;
            q.VatCST               = model.VatCST;
            q.ZipCode              = model.ZipCode;
            q.CommissionPercentage = model.CommissionPercentage;
            q.ShippingCharge       = model.ShippingCharge;
            _extendedVendorService.SaveExtendedVendor(q);

            return(new NullJsonResult());
        }
        public static ExtendedVendorModel ToModel(this Domain.ExtendedVendor ExtendedVendor)
        {
            var model = new ExtendedVendorModel()
            {
                AddressLine1       = ExtendedVendor.AddressLine1,
                AddressLine2       = ExtendedVendor.AddressLine2,
                City               = ExtendedVendor.City,
                CountryId          = ExtendedVendor.CountryId,
                HelpfulnessEnabled = ExtendedVendor.HelpfulnessEnabled,
                LogoId             = ExtendedVendor.LogoId,
                ReviewsEnabled     = ExtendedVendor.ReviewsEnabled,
                StateProvinceId    = ExtendedVendor.StateProvinceId,
                VendorId           = ExtendedVendor.VendorId,
                TinNumber          = ExtendedVendor.TinNumber,
                ServiceTaxNumber   = ExtendedVendor.ServiceTaxNumber,
                ShortCode          = ExtendedVendor.ShortCode,
                VatCST             = ExtendedVendor.VatCST,
                Id                   = ExtendedVendor.Id,
                ZipCode              = ExtendedVendor.ZipCode,
                PhoneNumber          = ExtendedVendor.PhoneNumber,
                CommissionPercentage = ExtendedVendor.CommissionPercentage
            };

            return(model);
        }