本文整理汇总了C#中Nop.Core.Domain.Customers.Customer.GetFullName方法的典型用法代码示例。如果您正苦于以下问题:C# Customer.GetFullName方法的具体用法?C# Customer.GetFullName怎么用?C# Customer.GetFullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nop.Core.Domain.Customers.Customer
的用法示例。
在下文中一共展示了Customer.GetFullName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendVendorEmailValidationMessage
public virtual int SendVendorEmailValidationMessage(Customer customer, int languageId)
{
if (customer == null)
throw new ArgumentNullException("customer");
var store = _storeContext.CurrentStore;
languageId = EnsureLanguageIsActive(languageId, store.Id);
var messageTemplate = GetActiveMessageTemplate("Vendor.EmailValidationMessage", store.Id);
if (messageTemplate == null)
return 0;
//email account
var emailAccount = GetEmailAccountOfMessageTemplate(messageTemplate, languageId);
//tokens
var tokens = new List<Token>();
_messageTokenProvider.AddStoreTokens(tokens, store, emailAccount);
_messageTokenProvider.AddCustomerTokens(tokens, customer);
_messageTokenProvider.AddVendorTokens(tokens, customer);
//event notification
_eventPublisher.MessageTokensAdded(messageTemplate, tokens);
var toEmail = customer.Email;
var toName = customer.GetFullName();
return SendNotification(messageTemplate, emailAccount,
languageId, tokens,
toEmail, toName);
}
示例2: AddCustomerTokens
public virtual void AddCustomerTokens(IList<Token> tokens, Customer customer)
{
tokens.Add(new Token("Customer.Email", customer.Email));
tokens.Add(new Token("Customer.Username", customer.Username));
tokens.Add(new Token("Customer.FullName", customer.GetFullName()));
tokens.Add(new Token("Customer.FirstName", customer.GetAttribute<string>(SystemCustomerAttributeNames.FirstName)));
tokens.Add(new Token("Customer.LastName", customer.GetAttribute<string>(SystemCustomerAttributeNames.LastName)));
tokens.Add(new Token("Customer.VatNumber", customer.GetAttribute<string>(SystemCustomerAttributeNames.VatNumber)));
tokens.Add(new Token("Customer.VatNumberStatus", ((VatNumberStatus)customer.GetAttribute<int>(SystemCustomerAttributeNames.VatNumberStatusId)).ToString()));
//note: we do not use SEO friendly URLS because we can get errors caused by having .(dot) in the URL (from the email address)
//TODO add a method for getting URL (use routing because it handles all SEO friendly URLs)
string passwordRecoveryUrl = string.Format("{0}passwordrecovery/confirm?token={1}&email={2}", GetStoreUrl(), customer.GetAttribute<string>(SystemCustomerAttributeNames.PasswordRecoveryToken), HttpUtility.UrlEncode(customer.Email));
string accountActivationUrl = string.Format("{0}customer/activation?token={1}&email={2}", GetStoreUrl(), customer.GetAttribute<string>(SystemCustomerAttributeNames.AccountActivationToken), HttpUtility.UrlEncode(customer.Email));
var wishlistUrl = string.Format("{0}wishlist/{1}", GetStoreUrl(), customer.CustomerGuid);
tokens.Add(new Token("Customer.PasswordRecoveryURL", passwordRecoveryUrl, true));
tokens.Add(new Token("Customer.AccountActivationURL", accountActivationUrl, true));
tokens.Add(new Token("Wishlist.URLForCustomer", wishlistUrl, true));
//event notification
_eventPublisher.EntityTokensAdded(customer, tokens);
}
示例3: AddCustomerTokens
public virtual void AddCustomerTokens(IList<Token> tokens, Customer customer)
{
tokens.Add(new Token("Customer.Email", customer.Email));
tokens.Add(new Token("Customer.Username", customer.Username));
tokens.Add(new Token("Customer.FullName", customer.GetFullName()));
tokens.Add(new Token("Customer.VatNumber", customer.VatNumber));
tokens.Add(new Token("Customer.VatNumberStatus", customer.VatNumberStatus.ToString()));
//TODO add a method for getting URL (use routing because it handles all SEO friendly URLs)
string passwordRecoveryUrl = string.Format("{0}passwordrecovery/confirm?token={1}&email={2}", _webHelper.GetStoreLocation(false), customer.GetAttribute<string>(SystemCustomerAttributeNames.PasswordRecoveryToken), customer.Email);
string accountActivationUrl = string.Format("{0}customer/activation?token={1}&email={2}", _webHelper.GetStoreLocation(false), customer.GetAttribute<string>(SystemCustomerAttributeNames.AccountActivationToken), customer.Email);
var wishlistUrl = string.Format("{0}wishlist/{1}", _webHelper.GetStoreLocation(false), customer.CustomerGuid);
tokens.Add(new Token("Customer.PasswordRecoveryURL", passwordRecoveryUrl, true));
tokens.Add(new Token("Customer.AccountActivationURL", accountActivationUrl, true));
tokens.Add(new Token("Wishlist.URLForCustomer", wishlistUrl, true));
}
示例4: SendNewForumPostMessage
/// <summary>
/// Sends a forum subscription message to a customer
/// </summary>
/// <param name="customer">Customer instance</param>
/// <param name="forumPost">Forum post</param>
/// <param name="forumTopic">Forum Topic</param>
/// <param name="forum">Forum</param>
/// <param name="friendlyForumTopicPageIndex">Friendly (starts with 1) forum topic page to use for URL generation</param>
/// <param name="languageId">Message language identifier</param>
/// <returns>Queued email identifier</returns>
public int SendNewForumPostMessage(Customer customer,
ForumPost forumPost, ForumTopic forumTopic,
Forum forum, int friendlyForumTopicPageIndex, int languageId)
{
if (customer == null)
{
throw new ArgumentNullException("customer");
}
var messageTemplate = GetLocalizedActiveMessageTemplate("Forums.NewForumPost", languageId);
if (messageTemplate == null || !messageTemplate.IsActive)
{
return 0;
}
var tokens = GenerateTokens(forumPost, friendlyForumTopicPageIndex, forumPost.Id);
var emailAccount = GetEmailAccountOfMessageTemplate(messageTemplate, languageId);
var toEmail = customer.Email;
var toName = customer.GetFullName();
return SendNotification(messageTemplate, emailAccount, languageId, tokens, toEmail, toName);
}
示例5: PrepareMyBidsModel
protected virtual void PrepareMyBidsModel(AUMyBidsModel model,
List<int> bidProducts, Customer customer, bool isEditable = true)
{
if (bidProducts == null)
throw new ArgumentNullException("bidProducts");
if (model == null)
throw new ArgumentNullException("model");
//load settings for a chosen store scope
var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext);
var AUConsignorSettings = _settings.LoadSetting<Nop.Plugin.Misc.AUConsignor.Domain.AUConsignorSettings>(storeScope);
AUStoreTypeEnum storeType = (AUStoreTypeEnum)AUConsignorSettings.StoreTypeId;
model.StoreType = storeType;
//needed this beyond IsEditable because if don't come in with customer guid from share wishlist email you
//still don;t want them to enter bids if they're a guest
if (_workContext.CurrentCustomer.IsGuest())
{
model.IsGuest = true;
}
else
{
model.IsGuest = false;
}
model.EmailWishlistEnabled = _shoppingCartSettings.EmailWishlistEnabled;
model.IsEditable = isEditable;
model.DisplayAddToCart = _permissionService.Authorize(StandardPermissionProvider.EnableShoppingCart);
model.DisplayTaxShippingInfo = _catalogSettings.DisplayTaxShippingInfoWishlist;
if (bidProducts.Count == 0)
return;
#region Simple properties
//var customer = cart.GetCustomer();
//NJM: changed to pass in parameter
model.CustomerGuid = customer.CustomerGuid;
model.CustomerFullname = customer.GetFullName();
model.ShowProductImages = _shoppingCartSettings.ShowProductImagesOnShoppingCart;
model.ShowSku = _catalogSettings.ShowProductSku;
//cart warnings
//var cartWarnings = _shoppingCartService.GetShoppingCartWarnings(cart, "", false);
//foreach (var warning in cartWarnings)
// model.Warnings.Add(warning);
#endregion
#region MyBids items
foreach (int p in bidProducts)
{
var product = _productService.GetProductById(p);
var bidItemModel = new AUMyBidsModel.MyBidItemItemModel
{
Id = product.Id,
//Sku = sci.Product.FormatSku(sci.AttributesXml, _productAttributeParser),
Sku = product.Sku,
ProductId = product.Id,
ProductName = product.GetLocalized(x => x.Name),
ProductSeName = product.GetSeName(),
//Quantity = sci.Quantity,
StockQuantity = product.StockQuantity,
//TODO: where does AttributeInfo come from and how is it used
//AttributeInfo = _productAttributeFormatter.FormatAttributes(sci.Product, sci.AttributesXml),
LotBidEntry = _lotService.GetLotBidEntryModel(product.Id)
};
//NJM: count lots as separate from products so can determine if need to show product wishlist and lot wishlist in view
if (bidItemModel.LotBidEntry.ProductIsLot)
{
model.TotalLots += 1;
}
//TODO: fill in the lot bid entry model in the shopping cart only if auction site
//allowed quantities
//NJM: do not use allowed quantities for biddable lots. StockQuantity will be used for "dup lots"
//(not grouped products which is used for variants)
//var allowedQuantities = sci.Product.ParseAllowedQuantities();
//foreach (var qty in allowedQuantities)
//{
// cartItemModel.AllowedQuantities.Add(new SelectListItem
// {
// Text = qty.ToString(),
// Value = qty.ToString(),
// Selected = sci.Quantity == qty
// });
//}
//recurring info
//NJM: do not use recurring info for biddable lots.
//if (sci.Product.IsRecurring)
//.........这里部分代码省略.........
示例6: PrepareCustomerModelForList
protected CustomerModel PrepareCustomerModelForList(Customer customer)
{
return new CustomerModel()
{
Id = customer.Id,
Email = !String.IsNullOrEmpty(customer.Email) ? customer.Email : (customer.IsGuest() ? _localizationService.GetResource("Admin.Customers.Guest") : "Unknown"),
Username = customer.Username,
FullName = customer.GetFullName(),
//CustomerRoleNames = GetCustomerRolesNames(customer.CustomerRoles.ToList()),
Active = customer.Active,
//CreatedOn = _dateTimeHelper.ConvertToUserTime(customer.CreatedOnUtc, DateTimeKind.Utc),
//LastActivityDate = _dateTimeHelper.ConvertToUserTime(customer.LastActivityDateUtc, DateTimeKind.Utc),
};
}
示例7: SendProductReviewNotification
public int SendProductReviewNotification(Customer customer, List<Product> unreviewedProducts, int languageId, int storeId)
{
var store = _storeService.GetStoreById(storeId) ?? _storeContext.CurrentStore;
languageId = EnsureLanguageIsActive(languageId, store.Id);
var messageTemplate = GetLocalizedActiveMessageTemplate("MobSocial.ProductReviewNotification", store.Id);
if (messageTemplate == null)
return 0;
var emailAccount = GetEmailAccountOfMessageTemplate(messageTemplate, languageId);
//tokens
var tokens = new List<Token>();
_messageTokenProvider.AddStoreTokens(tokens, store, emailAccount);
_messageTokenProvider.AddCustomerTokens(tokens, customer);
var productUrls = ProductListToHtmlTable(unreviewedProducts, languageId, storeId);
tokens.Add(new Token("ProductUrls", productUrls));
//event notification
_eventPublisher.MessageTokensAdded(messageTemplate, tokens);
var toEmail = customer.Email;
var toName = customer.GetFullName().ToTitleCase();
var emailId = SendNotification(messageTemplate, emailAccount, languageId, tokens, toEmail, toName);
return emailId;
}
示例8: SendCustomerWelcomeMessage
/// <summary>
/// Sends a welcome message to a customer
/// </summary>
/// <param name="customer">Customer instance</param>
/// <param name="languageId">Message language identifier</param>
/// <returns>Queued email identifier</returns>
public virtual int SendCustomerWelcomeMessage(Customer customer, int languageId)
{
if (customer == null)
throw new ArgumentNullException("customer");
languageId = EnsureLanguageIsActive(languageId);
var messageTemplate = GetLocalizedActiveMessageTemplate("Customer.WelcomeMessage", languageId);
if (messageTemplate == null)
return 0;
var customerTokens = GenerateTokens(customer);
//event notification
_eventPublisher.MessageTokensAdded(messageTemplate, customerTokens);
var emailAccount = GetEmailAccountOfMessageTemplate(messageTemplate, languageId);
var toEmail = customer.Email;
var toName = customer.GetFullName();
return SendNotification(messageTemplate, emailAccount,
languageId, customerTokens,
toEmail, toName);
}
示例9: SendEventInvitationNotification
public int SendEventInvitationNotification(Customer customer, int languageId, int storeId)
{
var store = _storeService.GetStoreById(storeId) ?? _storeContext.CurrentStore;
languageId = EnsureLanguageIsActive(languageId, store.Id);
var messageTemplate = GetLocalizedActiveMessageTemplate("MobSocial.EventInvitationNotification", store.Id);
if (messageTemplate == null)
return 0;
var emailAccount = GetEmailAccountOfMessageTemplate(messageTemplate, languageId);
//tokens
var tokens = new List<Token>();
_messageTokenProvider.AddStoreTokens(tokens, store, emailAccount);
_messageTokenProvider.AddCustomerTokens(tokens, customer);
//event notification
_eventPublisher.MessageTokensAdded(messageTemplate, tokens);
var toEmail = customer.Email;
var toName = customer.GetFullName().ToTitleCase();
return SendNotification(messageTemplate, emailAccount, languageId, tokens, toEmail, toName);
}
示例10: SendXDaysToBattleStartNotificationToParticipant
public int SendXDaysToBattleStartNotificationToParticipant(Customer receiver, VideoBattle videoBattle, int languageId, int storeId)
{
var store = _storeService.GetStoreById(storeId) ?? _storeContext.CurrentStore;
languageId = EnsureLanguageIsActive(languageId, store.Id);
var messageTemplate = GetLocalizedActiveMessageTemplate("MobSocial.xDaysToBattleStartNotification", store.Id);
if (messageTemplate == null)
return 0;
var emailAccount = GetEmailAccountOfMessageTemplate(messageTemplate, languageId);
//find the remaining days to start of battle
var timeSpan = (int)Math.Ceiling(videoBattle.VotingStartDate.Subtract(DateTime.UtcNow).TotalDays);
var formattedString = timeSpan > 1 ? string.Format("in {0} days", timeSpan) : "tomorrow";
//tokens
var tokens = new List<Token>
{
new Token("Battle.Title", videoBattle.Name, true),
new Token("Battle.Url", string.Format("{0}/VideoBattle/{1}", store.Url, videoBattle.GetSeName(_workContext.WorkingLanguage.Id, true, false)), true),
new Token("Battle.StartDaysString", formattedString , true)
};
_messageTokenProvider.AddStoreTokens(tokens, store, emailAccount);
_messageTokenProvider.AddCustomerTokens(tokens, receiver);
//event notification
_eventPublisher.MessageTokensAdded(messageTemplate, tokens);
var toEmail = receiver.Email;
var toName = receiver.GetFullName().ToTitleCase();
return SendNotification(messageTemplate, emailAccount, languageId, tokens, toEmail, toName);
}
示例11: SendVotingReminderNotification
public int SendVotingReminderNotification(Customer sender, string receiverEmail, string receiverName, VideoBattle videoBattle, int languageId,
int storeId)
{
var store = _storeService.GetStoreById(storeId) ?? _storeContext.CurrentStore;
languageId = EnsureLanguageIsActive(languageId, store.Id);
var messageTemplate = GetLocalizedActiveMessageTemplate("MobSocial.SomeoneInvitedYouToVoteNotification", store.Id);
if (messageTemplate == null)
return 0;
var emailAccount = GetEmailAccountOfMessageTemplate(messageTemplate, languageId);
//tokens
var tokens = new List<Token>
{
new Token("VideoBattle.Title", videoBattle.Name, true),
new Token("VideoBattle.Url", string.Format("{0}/VideoBattles/VideoBattle/{1}", store.Url, videoBattle.Id) , true),
new Token("Inviter.Name", sender.GetFullName() , true)
};
_messageTokenProvider.AddStoreTokens(tokens, store, emailAccount);
_messageTokenProvider.AddCustomerTokens(tokens, sender);
//event notification
_eventPublisher.MessageTokensAdded(messageTemplate, tokens);
var toEmail = receiverEmail;
var toName = receiverName;
return SendNotification(messageTemplate, emailAccount, languageId, tokens, toEmail, toName);
}
示例12: SendVideoBattleSignupNotification
public int SendVideoBattleSignupNotification(Customer challenger, Customer challengee, VideoBattle videoBattle, int languageId, int storeId)
{
var store = _storeService.GetStoreById(storeId) ?? _storeContext.CurrentStore;
languageId = EnsureLanguageIsActive(languageId, store.Id);
var messageTemplate = GetLocalizedActiveMessageTemplate("MobSocial.VideoBattleSignupNotification", store.Id);
if (messageTemplate == null)
return 0;
var emailAccount = GetEmailAccountOfMessageTemplate(messageTemplate, languageId);
//tokens
var tokens = new List<Token>
{
new Token("VideoBattle.Title", videoBattle.Name, true),
new Token("VideoBattle.Url", string.Format("{0}/VideoBattles/VideoBattle/{1}", store.Url, videoBattle.Id) , true),
new Token("Challenger.Name", challengee.GetFullName() , true)
};
_messageTokenProvider.AddStoreTokens(tokens, store, emailAccount);
_messageTokenProvider.AddCustomerTokens(tokens, challengee);
//event notification
_eventPublisher.MessageTokensAdded(messageTemplate, tokens);
var toEmail = challenger.Email;
var toName = challenger.GetFullName().ToTitleCase();
return SendNotification(messageTemplate, emailAccount, languageId, tokens, toEmail, toName);
}
示例13: SendSponsorshipStatusChangeNotification
public int SendSponsorshipStatusChangeNotification(Customer receiver, SponsorshipStatus sponsorshipStatus, VideoBattle videoBattle, int languageId,
int storeId)
{
var store = _storeService.GetStoreById(storeId) ?? _storeContext.CurrentStore;
languageId = EnsureLanguageIsActive(languageId, store.Id);
var messageTemplate = GetLocalizedActiveMessageTemplate("MobSocial.SponsorshipStatusChangeNotification", store.Id);
if (messageTemplate == null)
return 0;
var emailAccount = GetEmailAccountOfMessageTemplate(messageTemplate, languageId);
//tokens
var tokens = new List<Token>
{
new Token("Battle.Title", videoBattle.Name, true),
new Token("Battle.Url", string.Format("{0}/VideoBattle/{1}", store.Url, videoBattle.GetSeName(_workContext.WorkingLanguage.Id, true, false)), true),
new Token("Sponsorship.Status", sponsorshipStatus.ToString() , true)
};
_messageTokenProvider.AddStoreTokens(tokens, store, emailAccount);
_messageTokenProvider.AddCustomerTokens(tokens, receiver);
//event notification
_eventPublisher.MessageTokensAdded(messageTemplate, tokens);
var toEmail = receiver.Email;
var toName = receiver.GetFullName().ToTitleCase();
return SendNotification(messageTemplate, emailAccount, languageId, tokens, toEmail, toName);
}
示例14: SendSomeoneChallengedYouForABattleNotification
public int SendSomeoneChallengedYouForABattleNotification(Customer challenger, Customer challengee, VideoBattle videoBattle,
int languageId, int storeId)
{
return SendSomeoneChallengedYouForABattleNotification(challenger, challenger.Email,
challenger.GetFullName().ToTitleCase(), videoBattle, languageId, storeId);
}
示例15: SendNewForumPostMessage
/// <summary>
/// Sends a forum subscription message to a customer
/// </summary>
/// <param name="customer">Customer instance</param>
/// <param name="forumPost">Forum post</param>
/// <param name="forumTopic">Forum Topic</param>
/// <param name="forum">Forum</param>
/// <param name="friendlyForumTopicPageIndex">Friendly (starts with 1) forum topic page to use for URL generation</param>
/// <param name="languageId">Message language identifier</param>
/// <returns>Queued email identifier</returns>
public int SendNewForumPostMessage(Customer customer,
ForumPost forumPost, ForumTopic forumTopic,
Forum forum, int friendlyForumTopicPageIndex, int languageId)
{
if (customer == null)
{
throw new ArgumentNullException("customer");
}
var store = _storeContext.CurrentStore;
var messageTemplate = GetActiveMessageTemplate("Forums.NewForumPost", store.Id);
if (messageTemplate == null )
{
return 0;
}
//email account
var emailAccount = GetEmailAccountOfMessageTemplate(messageTemplate, languageId);
//tokens
var tokens = new List<Token>();
_messageTokenProvider.AddStoreTokens(tokens, store, emailAccount);
_messageTokenProvider.AddForumPostTokens(tokens, forumPost);
_messageTokenProvider.AddForumTopicTokens(tokens, forumPost.ForumTopic,
friendlyForumTopicPageIndex, forumPost.Id);
_messageTokenProvider.AddForumTokens(tokens, forumPost.ForumTopic.Forum);
_messageTokenProvider.AddCustomerTokens(tokens, customer);
//event notification
_eventPublisher.MessageTokensAdded(messageTemplate, tokens);
var toEmail = customer.Email;
var toName = customer.GetFullName();
return SendNotification(messageTemplate, emailAccount, languageId, tokens, toEmail, toName);
}