Beispiel #1
0
        public static void CopySystemPluginsToPortal()
        {
            var objCtrl = new NBrightBuyController();
            var rtnList = objCtrl.GetList(99999, -1, "PLUGIN", "", "order by nb1.xmldata.value('(genxml/hidden/index)[1]','float')");

            foreach (var p in rtnList)
            {
                var existingrecord = objCtrl.GetByGuidKey(PortalSettings.Current.PortalId, -1, "PLUGIN", p.GUIDKey);
                if (existingrecord == null)
                {
                    p.ItemID   = -1;
                    p.PortalId = PortalSettings.Current.PortalId;
                    objCtrl.Update(p);
                }
            }
            PluginUtils.ResequenceRecords();
        }
Beispiel #2
0
 public PluginData(int portalId, bool usecache = true)
 {
     _cachekey = "pluginlist" + portalId;
     if (usecache)
     {
         var pList = NBrightBuyUtils.GetCache(_cachekey);
         if (pList != null)
         {
             _pluginList = (List <NBrightInfo>)pList;
         }
         // if we have zero plugins, try and reload
         if (pList == null || !_pluginList.Any())
         {
             _pluginList = PluginUtils.GetPluginList(portalId);
             NBrightBuyUtils.SetCache(_cachekey, _pluginList);
         }
     }
     else
     {
         _pluginList = PluginUtils.GetPluginList(portalId);
     }
 }