CallFlowItem AddCallFlowDepartmentItem(WOSI.CallButler.Data.CallButlerDataset.DepartmentsRow department) { // Create our call flow item CallFlowItem cfItem = new CallFlowItem(); cfItem.Icon = Properties.Resources.office_24; cfItem.Width = 220; cfItem.Tag = department; LinkButton btnDeleteDepartment = CreateLinkButton(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_Delete)); btnDeleteDepartment.Tag = cfItem; btnDeleteDepartment.Click += new EventHandler(btnDeleteDepartment_Click); cfItem.AddActionControl(btnDeleteDepartment); LinkButton btnEditDepartment = CreateLinkButton(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_Edit)); btnEditDepartment.Tag = cfItem; btnEditDepartment.Click += new EventHandler(btnEditDepartment_Click); cfItem.AddActionControl(btnEditDepartment); mainMenuItem.AddChildShape(cfItem); // Create our sub call flow item CallFlowItem subItem = new CallFlowItem(); subItem.Width = 220; cfItem.AddChildShape(subItem); UpdateDepartmentItem(cfItem); mainMenuItem.Expanded = true; cfItem.Expanded = true; return cfItem; }
public CallFlowView() { InitializeComponent(); this.HelpRTFText = Properties.Resources.CallFlowHelp; // Add our root shape CallFlowItem answerCallItem = new CallFlowItem(); answerCallItem.Title = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_PickUpCall); answerCallItem.Caption = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_AnswerCall); answerCallItem.Width = 220; answerCallItem.Icon = Properties.Resources.phone_pick_up_24; LinkButton btnAnswerSettings = CreateLinkButton(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_CallSettings)); btnAnswerSettings.Click += new EventHandler(btnAnswerSettings_Click); answerCallItem.AddActionControl(btnAnswerSettings); diagramControl.RootShape = answerCallItem; vbData = new WOSI.CallButler.Data.CallButlerDataset(); UpdateOrientation(Properties.Settings.Default.CallFlowOrientation, false); diagramControl.BringToFront(); }
protected override void OnLoadData() { diagramControl.RootShape.ClearChildShapes(); vbData.Merge(ManagementInterfaceClient.ManagementInterface.GetDepartments(ManagementInterfaceClient.AuthInfo)); vbData.Merge(ManagementInterfaceClient.ManagementInterface.GetExtensions(ManagementInterfaceClient.AuthInfo)); vbData.AcceptChanges(); // Add our welcome greeting control welcomeGreetingItem = new CallFlowItem(); welcomeGreetingItem.Title = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_WelcomeGreeting); welcomeGreetingItem.Caption = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_WelcomeCaller); welcomeGreetingItem.Icon = Properties.Resources.call_greeting_24; welcomeGreetingItem.Width = 220; LinkButton btnChangeWelcomeGreeting = CreateLinkButton(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_Change)); btnChangeWelcomeGreeting.Click += new EventHandler(btnChangeWelcomeGreeting_Click); welcomeGreetingItem.AddActionControl(btnChangeWelcomeGreeting); diagramControl.RootShape.AddChildShape(welcomeGreetingItem); // Add our language selection item languageSelectionItem = new CallFlowItem(); languageSelectionItem.Title = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_ChooseLanguage); languageSelectionItem.Caption = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_AskChooseLanguage); languageSelectionItem.Icon = Properties.Resources.call_greeting_24; languageSelectionItem.Width = 220; LinkButton btnChangeLanguageGreeting = CreateLinkButton(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_Change)); btnChangeLanguageGreeting.Click += new EventHandler(btnChangeLanguageGreeting_Click); languageSelectionItem.AddActionControl(btnChangeLanguageGreeting); // Add our main menu greeting item mainMenuGreetingItem = new CallFlowItem(); mainMenuGreetingItem.Title = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_MainMenuGreeting); mainMenuGreetingItem.Caption = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_ExplainOptions); mainMenuGreetingItem.Icon = Properties.Resources.call_greeting_24; mainMenuGreetingItem.Width = 220; LinkButton btnChangeMainMenuGreeting = CreateLinkButton(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_Change)); btnChangeMainMenuGreeting.Click += new EventHandler(btnChangeMainMenuGreeting_Click); mainMenuGreetingItem.AddActionControl(btnChangeMainMenuGreeting); // Add our main menu item mainMenuItem = new CallFlowItem(); mainMenuItem.Title = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_DialAnOption); mainMenuItem.Caption = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_CallerDials); mainMenuItem.Icon = Properties.Resources.phone_button_24; mainMenuItem.Width = 220; LinkButton btnNewOption = CreateLinkButton(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_AddNewOption)); btnNewOption.Click += new EventHandler(btnNewOption_Click); mainMenuItem.AddActionControl(btnNewOption); mainMenuGreetingItem.AddChildShape(mainMenuItem); // Add our departments WOSI.CallButler.Data.CallButlerDataset.DepartmentsRow[] departments = (WOSI.CallButler.Data.CallButlerDataset.DepartmentsRow[])vbData.Departments.Select("", "OptionNumber ASC"); foreach (WOSI.CallButler.Data.CallButlerDataset.DepartmentsRow department in departments) AddCallFlowDepartmentItem(department); // Update our languages defaultLanguage = ManagementInterfaceClient.ManagementInterface.GetDefaultLanguage(ManagementInterfaceClient.AuthInfo); supportedLanguages = ManagementInterfaceClient.ManagementInterface.GetLanguages(ManagementInterfaceClient.AuthInfo); btnMultilingual.Checked = ManagementInterfaceClient.ManagementInterface.GetMultilingual(ManagementInterfaceClient.AuthInfo); UpdateLanguages(); UpdateGreetings(); diagramControl.ExpandAll(); diagramControl.RefreshDiagram(); }