private void EditExtension(WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension)
        {
            short currentExt = extension.ExtensionNumber;

            // Get our extension contact numbers
            WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable contactNumbersTable = ManagementInterfaceClient.ManagementInterface.GetExtensionContactNumbers(ManagementInterfaceClient.AuthInfo, extension.ExtensionID);

            // Get our extension greeting
            WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsDataTable voicemailGreetings = ManagementInterfaceClient.ManagementInterface.GetLocalizedGreeting(ManagementInterfaceClient.AuthInfo, extension.ExtensionID, ManagementInterfaceClient.ManagementInterface.GetDefaultLanguage(ManagementInterfaceClient.AuthInfo));
            WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsRow       voicemailGreeting  = null;

            if (voicemailGreetings.Count > 0)
            {
                voicemailGreeting = voicemailGreetings[0];

                // Download our greeting sound if it exists
                Utils.GreetingUtils.GetLocalizedGreetingSound(voicemailGreeting);
            }
            else
            {
                // If the greeting doesn't exist, create a new one
                voicemailGreeting                     = voicemailGreetings.NewLocalizedGreetingsRow();
                voicemailGreeting.GreetingID          = extension.ExtensionID;
                voicemailGreeting.LocalizedGreetingID = Guid.NewGuid();
                voicemailGreeting.LanguageID          = ManagementInterfaceClient.ManagementInterface.GetDefaultLanguage(ManagementInterfaceClient.AuthInfo);
                voicemailGreeting.Type                = (short)WOSI.CallButler.Data.GreetingType.SoundGreeting;
                voicemailGreetings.AddLocalizedGreetingsRow(voicemailGreeting);
            }

            WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable origExt = (WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable)callButlerDataset.Extensions.Copy();


            // Show our extension editor form
            Forms.ExtensionEditorForm extensionForm = new CallButler.Manager.Forms.ExtensionEditorForm(callButlerDataset.Extensions, extension, contactNumbersTable, voicemailGreeting);

            if (extensionForm.ShowDialog(this) == DialogResult.OK)
            {
                // Check to make sure the extension isn't already taken
                if (currentExt != extension.ExtensionNumber && origExt.Select("ExtensionNumber = " + extension.ExtensionNumber).Length > 0)
                {
                    MessageBox.Show(this, String.Format(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.ExtensionView_ExtTaken), extension.ExtensionNumber, currentExt), CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.ExtensionView_ExtConflict), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    extension.ExtensionNumber = currentExt;
                }

                // Edit our remote extension
                WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensionDataTable = Utils.TableUtils <WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable> .CreateTableFromRow(extension);

                ManagementInterfaceClient.ManagementInterface.PersistExtension(ManagementInterfaceClient.AuthInfo, extensionDataTable);

                // Edit our remote greeting
                ManagementInterfaceClient.ManagementInterface.PersistLocalizedGreeting(ManagementInterfaceClient.AuthInfo, voicemailGreetings);

                // Send our voicemail greeting sound file
                Utils.GreetingUtils.PersistLocalizedGreetingSound(voicemailGreeting);

                ManagementInterfaceClient.ManagementInterface.PersistExtensionContactNumbers(ManagementInterfaceClient.AuthInfo, contactNumbersTable);
            }
        }
        internal void AddNewExtension()
        {
            // Check to make sure we can add a new extension
            int maxExtensions = 100;

            if (maxExtensions > 0 && maxExtensions <= callButlerDataset.Extensions.Count)
            {
                MessageBox.Show(this, String.Format(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.ExtensionsView_ExtLimit), maxExtensions), CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_PermissionDenied), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            // Create a new Extension row
            WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension = callButlerDataset.Extensions.NewExtensionsRow();

            extension.CustomerID  = Properties.Settings.Default.CustomerID;
            extension.ExtensionID = Guid.NewGuid();
            short extensionNum = 0;

            // Find us an unused extension number
            for (short index = Properties.Settings.Default.MinExtensionNumber; index < short.MaxValue; index++)
            {
                if (callButlerDataset.Extensions.Select("ExtensionNumber = " + index).Length == 0)
                {
                    extensionNum = index;
                    extension.ExtensionNumber = index;
                    break;
                }
            }

            // Create a new voicemail greeting
            WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsDataTable voicemailGreetingTable = new WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsDataTable();
            WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsRow       voicemailGreeting      = voicemailGreetingTable.NewLocalizedGreetingsRow();
            voicemailGreeting.GreetingID          = extension.ExtensionID;
            voicemailGreeting.LocalizedGreetingID = Guid.NewGuid();
            voicemailGreeting.LanguageID          = ManagementInterfaceClient.ManagementInterface.GetDefaultLanguage(ManagementInterfaceClient.AuthInfo);
            voicemailGreeting.Type = (short)WOSI.CallButler.Data.GreetingType.SoundGreeting;
            voicemailGreetingTable.AddLocalizedGreetingsRow(voicemailGreeting);

            // Create a new extension contact numbers table
            WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable extensionContactNumbers = new WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable();

            // Show our extension editor form
            Forms.ExtensionEditorForm extensionForm = new CallButler.Manager.Forms.ExtensionEditorForm(callButlerDataset.Extensions, extension, extensionContactNumbers, voicemailGreeting);

            WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable origExt = (WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable)callButlerDataset.Extensions.Copy();

            if (extensionForm.ShowDialog(this) == DialogResult.OK)
            {
                // Check to make sure the extension isn't already taken
                if (origExt.Select("ExtensionNumber = " + extension.ExtensionNumber).Length > 0)
                {
                    MessageBox.Show(this, String.Format(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.ExtensionView_ExtTaken), extension.ExtensionNumber, extensionNum), CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.ExtensionView_ExtConflict), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    extension.ExtensionNumber = extensionNum;
                }

                // Add our local extension
                callButlerDataset.Extensions.AddExtensionsRow(extension);

                // Add our remote extension
                WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensionDataTable = Utils.TableUtils <WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable> .CreateTableFromRow(extension);

                ManagementInterfaceClient.ManagementInterface.PersistExtension(ManagementInterfaceClient.AuthInfo, extensionDataTable);

                // Add our voicemail greeting
                ManagementInterfaceClient.ManagementInterface.PersistLocalizedGreeting(ManagementInterfaceClient.AuthInfo, voicemailGreetingTable);

                // Send our voicemail greeting sound file
                Utils.GreetingUtils.PersistLocalizedGreetingSound(voicemailGreeting);

                // Persist our contact numbers
                ManagementInterfaceClient.ManagementInterface.PersistExtensionContactNumbers(ManagementInterfaceClient.AuthInfo, extensionContactNumbers);
            }
        }
        public ExtensionEditorForm(WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensions, WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension, WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable extensionContacts, WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsRow voicemailGreeting)
        {
            InitializeComponent();

            this.extensions        = extensions;
            this.extension         = extension;
            this.extensionContacts = extensionContacts;


            CallButler.Manager.Plugin.CallButlerManagementPlugin plugin = PluginManager.GetPluginFromID(new Guid(Properties.Settings.Default.DefaultFindMePluginID));

            if (plugin != null)
            {
                CallButler.Manager.Plugin.CallButlerManagementPluginViewControl c = plugin.GetNewViewControl();
                c.Load(new object[] { extension, extensionContacts, ManagementInterfaceClient.ManagementInterface.TelephoneNumberDescription, true, true, extensions });
                c.Dock = DockStyle.Fill;
                pnlFindMe.Controls.Add(c);
            }
            else
            {
                NoPluginFoundView c = new NoPluginFoundView();
                c.PluginType = "Find me/Follow me plugin";

                c.Dock = DockStyle.Fill;
                pnlFindMe.Controls.Add(c);
            }

            wizard.PageIndex = 0;

            // Update our UI
            numExtNum.Value             = extension.ExtensionNumber;
            txtFirstName.Text           = extension.FirstName;
            txtLastName.Text            = extension.LastName;
            cbEnableSearch.Checked      = extension.EnableSearch;
            cbEnableManagement.Checked  = extension.EnableManagement;
            cbEmailNotification.Checked = extension.EmailNotification;
            cbAttach.Checked            = extension.EmailAttachment;
            txtEmailAddress.Text        = extension.EmailAddress;
            cbCallScreening.Checked     = extension.EnableCallScreening;
            cbEnableOutbound.Checked    = extension.EnableOutboundCalls;

            if (!extension.IsUseConferenceTransferNull())
            {
                cbHandOff.Checked = !extension.UseConferenceTransfer;
            }
            else
            {
                cbHandOff.Checked = true;
            }

            greetingControl.LoadGreeting(voicemailGreeting, WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.GreetingsSoundCache));

            if (!extension.IsPasswordNull() && extension.Password.Length > 0)
            {
                txtPassword.Text        = blankPassword;
                txtConfirmPassword.Text = blankPassword;
            }

            if (!extension.IsPBXPasswordNull() && extension.PBXPassword.Length > 0)
            {
                txtPBXPassword.Text        = blankPassword;
                txtConfirmPBXPassword.Text = blankPassword;
            }

            txtFirstName.Select();

            btnImportOutlook.Enabled = Utilities.ContactManagement.ContactManagerFactory.CreateContactManager(Utilities.ContactManagement.ContactType.Outlook).IsInstalled;

            loading = false;
            greetingControl.LoadVoices(ManagementInterfaceClient.ManagementInterface.GetTTSVoices());

            pgFindme.Enabled       = true;
            pnlHandoff.Visible     = true;
            pnlPBXPassword.Visible = true;

            Utils.PrivateLabelUtils.ReplaceProductNameControl(this);
        }
Exemplo n.º 4
0
        public ExtensionEditorForm(WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensions, WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension, WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable extensionContacts, WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsRow voicemailGreeting)
        {
            InitializeComponent();

            this.extensions = extensions;
            this.extension = extension;
            this.extensionContacts = extensionContacts;

               CallButler.Manager.Plugin.CallButlerManagementPlugin plugin = PluginManager.GetPluginFromID(new Guid(Properties.Settings.Default.DefaultFindMePluginID));

               if (plugin != null)
               {
               CallButler.Manager.Plugin.CallButlerManagementPluginViewControl c = plugin.GetNewViewControl();
               c.Load(new object[] { extension, extensionContacts, ManagementInterfaceClient.ManagementInterface.TelephoneNumberDescription, true, true, extensions });
               c.Dock = DockStyle.Fill;
               pnlFindMe.Controls.Add(c);
               }
               else
               {
               NoPluginFoundView c = new NoPluginFoundView();
               c.PluginType = "Find me/Follow me plugin";

               c.Dock = DockStyle.Fill;
               pnlFindMe.Controls.Add(c);
               }

            wizard.PageIndex = 0;

            // Update our UI
            numExtNum.Value = extension.ExtensionNumber;
            txtFirstName.Text = extension.FirstName;
            txtLastName.Text = extension.LastName;
            cbEnableSearch.Checked = extension.EnableSearch;
            cbEnableManagement.Checked = extension.EnableManagement;
            cbEmailNotification.Checked = extension.EmailNotification;
            cbAttach.Checked = extension.EmailAttachment;
            txtEmailAddress.Text = extension.EmailAddress;
            cbCallScreening.Checked = extension.EnableCallScreening;
            cbEnableOutbound.Checked = extension.EnableOutboundCalls;

            if (!extension.IsUseConferenceTransferNull())
                cbHandOff.Checked = !extension.UseConferenceTransfer;
            else
                cbHandOff.Checked = true;

            greetingControl.LoadGreeting(voicemailGreeting, WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.GreetingsSoundCache));

            if (!extension.IsPasswordNull() && extension.Password.Length > 0)
            {
                txtPassword.Text = blankPassword;
                txtConfirmPassword.Text = blankPassword;
            }

            if (!extension.IsPBXPasswordNull() && extension.PBXPassword.Length > 0)
            {
                txtPBXPassword.Text = blankPassword;
                txtConfirmPBXPassword.Text = blankPassword;
            }

            txtFirstName.Select();

            btnImportOutlook.Enabled = Utilities.ContactManagement.ContactManagerFactory.CreateContactManager(Utilities.ContactManagement.ContactType.Outlook).IsInstalled;

            loading = false;
            greetingControl.LoadVoices(ManagementInterfaceClient.ManagementInterface.GetTTSVoices());

            pgFindme.Enabled = true;
            pnlHandoff.Visible = true;
            pnlPBXPassword.Visible = true;

            Utils.PrivateLabelUtils.ReplaceProductNameControl(this);
        }
Exemplo n.º 5
0
        private void btnHeadStart_Click(object sender, EventArgs e)
        {
            Forms.PrebuiltConfigForm pbForm = new CallButler.Manager.Forms.PrebuiltConfigForm();

            if (pbForm.ShowDialog(this) == DialogResult.OK)
            {
                WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensions = new WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable();
                extensions.Merge(pbForm.ConfigurationData.Extensions);
                ManagementInterfaceClient.ManagementInterface.PersistExtension(ManagementInterfaceClient.AuthInfo, extensions);

                WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable contactNumbers = new WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable();
                contactNumbers.Merge(pbForm.ConfigurationData.ExtensionContactNumbers);
                ManagementInterfaceClient.ManagementInterface.PersistExtensionContactNumbers(ManagementInterfaceClient.AuthInfo, contactNumbers);

                ManagementInterfaceClient.ManagementInterface.PersistDepartment(ManagementInterfaceClient.AuthInfo, pbForm.ConfigurationData.Departments);

                WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsDataTable lgTable = new WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsDataTable();

                // Persist our greeting sounds
                foreach (WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsRow lgRow in pbForm.ConfigurationData.LocalizedGreetings)
                {
                    lgTable.Clear();
                    lgTable.ImportRow(lgRow);
                    ManagementInterfaceClient.ManagementInterface.PersistLocalizedGreeting(ManagementInterfaceClient.AuthInfo, lgTable);
                    Utils.GreetingUtils.PersistLocalizedGreetingSound(lgRow);
                }

                ManagementInterfaceClient.ManagementInterface.PersistPersonalizedGreeting(ManagementInterfaceClient.AuthInfo, pbForm.ConfigurationData.PersonalizedGreetings);
                ManagementInterfaceClient.ManagementInterface.PersistProviders(ManagementInterfaceClient.AuthInfo, pbForm.ConfigurationData.Providers);
                ManagementInterfaceClient.ManagementInterface.PersistScriptSchedule(ManagementInterfaceClient.AuthInfo, pbForm.ConfigurationData.ScriptSchedules);

                // Send us back to the try it now page
                Wizard.NextTo(pgTest);
            }
        }
Exemplo n.º 6
0
        private void Wizard_BeforePageChanged(object sender, global::Controls.Wizard.PageChangedEventArgs e)
        {
            switch (Wizard.PageIndex)
            {
            case 0:

                // Validate our Email address
                if (!System.Text.RegularExpressions.Regex.IsMatch(txtEmail.Text, @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"))
                {
                    MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_EnterValidEmail), CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_InvalidEmail), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtEmail.Clear();
                    txtEmail.Select();
                    e.Cancel = true;
                    return;
                }

                // Validate the user name
                if (txtName.Text.Length == 0)
                {
                    MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_NameRequired), "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtName.Select();
                    e.Cancel = true;
                    return;
                }

                // Validate the user name
                if (txtPhone.Text.Length == 0)
                {
                    MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_PhoneNumberRequired), "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtPhone.Select();
                    e.Cancel = true;
                    return;
                }

                // Validate the country
                if (cboCountry.SelectedIndex == 0)
                {
                    MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_SelectCountry), "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    e.Cancel = true;
                    return;
                }

                /*if (txtEmail.Text != "*****@*****.**")
                 * {
                 *  // Send the registration to our webservice
                 *  RegistrationServices.RegistrationService regService = new CallButler.Manager.RegistrationServices.RegistrationService();
                 *
                 *  //Controls.LoadingDialog.ShowDialog(this, Properties.LocalizedStrings.Common_SendingData, Properties.Resources.loading, false, 2000);
                 *
                 *  try
                 *  {
                 *      regService.Register2(txtName.Text, txtEmail.Text, txtCompanyName.Text, ManagementInterfaceClient.ManagementInterface.ProductID, true, cboCountry.Text, txtPhone.Text);
                 *  }
                 *  catch(Exception exp)
                 *  {
                 *  }
                 *
                 *  //Controls.LoadingDialog.HideDialog();
                 * }*/

                ManagementInterfaceClient.ManagementInterface.IsDownloadRegistered = true;

                // Create a new default extension if one doesn't exist
                WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensionDataTable = ManagementInterfaceClient.ManagementInterface.GetExtensionNumber(ManagementInterfaceClient.AuthInfo, 100);

                if (extensionDataTable == null || extensionDataTable.Count == 0)
                {
                    // Create a new Extension row
                    extensionDataTable = new WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable();
                    WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension = extensionDataTable.NewExtensionsRow();

                    extension.CustomerID        = Properties.Settings.Default.CustomerID;
                    extension.ExtensionID       = Guid.NewGuid();
                    extension.EmailAddress      = txtEmail.Text;
                    extension.EmailAttachment   = true;
                    extension.EmailNotification = true;
                    extension.EnableSearch      = true;
                    extension.ExtensionNumber   = 100;

                    string[] name = txtName.Text.Split(' ');
                    extension.FirstName = name[0];
                    if (name.Length > 1)
                    {
                        for (int index = 1; index < name.Length; index++)
                        {
                            extension.LastName += name[index] + " ";
                        }
                    }

                    extensionDataTable.AddExtensionsRow(extension);

                    // Persist our extension
                    ManagementInterfaceClient.ManagementInterface.PersistExtension(ManagementInterfaceClient.AuthInfo, extensionDataTable);

                    // Create a new extension contact numbers table
                    WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable extensionContactNumbers = new WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable();

                    WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow contactNumber = extensionContactNumbers.NewExtensionContactNumbersRow();
                    contactNumber.ContactNumber            = txtPhone.Text;
                    contactNumber.ExtensionContactNumberID = Guid.NewGuid();
                    contactNumber.ExtensionID = extension.ExtensionID;
                    contactNumber.Timeout     = 20;

                    extensionContactNumbers.AddExtensionContactNumbersRow(contactNumber);

                    // Persist our contact numbers
                    ManagementInterfaceClient.ManagementInterface.PersistExtensionContactNumbers(ManagementInterfaceClient.AuthInfo, extensionContactNumbers);
                }

                break;
            }
        }
Exemplo n.º 7
0
        internal void AddNewExtension()
        {
            // Check to make sure we can add a new extension
            int maxExtensions = 100;

            if (maxExtensions > 0 && maxExtensions <= callButlerDataset.Extensions.Count)
            {
                MessageBox.Show(this, String.Format(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.ExtensionsView_ExtLimit), maxExtensions), CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_PermissionDenied), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            // Create a new Extension row
            WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension = callButlerDataset.Extensions.NewExtensionsRow();

            extension.CustomerID = Properties.Settings.Default.CustomerID;
            extension.ExtensionID = Guid.NewGuid();
            short extensionNum = 0;

            // Find us an unused extension number
            for (short index = Properties.Settings.Default.MinExtensionNumber; index < short.MaxValue; index++)
            {
                if (callButlerDataset.Extensions.Select("ExtensionNumber = " + index).Length == 0)
                {
                    extensionNum = index;
                    extension.ExtensionNumber = index;
                    break;
                }
            }

            // Create a new voicemail greeting
            WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsDataTable voicemailGreetingTable = new WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsDataTable();
            WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsRow voicemailGreeting = voicemailGreetingTable.NewLocalizedGreetingsRow();
            voicemailGreeting.GreetingID = extension.ExtensionID;
            voicemailGreeting.LocalizedGreetingID = Guid.NewGuid();
            voicemailGreeting.LanguageID = ManagementInterfaceClient.ManagementInterface.GetDefaultLanguage(ManagementInterfaceClient.AuthInfo);
            voicemailGreeting.Type = (short)WOSI.CallButler.Data.GreetingType.SoundGreeting;
            voicemailGreetingTable.AddLocalizedGreetingsRow(voicemailGreeting);

            // Create a new extension contact numbers table
            WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable extensionContactNumbers = new WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable();

            // Show our extension editor form
            Forms.ExtensionEditorForm extensionForm = new CallButler.Manager.Forms.ExtensionEditorForm(callButlerDataset.Extensions, extension, extensionContactNumbers, voicemailGreeting);

            WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable origExt = (WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable) callButlerDataset.Extensions.Copy();

            if (extensionForm.ShowDialog(this) == DialogResult.OK)
            {
                // Check to make sure the extension isn't already taken
                if (origExt.Select("ExtensionNumber = " + extension.ExtensionNumber).Length > 0)
                {
                    MessageBox.Show(this, String.Format(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.ExtensionView_ExtTaken), extension.ExtensionNumber, extensionNum), CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.ExtensionView_ExtConflict), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    extension.ExtensionNumber = extensionNum;
                }

                // Add our local extension
                callButlerDataset.Extensions.AddExtensionsRow(extension);

                // Add our remote extension
                WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensionDataTable = Utils.TableUtils<WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable>.CreateTableFromRow(extension);
                ManagementInterfaceClient.ManagementInterface.PersistExtension(ManagementInterfaceClient.AuthInfo, extensionDataTable);

                // Add our voicemail greeting
                ManagementInterfaceClient.ManagementInterface.PersistLocalizedGreeting(ManagementInterfaceClient.AuthInfo, voicemailGreetingTable);

                // Send our voicemail greeting sound file
                Utils.GreetingUtils.PersistLocalizedGreetingSound(voicemailGreeting);

                // Persist our contact numbers
                ManagementInterfaceClient.ManagementInterface.PersistExtensionContactNumbers(ManagementInterfaceClient.AuthInfo, extensionContactNumbers);
            }
        }
Exemplo n.º 8
0
        private void Wizard_BeforePageChanged(object sender, global::Controls.Wizard.PageChangedEventArgs e)
        {
            switch (Wizard.PageIndex)
            {
                case 0:

                    // Validate our Email address
                    if (!System.Text.RegularExpressions.Regex.IsMatch(txtEmail.Text, @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"))
                    {
                        MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_EnterValidEmail), CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_InvalidEmail), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        txtEmail.Clear();
                        txtEmail.Select();
                        e.Cancel = true;
                        return;
                    }

                    // Validate the user name
                    if (txtName.Text.Length == 0)
                    {
                        MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_NameRequired), "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        txtName.Select();
                        e.Cancel = true;
                        return;
                    }

                    // Validate the user name
                    if (txtPhone.Text.Length == 0)
                    {
                        MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_PhoneNumberRequired), "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        txtPhone.Select();
                        e.Cancel = true;
                        return;
                    }

                    // Validate the country
                    if (cboCountry.SelectedIndex == 0)
                    {
                        MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_SelectCountry), "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        e.Cancel = true;
                        return;
                    }

                    /*if (txtEmail.Text != "*****@*****.**")
                    {
                        // Send the registration to our webservice
                        RegistrationServices.RegistrationService regService = new CallButler.Manager.RegistrationServices.RegistrationService();

                        //Controls.LoadingDialog.ShowDialog(this, Properties.LocalizedStrings.Common_SendingData, Properties.Resources.loading, false, 2000);

                        try
                        {
                            regService.Register2(txtName.Text, txtEmail.Text, txtCompanyName.Text, ManagementInterfaceClient.ManagementInterface.ProductID, true, cboCountry.Text, txtPhone.Text);
                        }
                        catch(Exception exp)
                        {
                        }

                        //Controls.LoadingDialog.HideDialog();
                    }*/

                    ManagementInterfaceClient.ManagementInterface.IsDownloadRegistered = true;

                    // Create a new default extension if one doesn't exist
                    WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensionDataTable = ManagementInterfaceClient.ManagementInterface.GetExtensionNumber(ManagementInterfaceClient.AuthInfo, 100);

                    if (extensionDataTable == null || extensionDataTable.Count == 0)
                    {
                        // Create a new Extension row
                        extensionDataTable = new WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable();
                        WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension = extensionDataTable.NewExtensionsRow();

                        extension.CustomerID = Properties.Settings.Default.CustomerID;
                        extension.ExtensionID = Guid.NewGuid();
                        extension.EmailAddress = txtEmail.Text;
                        extension.EmailAttachment = true;
                        extension.EmailNotification = true;
                        extension.EnableSearch = true;
                        extension.ExtensionNumber = 100;

                        string[] name = txtName.Text.Split(' ');
                        extension.FirstName = name[0];
                        if(name.Length > 1)
                        {
                            for (int index = 1; index < name.Length; index++)
                                extension.LastName += name[index] + " ";
                        }

                        extensionDataTable.AddExtensionsRow(extension);

                        // Persist our extension
                        ManagementInterfaceClient.ManagementInterface.PersistExtension(ManagementInterfaceClient.AuthInfo, extensionDataTable);

                        // Create a new extension contact numbers table
                        WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable extensionContactNumbers = new WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable();

                        WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow contactNumber = extensionContactNumbers.NewExtensionContactNumbersRow();
                        contactNumber.ContactNumber = txtPhone.Text;
                        contactNumber.ExtensionContactNumberID = Guid.NewGuid();
                        contactNumber.ExtensionID = extension.ExtensionID;
                        contactNumber.Timeout = 20;

                        extensionContactNumbers.AddExtensionContactNumbersRow(contactNumber);

                        // Persist our contact numbers
                        ManagementInterfaceClient.ManagementInterface.PersistExtensionContactNumbers(ManagementInterfaceClient.AuthInfo, extensionContactNumbers);
                    }

                    break;
            }
        }
Exemplo n.º 9
0
        private void btnHeadStart_Click(object sender, EventArgs e)
        {
            Forms.PrebuiltConfigForm pbForm = new CallButler.Manager.Forms.PrebuiltConfigForm();

            if (pbForm.ShowDialog(this) == DialogResult.OK)
            {
                WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensions = new WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable();
                extensions.Merge(pbForm.ConfigurationData.Extensions);
                ManagementInterfaceClient.ManagementInterface.PersistExtension(ManagementInterfaceClient.AuthInfo, extensions);

                WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable contactNumbers = new WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersDataTable();
                contactNumbers.Merge(pbForm.ConfigurationData.ExtensionContactNumbers);
                ManagementInterfaceClient.ManagementInterface.PersistExtensionContactNumbers(ManagementInterfaceClient.AuthInfo, contactNumbers);

                ManagementInterfaceClient.ManagementInterface.PersistDepartment(ManagementInterfaceClient.AuthInfo, pbForm.ConfigurationData.Departments);

                WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsDataTable lgTable = new WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsDataTable();

                // Persist our greeting sounds
                foreach (WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsRow lgRow in pbForm.ConfigurationData.LocalizedGreetings)
                {
                    lgTable.Clear();
                    lgTable.ImportRow(lgRow);
                    ManagementInterfaceClient.ManagementInterface.PersistLocalizedGreeting(ManagementInterfaceClient.AuthInfo, lgTable);
                    Utils.GreetingUtils.PersistLocalizedGreetingSound(lgRow);
                }

                ManagementInterfaceClient.ManagementInterface.PersistPersonalizedGreeting(ManagementInterfaceClient.AuthInfo, pbForm.ConfigurationData.PersonalizedGreetings);
                ManagementInterfaceClient.ManagementInterface.PersistProviders(ManagementInterfaceClient.AuthInfo, pbForm.ConfigurationData.Providers);
                ManagementInterfaceClient.ManagementInterface.PersistScriptSchedule(ManagementInterfaceClient.AuthInfo, pbForm.ConfigurationData.ScriptSchedules);

                // Send us back to the try it now page
                Wizard.NextTo(pgTest);
            }
        }