本文整理汇总了C#中Vendor.SetHasPaidGroupDeals方法的典型用法代码示例。如果您正苦于以下问题:C# Vendor.SetHasPaidGroupDeals方法的具体用法?C# Vendor.SetHasPaidGroupDeals怎么用?C# Vendor.SetHasPaidGroupDeals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vendor
的用法示例。
在下文中一共展示了Vendor.SetHasPaidGroupDeals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Register
//.........这里部分代码省略.........
_genericAttributeService.SaveAttribute(
vendor,
Nop.Plugin.Misc.VendorMembership.Domain.VendorAttributes.PreferredSubdomainName,
vrmodel.PreferredSubdomainName);
var productServiceCore = EngineContext.Current.Resolve<Nop.Services.Catalog.IProductService>();
foreach (var BusinessTypeId in vrmodel.BusinessTypeIds)
{
var vb = new VendorBusinessType();
//var vendorServiceExt = new VendorService(_vendorBusinessTypeRepository);
vb.VendorId = vendor.Id;
vb.BusinessTypeId = BusinessTypeId;
//vendorServiceExt.InsertVendorBusinessType(vb);
}
// create groupdeals
for (int i = 0; i < 10; i++)
{
int groupDealProductId = _groupDealService.CreateGroupDealProduct(vrmodel.ShopName + " register", 25m);
foreach (var categoryId in vrmodel.BusinessTypeIds)
{
var productCategory = new ProductCategory
{
ProductId = groupDealProductId,
CategoryId = categoryId,
IsFeaturedProduct = false,
DisplayOrder = 0
};
_categoryService.InsertProductCategory(productCategory);
}
}
vendor.SetHasPaidGroupDeals(true);
var model = new RegisterModel();
PrepareCustomerRegisterModel(model, false);
//enable newsletter by default
model.Newsletter = _customerSettings.NewsletterTickedByDefault;
model = vrmodel.ToRegisterModel(model);
// core code starts
//check whether registration is allowed
if (_customerSettings.UserRegistrationType == UserRegistrationType.Disabled)
return RedirectToRoute("RegisterResult", new { resultId = (int)UserRegistrationType.Disabled });
if (_workContext.CurrentCustomer.IsRegistered())
{
//Already registered customer.
_authenticationService.SignOut();
//Save a new record
_workContext.CurrentCustomer = _customerService.InsertGuestCustomer();
}
var customer = _workContext.CurrentCustomer;
//add to 'Vendors' role
var vendorRole = _customerService.GetCustomerRoleBySystemName(SystemCustomerRoleNames.Vendors);
if (vendorRole == null)
throw new NopException("'Vendors' role could not be loaded");
customer.CustomerRoles.Add(vendorRole);
customer.VendorId = vendor.Id;
//custom customer attributes
var customerAttributesXml = ParseCustomCustomerAttributes(form);
var customerAttributeWarnings = _customerAttributeParser.GetAttributeWarnings(customerAttributesXml);