当前位置: 首页>>代码示例>>C#>>正文


C# NBrightBuyController.GetByType方法代码示例

本文整理汇总了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;
            }
        }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:27,代码来源:UserData.cs

示例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");

            }
        }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:64,代码来源:ClientData.cs

示例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;
 }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:22,代码来源:NBrightBuyUtils.cs

示例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;
 }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:19,代码来源:XmlConnector.ashx.cs


注:本文中的Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController.GetByType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。