本文整理汇总了C#中Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController.GetByType方法的典型用法代码示例。如果您正苦于以下问题:C# NBrightBuyController.GetByType方法的具体用法?C# NBrightBuyController.GetByType怎么用?C# NBrightBuyController.GetByType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController
的用法示例。
在下文中一共展示了NBrightBuyController.GetByType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopulateData
private void PopulateData(String userId)
{
Exists = false;
if (Utils.IsNumeric(userId))
_userInfo = UserController.GetUserById(PortalSettings.Current.PortalId, Convert.ToInt32(userId));
else
_userInfo = UserController.Instance.GetCurrentUserInfo();
if (_userInfo != null && _userInfo.UserID != -1) // only create userdata if we have a user logged in.
{
var modCtrl = new NBrightBuyController();
Info = modCtrl.GetByType(_userInfo.PortalID, -1, "USERDATA", _userInfo.UserID.ToString(""));
if (Info == null && _userInfo.UserID != -1)
{
Info = new NBrightInfo();
Info.ItemID = -1;
Info.UserId = _userInfo.UserID;
Info.PortalId = _userInfo.PortalID;
Info.ModuleId = -1;
Info.TypeCode = "USERDATA";
Info.XMLData = "<genxml></genxml>";
Save();
}
else
Exists = true;
}
}
示例2: 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");
}
}
示例3: GetSettings
public static NBrightInfo GetSettings(int portalId, int moduleId, String ctrlTypeCode = "", bool useCache = true)
{
var obj = (NBrightInfo) GetModCache("NBright_NBsettings" + portalId.ToString("") + "_" + moduleId.ToString(""));
if (obj == null | !useCache)
{
// single record for EntityTypeCode settings, so get record directly.
var objCtrl = new NBrightBuyController();
obj = objCtrl.GetByType(portalId, moduleId, "SETTINGS");
if (obj == null)
{
obj = new NBrightInfo {ItemID = -1};
obj.TypeCode = "SETTINGS";
obj.ModuleId = moduleId;
obj.PortalId = portalId;
obj.XMLData = "<genxml><hidden></hidden><textbox></textbox></genxml>";
obj.UserId = -1;
obj.GUIDKey = ctrlTypeCode;
}
SetModCache(moduleId, "NBright_NBsettings" + portalId.ToString("") + "_" + moduleId.ToString(""), obj);
}
return obj;
}
示例4: CreateSettingsInfo
private NBrightInfo CreateSettingsInfo(String moduleid, NBrightInfo nbi)
{
var objCtrl = new NBrightBuyController();
nbi = objCtrl.GetByType(PortalSettings.Current.PortalId, Convert.ToInt32(moduleid), "SETTINGS");
if (nbi == null)
{
nbi = new NBrightInfo(true); // populate empty XML so we can update nodes.
nbi.GUIDKey = "";
nbi.PortalId = PortalSettings.Current.PortalId;
nbi.ModuleId = Convert.ToInt32(moduleid);
nbi.TypeCode = "SETTINGS";
nbi.Lang = "";
}
//rebuild xml
nbi.ModuleId = Convert.ToInt32(moduleid);
nbi.GUIDKey = Utils.GetUniqueKey(10);
nbi.SetXmlProperty("genxml/hidden/modref", nbi.GUIDKey);
return nbi;
}