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) { var filepath = HttpContext.Current.Server.MapPath(p.GetXmlProperty("genxml/textbox/path")); if (File.Exists(filepath)) { p.ItemID = -1; p.PortalId = PortalSettings.Current.PortalId; objCtrl.Update(p); } else { objCtrl.Delete(p.ItemID); } } } PluginUtils.ResequenceRecords(); }
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(); }