本文整理汇总了C#中DotNetNuke.Entities.Users.UserInfo.GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# UserInfo.GetProperty方法的具体用法?C# UserInfo.GetProperty怎么用?C# UserInfo.GetProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Users.UserInfo
的用法示例。
在下文中一共展示了UserInfo.GetProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendMail
/// -----------------------------------------------------------------------------
/// <summary>
/// <summary>Send an email notification</summary>
/// </summary>
/// <param name="user">The user to whom the message is being sent</param>
/// <param name="msgType">The type of message being sent</param>
/// <param name="settings">Portal Settings</param>
/// <returns></returns>
/// <remarks></remarks>
/// <history>
/// [cnurse] 09/29/2005 Moved to Mail class
/// [sLeupold] 02/07/2008 language used for admin mails corrected
/// </history>
/// -----------------------------------------------------------------------------
public static string SendMail(UserInfo user, MessageType msgType, PortalSettings settings)
{
//Send Notification to User
int toUser = user.UserID;
string locale = user.Profile.PreferredLocale;
string subject;
string body;
ArrayList custom = null;
switch (msgType)
{
case MessageType.UserRegistrationAdmin:
subject = "EMAIL_USER_REGISTRATION_ADMINISTRATOR_SUBJECT";
body = "EMAIL_USER_REGISTRATION_ADMINISTRATOR_BODY";
toUser = settings.AdministratorId;
UserInfo admin = UserController.GetUserById(settings.PortalId, settings.AdministratorId);
locale = admin.Profile.PreferredLocale;
break;
case MessageType.UserRegistrationPrivate:
subject = "EMAIL_USER_REGISTRATION_PRIVATE_SUBJECT";
body = "EMAIL_USER_REGISTRATION_PRIVATE_BODY";
break;
case MessageType.UserRegistrationPublic:
subject = "EMAIL_USER_REGISTRATION_PUBLIC_SUBJECT";
body = "EMAIL_USER_REGISTRATION_PUBLIC_BODY";
break;
case MessageType.UserRegistrationVerified:
subject = "EMAIL_USER_REGISTRATION_VERIFIED_SUBJECT";
body = "EMAIL_USER_REGISTRATION_VERIFIED_BODY";
var propertyNotFound = false;
if (HttpContext.Current != null)
{
custom = new ArrayList
{
HttpContext.Current.Server.UrlEncode(user.Username),
HttpContext.Current.Server.UrlEncode(user.GetProperty("verificationcode", String.Empty, null, user, Scope.SystemMessages, ref propertyNotFound))
};
}
break;
case MessageType.PasswordReminder:
subject = "EMAIL_PASSWORD_REMINDER_SUBJECT";
body = "EMAIL_PASSWORD_REMINDER_BODY";
break;
case MessageType.ProfileUpdated:
subject = "EMAIL_PROFILE_UPDATED_SUBJECT";
body = "EMAIL_PROFILE_UPDATED_BODY";
break;
case MessageType.PasswordUpdated:
subject = "EMAIL_PASSWORD_UPDATED_SUBJECT";
body = "EMAIL_PASSWORD_UPDATED_BODY";
break;
default:
subject = "EMAIL_USER_UPDATED_OWN_PASSWORD_SUBJECT";
body = "EMAIL_USER_UPDATED_OWN_PASSWORD_BODY";
break;
}
subject = Localize.GetSystemMessage(locale, settings, subject, user, Localize.GlobalResourceFile, custom, "", settings.AdministratorId);
body = Localize.GetSystemMessage(locale, settings, body, user, Localize.GlobalResourceFile, custom, "", settings.AdministratorId);
SendEmail(settings.Email, UserController.GetUserById(settings.PortalId, toUser).Email, subject, body);
return Null.NullString;
}