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(); }
private void UpdateDepartmentItem(CallFlowItem departmentItem) { WOSI.CallButler.Data.CallButlerDataset.DepartmentsRow departmentRow = (WOSI.CallButler.Data.CallButlerDataset.DepartmentsRow)departmentItem.Tag; departmentItem.Title = String.Format(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_Dial), departmentRow.OptionNumber, departmentRow.Name); CallFlowItem subItem = (CallFlowItem)departmentItem.ChildShapes[0]; subItem.Title = ""; subItem.Caption = ""; switch ((WOSI.CallButler.Data.DepartmentTypes)departmentRow.Type) { case WOSI.CallButler.Data.DepartmentTypes.Extension: // Get our extenstion try { WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension = vbData.Extensions.FindByExtensionID(new Guid(departmentRow.Data1)); if (extension != null) { subItem.Icon = Properties.Resources.telephone_24; subItem.Title = String.Format(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_TransferExt), extension.ExtensionNumber); subItem.Caption = extension.FirstName + " " + extension.LastName; } break; } catch { } subItem.Icon = Properties.Resources.telephone_24; subItem.Title = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_UnknownExt); subItem.Caption = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_ExtDeleted); break; case WOSI.CallButler.Data.DepartmentTypes.Greeting: subItem.Title = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_PlayGreeting); subItem.Icon = Properties.Resources.call_greeting_24; break; case WOSI.CallButler.Data.DepartmentTypes.Number: subItem.Icon = Properties.Resources.telephone_24; subItem.Title = String.Format(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_TransferNum), WOSI.Utilities.StringUtils.FormatPhoneNumber(departmentRow.Data1)); break; case WOSI.CallButler.Data.DepartmentTypes.Script: subItem.Icon = Properties.Resources.scroll_24; subItem.Title = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_CustomScript); break; case WOSI.CallButler.Data.DepartmentTypes.Module: subItem.Icon = Properties.Resources.gear_connection_24; subItem.Title = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallFlowView_AddonModule); break; } }
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; }
/*void RenumberDepartmentOptions() { WOSI.CallButler.Data.CallButlerDataset.DepartmentsRow[] departments = (WOSI.CallButler.Data.CallButlerDataset.DepartmentsRow[])vbData.Departments.Select("", "OptionNumber ASC"); int optionNumber = 1; foreach (WOSI.CallButler.Data.CallButlerDataset.DepartmentsRow department in departments) { if (department.RowState != DataRowState.Deleted) { department.OptionNumber = optionNumber; optionNumber++; } } ManagementInterfaceClient.ManagementInterface.PersistDepartment(ManagementInterfaceClient.AuthInfo, vbData.Departments); vbData.Departments.AcceptChanges(); UpdateDepartments(); }*/ void EditDepartment(WOSI.CallButler.Data.CallButlerDataset.DepartmentsRow department, CallFlowItem cfItem) { Forms.DepartmentForm dpForm = new CallButler.Manager.Forms.DepartmentForm(department, vbData); WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsRow localizedGreeting = null; // Get and load our localized greeting if this is a greeting department if (department.Type == (short)WOSI.CallButler.Data.DepartmentTypes.Greeting) { WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsDataTable localizedGreetings = ManagementInterfaceClient.ManagementInterface.GetLocalizedGreeting(ManagementInterfaceClient.AuthInfo, department.DepartmentID, GetCurrentLanguage()); if (localizedGreetings.Count > 0) { localizedGreeting = localizedGreetings[0]; Utils.GreetingUtils.GetLocalizedGreetingSound(localizedGreeting); dpForm.GreetingControl.LoadGreeting(localizedGreeting, WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.GreetingsSoundCache)); } } if (dpForm.ShowDialog(this) == DialogResult.OK) { vbData.AcceptChanges(); // Update our department item remotely ManagementInterfaceClient.ManagementInterface.PersistDepartment(ManagementInterfaceClient.AuthInfo, Utils.TableUtils<WOSI.CallButler.Data.CallButlerDataset.DepartmentsDataTable>.CreateTableFromRow(department)); PersistDepartmentGreeting(department, localizedGreeting, dpForm); //if ((WOSI.CallButler.Data.DepartmentTypes)department.Type == WOSI.CallButler.Data.DepartmentTypes.Greeting) // dpForm.GreetingControl.SaveGreeting(WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.GreetingsSoundCache)); UpdateDepartmentItem(cfItem); NotifyUpdateMenuGreeting(); } }
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(); }