本文整理汇总了C#中DotNetNuke.Entities.Users.UserInfo.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# UserInfo.GetType方法的具体用法?C# UserInfo.GetType怎么用?C# UserInfo.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Users.UserInfo
的用法示例。
在下文中一共展示了UserInfo.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopulateClientData
private void PopulateClientData(int userId)
{
_clientInfo = new NBrightInfo(true);
_clientInfo.ItemID = userId;
_clientInfo.UserId = userId;
_clientInfo.PortalId = PortalId;
_userInfo = UserController.GetUserById(PortalId, userId);
if (_userInfo != null)
{
Exists = true;
_clientInfo.ModifiedDate = _userInfo.Membership.CreatedDate;
foreach (var propertyInfo in _userInfo.GetType().GetProperties())
{
if (propertyInfo.CanRead)
{
var pv = propertyInfo.GetValue(_userInfo, null);
if (pv == null) pv = "";
_clientInfo.SetXmlProperty("genxml/textbox/" + propertyInfo.Name.ToLower(), pv.ToString());
}
}
foreach (DotNetNuke.Entities.Profile.ProfilePropertyDefinition p in _userInfo.Profile.ProfileProperties)
{
_clientInfo.SetXmlProperty("genxml/textbox/" + p.PropertyName.ToLower(), p.PropertyValue);
}
_clientInfo.AddSingleNode("membership", "", "genxml");
foreach (var propertyInfo in _userInfo.Membership.GetType().GetProperties())
{
if (propertyInfo.CanRead)
{
var pv = propertyInfo.GetValue(_userInfo.Membership, null);
if (pv != null) _clientInfo.SetXmlProperty("genxml/membership/" + propertyInfo.Name.ToLower(), pv.ToString());
}
}
if (_userInfo.IsInRole(StoreSettings.ClientEditorRole))
{
_clientInfo.SetXmlProperty("genxml/checkbox/clienteditorrole", "True");
}
else
{
_clientInfo.SetXmlProperty("genxml/checkbox/clienteditorrole", "False");
}
var objCtrl = new NBrightBuyController();
DataRecord = objCtrl.GetByType(PortalId, -1, "CLIENT", _userInfo.UserID.ToString(""));
if (DataRecord == null)
{
DataRecord = new NBrightInfo(true);
DataRecord.ItemID = -1;
DataRecord.UserId = _userInfo.UserID;
DataRecord.PortalId = PortalId;
DataRecord.ModuleId = -1;
DataRecord.TypeCode = "CLIENT";
}
DiscountCodes = GetEntityList("discountcodes");
VoucherCodes = GetEntityList("vouchercodes");
}
}