public void DeleteWebPanel(int webPanelId) { using (var listAgent = new SuperOffice.CRM.Services.ListAgent()) { // hard-delete var webPanel = listAgent.GetWebPanelEntity(webPanelId); listAgent.DeleteWebPanel(webPanelId); } }
public bool DoesWebPanelExist(string name, string windowName, out WebPanelEntity webPanel) { using (var listAgent = new SuperOffice.CRM.Services.ListAgent()) { // gets both your webpanels and those created by others. var webPanels = listAgent.GetWebPanelList(); //var englName = SuperOffice.CRM.Globalization.CultureDataFormatter.ParseMultiLanguageString(name, "EN"); webPanel = webPanels.FirstOrDefault(wp => wp.Name.StartsWith(name, StringComparison.InvariantCultureIgnoreCase) || wp.WindowName.StartsWith(windowName, StringComparison.InvariantCultureIgnoreCase)); return(webPanel != null); } }
private WebPanelEntity CreateBasicWebPanel(string name, string windowName, string url, Navigation appearLocation, UrlEncoding urlEncoding = UrlEncoding.None, bool showInAddressBar = false, bool showInMenuBar = false, bool showInStatusBar = false, bool showInToolBar = false) { WebPanelEntity mainWebPanelEntity; try { using (var listAgent = new SuperOffice.CRM.Services.ListAgent()) { mainWebPanelEntity = listAgent.CreateDefaultWebPanelEntity(); mainWebPanelEntity.Tooltip = _webPanelDescription; mainWebPanelEntity.Name = name; mainWebPanelEntity.WindowName = windowName; mainWebPanelEntity.Url = url; mainWebPanelEntity.UrlEncoding = urlEncoding; mainWebPanelEntity.VisibleIn = appearLocation; mainWebPanelEntity.ShowInAddressBar = showInAddressBar; mainWebPanelEntity.ShowInMenuBar = showInMenuBar; mainWebPanelEntity.ShowInStatusBar = showInStatusBar; mainWebPanelEntity.ShowInToolBar = showInToolBar; //mainWebPanelEntity.OnCentral = true; mainWebPanelEntity.OnSalesMarketingWeb = true; mainWebPanelEntity.Rank = 100; mainWebPanelEntity = listAgent.SaveWebPanelEntity(mainWebPanelEntity); } } catch (Exception) { throw; } return(mainWebPanelEntity); }