本文整理汇总了C#中DotNetNuke.Entities.Users.UserInfo.FillBaseProperties方法的典型用法代码示例。如果您正苦于以下问题:C# UserInfo.FillBaseProperties方法的具体用法?C# UserInfo.FillBaseProperties怎么用?C# UserInfo.FillBaseProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Users.UserInfo
的用法示例。
在下文中一共展示了UserInfo.FillBaseProperties方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillUserInfo
private static UserInfo FillUserInfo(int portalId, IDataReader dr, bool closeDataReader)
{
UserInfo user = null;
try
{
//read datareader
bool bContinue = true;
if (closeDataReader)
{
bContinue = false;
if (dr.Read())
{
//Ensure the data reader returned is valid
if (string.Equals(dr.GetName(0), "UserID", StringComparison.InvariantCultureIgnoreCase))
{
bContinue = true;
}
}
}
if (bContinue)
{
user = new UserInfo
{
PortalID = Null.SetNullInteger(dr["PortalID"]),
IsSuperUser = Null.SetNullBoolean(dr["IsSuperUser"]),
UserID = Null.SetNullInteger(dr["UserID"]),
FirstName = Null.SetNullString(dr["FirstName"]),
LastName = Null.SetNullString(dr["LastName"]),
DisplayName = Null.SetNullString(dr["DisplayName"]),
LastIPAddress = Null.SetNullString(dr["LastIPAddress"])
};
var schema = dr.GetSchemaTable();
if (schema != null)
{
if (schema.Select("ColumnName = 'IsDeleted'").Length > 0)
{
user.IsDeleted = Null.SetNullBoolean(dr["IsDeleted"]);
}
if (schema.Select("ColumnName = 'VanityUrl'").Length > 0)
{
user.VanityUrl = Null.SetNullString(dr["VanityUrl"]);
}
}
user.AffiliateID = Null.SetNullInteger(Null.SetNull(dr["AffiliateID"], user.AffiliateID));
user.Username = Null.SetNullString(dr["Username"]);
UserController.GetUserMembership(user);
user.Email = Null.SetNullString(dr["Email"]);
user.Membership.UpdatePassword = Null.SetNullBoolean(dr["UpdatePassword"]);
if (schema != null)
{
if (schema.Select("ColumnName = 'PasswordResetExpiration'").Length > 0)
{
user.PasswordResetExpiration = Null.SetNullDateTime(dr["PasswordResetExpiration"]);
}
if (schema.Select("ColumnName = 'PasswordResetToken'").Length > 0)
{
user.PasswordResetToken = Null.SetNullGuid(dr["PasswordResetToken"]);
}
}
if (!user.IsSuperUser)
{
user.Membership.Approved = Null.SetNullBoolean(dr["Authorised"]);
}
if (user.PortalID == Null.NullInteger)
{
user.PortalID = portalId;
}
user.FillBaseProperties(dr);
}
}
finally
{
CBO.CloseDataReader(dr, closeDataReader);
}
return user;
}