public static bool CheckCFGAppisExist(string appName, string[] appNames = null)
        {
            try
            {
                if (appNames != null && appNames.Length > 0)
                {
                    appName = appNames[0];
                }

                if (!string.IsNullOrEmpty(appName))
                {
                    Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgApplicationQuery appQuery =
                        new Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgApplicationQuery();
                    appQuery.Name       = appName.Trim();
                    appQuery.TenantDbid = ConfigContainer.Instance().TenantDbId;
                    Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgApplication appObject =
                        ConfigContainer.Instance().ConfServiceObject.RetrieveObject <Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgApplication>(appQuery);
                    return(appObject != null);
                }
            }
            catch (Exception)
            {
            }
            return(false);
        }
 /// <summary>
 /// Updates the agent ready activity in the Database.
 /// </summary>
 public void UpdateAgentReadyActivity()
 {
     try
     {
         if (ConfigContainer.Instance().AllKeys.Contains("tblAgentNotReady") &&
             !string.IsNullOrEmpty(ConfigContainer.Instance().GetValue("tblAgentNotReady")) && !string.IsNullOrEmpty(notreadyDBID))
         {
             string time  = DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString();
             string query = "Update " + ConfigContainer.Instance().GetValue("tblAgentNotReady") + " set EndTime='" + time + "' where DBID=" + notreadyDBID;
             db                  = new Database();
             db.Provider         = "System.Data.SqlClient";
             db.ConnectionString = connectionString;
             db.CreateConnection(true);
             logger.Info("UpdateAgentReadyActivity: Connection Created");
             db.ExecuteNonQuery(query);
             logger.Info("UpdateAgentReadyActivity: Query Executed : " + query);
             db.CloseConnection();
             logger.Info("UpdateAgentReadyActivity: Connection Closed");
             logger.Info("UpdateAgentReadyActivity : Exit");
         }
     }
     catch (Exception ex)
     {
         logger.Error("Exception Occured during UpdateAgentReadyActivity : " + ex.Message);
     }
 }
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string input = value as string;

            if (input.StartsWith("www"))
            {
                input = "http://" + input;
            }
            Uri  uriResult;
            bool result = Uri.TryCreate(input, UriKind.Absolute, out uriResult) &&
                          (uriResult.Scheme == Uri.UriSchemeHttp ||
                           uriResult.Scheme == Uri.UriSchemeHttps ||
                           uriResult.Scheme == Uri.UriSchemeFtp ||
                           uriResult.Scheme == Uri.UriSchemeFile);

            if (result &&
                (ConfigContainer.Instance().AllKeys.Contains("voice.enable.attach-data-popup-url") &&
                 ((string)ConfigContainer.Instance().GetValue("voice.enable.attach-data-popup-url")).ToLower().Equals("true")))
            {
                return(Cursors.Hand);
            }
            else
            {
                return(DependencyProperty.UnsetValue);
            }
        }
Beispiel #4
0
        //  private CfgPerson _person = null;
        #endregion Field Declaration

        public void ReadApplicationValue(ConfService configProtocol, string applicationName)
        {
            try
            {
                // application = new CfgApplication(.Instance().ComObject);
                //CfgApplicationQuery appQuery = new CfgApplicationQuery();
                //appQuery.Name = applicationName;
                //CfgApplication application = configProtocol.RetrieveObject<CfgApplication>(appQuery);
                //if (application.Options.ContainsKey("agent.ixn.desktop"))
                //{
                //    KeyValueCollection keyValue = (KeyValueCollection)application.Options["agent.ixn.desktop"];
                if (ConfigContainer.Instance().AllKeys.Contains("interaction.case-data.transaction-object"))
                {
                    ReadTransaction(configProtocol, ConfigContainer.Instance().GetAsString("interaction.case-data.transaction-object"));
                }
                if (ConfigContainer.Instance().AllKeys.Contains("interaction.disposition.key-name"))
                {
                    setting.VoiceDispositionKeyName = ConfigContainer.Instance().GetAsString("interaction.disposition.key-name");
                }
                if (ConfigContainer.Instance().AllKeys.Contains("interaction.disposition-collection.key-name"))
                {
                    setting.VoiceDispositionCollectionName = ConfigContainer.Instance().GetAsString("interaction.disposition-collection.key-name");
                }

                //}
            }
            catch (Exception ex)
            {
                logger.Error("Error occurred as " + ex.Message);
            }
        }
 private bool CheckPlcaeTaken(string agentLoginId, out string Name)
 {
     Name = "";
     try
     {
         if (!string.IsNullOrEmpty(agentLoginId) && agentLoginId != Settings.GetInstance().AgentLoginID)
         {
             Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgSwitch cfgswich = ConfigContainer.Instance().ConfServiceObject.RetrieveObject <Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgSwitch>
                                                                                                                (new Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgSwitchQuery()
             {
                 Name = Settings.GetInstance().Switch.Name
             });
             Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgAgentLogin agentLoginID =
                 ConfigContainer.Instance().ConfServiceObject.RetrieveObject <Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgAgentLogin>
                     (new Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgAgentLoginQuery()
             {
                 LoginCode = agentLoginId, SwitchDbid = cfgswich.DBID
             });
             Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgPerson person = ConfigContainer.Instance().ConfServiceObject.RetrieveObject <Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgPerson>(new Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgPersonQuery()
             {
                 LoginDbid = agentLoginID.DBID, SwitchDbid = cfgswich.DBID
             });
             Name = person.LastName + " " + person.FirstName;
             return(true);
         }
     }
     catch (Exception ex)
     { }
     return(false);
 }
Beispiel #6
0
        /// <summary>
        /// Reads the integration decision key collections.
        /// </summary>
        /// <param name="configProtocol">The configuration protocol.</param>
        /// <param name="applicationName">Name of the application.</param>
        /// <returns></returns>

        #region ReadIntegrationDecisionKeyCollections

        public void ReadIntegrationDecisionKeyCollections()
        {
            if (ConfigContainer.Instance().AllKeys.Contains("screen.pop.enable.port-integration"))
            {
                Settings.GetInstance().EnablePortCommunication = ConfigContainer.Instance().GetAsBoolean("screen.pop.enable.port-integration");
            }
            if (ConfigContainer.Instance().AllKeys.Contains("screen.pop.enable.file-integration"))
            {
                Settings.GetInstance().EnableFileCommunication = ConfigContainer.Instance().GetAsBoolean("screen.pop.enable.file-integration");
            }

            if (ConfigContainer.Instance().AllKeys.Contains("screen.pop.enable.url-integration"))
            {
                Settings.GetInstance().EnableURLCommunication = ConfigContainer.Instance().GetAsBoolean("screen.pop.enable.url-integration");
            }
            if (ConfigContainer.Instance().AllKeys.Contains("screen.pop.enable.pipe-integration"))
            {
                Settings.GetInstance().EnablePipeCommunication = ConfigContainer.Instance().GetAsBoolean("screen.pop.enable.pipe-integration");
            }
            if (ConfigContainer.Instance().AllKeys.Contains("screen.pop.enable.db-integration"))
            {
                Settings.GetInstance().EnableCrmDbCommunication = ConfigContainer.Instance().GetAsBoolean("screen.pop.enable.db-integration");
            }
            if (ConfigContainer.Instance().AllKeys.Contains("screen.pop.enable.ws.integration"))
            {
                Settings.GetInstance().EnableDualCommunication = ConfigContainer.Instance().GetAsBoolean("screen.pop.enable.ws.integration");
            }
            if (ConfigContainer.Instance().AllKeys.Contains("voice.enable.facet-all-property"))
            {
                Settings.GetInstance().EnablePortCommunication = ConfigContainer.Instance().GetAsBoolean("voice.enable.facet-all-property");
            }
        }
        private string GetValue(string KeyName)
        {
            var value = string.Empty;

            value = ConfigContainer.Instance().AllKeys.Contains(KeyName) ? ConfigContainer.Instance().GetValue(KeyName) : string.Empty;
            return(value);
        }
Beispiel #8
0
 /// <summary>
 /// Does the email accept.
 /// </summary>
 public void DoEmailAccept()
 {
     try
     {
         Dispatcher.Invoke(new Action(() =>
         {
             //if (!EmailNotifier.needPerformAccept)
             //    return;
             //EmailNotifier.needPerformAccept = false;
             InteractionService interactionService = new InteractionService();
             Pointel.Interactions.Core.Common.OutputValues acceptInteraction = interactionService.AcceptInteraction(eventInvite.TicketId, eventInvite.Interaction.InteractionId, eventInvite.ProxyClientId);
             if (acceptInteraction.MessageCode == "200")
             {
                 EmailMainWindow emailMainWindow = new EmailMainWindow(eventInvite, FirstName, LastName);
                 emailMainWindow.Show();
                 if (!ConfigContainer.Instance().AllKeys.Contains("email.enable.auto-answer") ||
                     (ConfigContainer.Instance().AllKeys.Contains("email.enable.auto-answer") &&
                      ((string)ConfigContainer.Instance().GetValue("email.enable.auto-answer")).ToLower().Equals("false")))
                 {
                     HideWidow();
                 }
             }
         }));
     }
     catch (Exception ex)
     {
         logger.Error("Error occurred as " + ex.ToString());
     }
 }
 public void UpdateSelectedWorkbin()
 {
     try
     {
         if (ConfigContainer.Instance().AllKeys.Contains("CfgPerson"))
         {
             CfgPerson person = ConfigContainer.Instance().GetValue("CfgPerson") as CfgPerson;
             if (!person.UserProperties.ContainsKey("agent.ixn.desktop"))
             {
                 person.UserProperties.Add("agent.ixn.desktop", new KeyValueCollection());
             }
             KeyValueCollection option = person.UserProperties["agent.ixn.desktop"] as KeyValueCollection;
             if (!string.IsNullOrEmpty(WorkbinUtility.Instance().SelectedWorkbinName))
             {
                 if (!option.ContainsKey("workbins.workbin-selected"))
                 {
                     option.Add("workbins.workbin-selected", WorkbinUtility.Instance().SelectedWorkbinName);
                 }
                 else
                 {
                     option["workbins.workbin-selected"] = WorkbinUtility.Instance().SelectedWorkbinName;
                 }
             }
             person.UserProperties["agent.ixn.desktop"] = option;
             person.Save();
             person = null;
         }
     }
     catch (Exception ex)
     {
         logger.Error("Error when updating selected workbin " + ex.ToString());
     }
 }
 private void tabDataUC_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         var item     = sender as TabControl;
         var selected = item.SelectedItem as TabItem;
         if (selected.Header.ToString() == "_Dispositions" && _dispositionUC != null)
         {
             Dictionary <string, string> dispositionCode = new Dictionary <string, string>();
             if (!string.IsNullOrEmpty(CurrentData[(ConfigContainer.Instance().GetValue("interaction.disposition.key-name"))]))
             {
                 dispositionCode.Add(ConfigContainer.Instance().GetValue("interaction.disposition.key-name"),
                                     CurrentData[(ConfigContainer.Instance().GetValue("interaction.disposition.key-name"))]);
             }
             else
             {
                 dispositionCode.Add(ConfigContainer.Instance().GetValue("interaction.disposition.key-name"),
                                     "None");
             }
             _dispositionUC.ReLoadDispositionCodes(dispositionCode, interactionId);
         }
     }
     catch (Exception ex)
     {
         logger.Error("Error occurred at tabDataUC_SelectionChanged" + ex.Message);
     }
 }
Beispiel #11
0
        public void ReadTransaction(ConfService configProtocol, string transactionName)
        {
            try
            {
                // application = new CfgApplication(.Instance().ComObject);
                //CfgTransactionQuery trasactionQuery = new CfgTransactionQuery();
                //trasactionQuery.Name = transactionName;
                //CfgTransaction transaction = configProtocol.RetrieveObject<CfgTransaction>(trasactionQuery);
                //if (transaction != null)
                //{
                //    if (transaction.UserProperties.ContainsKey("voice.case-data-filter"))
                //    {
                KeyValueCollection keys = ConfigContainer.Instance().GetValue("VoiceAttachDataFilterKey") as KeyValueCollection;
                //(KeyValueCollection)transaction.UserProperties["voice.case-data-filter"];
                if (keys != null)
                {
                    foreach (object value in keys.Values)
                    {
                        setting.VoiceFilterKey.Add(value.ToString());
                    }
                }
                //    }

                //}
            }
            catch (Exception ex)
            {
                logger.Error("Error occurred as " + ex.Message);
            }
        }
Beispiel #12
0
        public static List <string> ReadConfigKeys(string keyName, string[] defaultValues, List <string> validValues)
        {
            List <string> listValues = new List <string>();

            Pointel.Logger.Core.ILog _logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType,
                                                                                        "AID");
            try
            {
                if (ConfigContainer.Instance().AllKeys.Contains(keyName) &&
                    !string.IsNullOrEmpty(ConfigContainer.Instance().GetAsString(keyName).Trim()))
                {
                    listValues = validValues.Intersect(ConfigContainer.Instance().GetAsString(keyName).Split(',').Select(x => x.Trim()).ToArray().ToList()).ToList();

                    if (listValues.Count > 1)
                    {
                        listValues = listValues.Distinct().ToList();
                    }

                    if (listValues.Count == 0)
                    {
                        listValues = new List <string>(defaultValues);
                    }
                }
                else
                {
                    listValues = new List <string>(defaultValues);
                }
            }
            catch (Exception generalException)
            {
                _logger.Error("btnAdvanceSearch_Click: Error occurred as " + generalException.ToString());
            }
            return(listValues);
        }
Beispiel #13
0
 /// <summary>
 /// Mouses the left button down.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param>
 private void MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     try
     {
         this.DragMove();
         if (!(ConfigContainer.Instance().AllKeys.Contains("allow.system-draggable") &&
               ((string)ConfigContainer.Instance().GetValue("allow.system-draggable")).ToLower().Equals("true")))
         {
             if (Left < 0)
             {
                 Left = 0;
             }
             if (Top < 0)
             {
                 Top = 0;
             }
             if (Left > SystemParameters.WorkArea.Right - Width)
             {
                 Left = SystemParameters.WorkArea.Right - Width;
             }
             if (Top > SystemParameters.WorkArea.Bottom - Height)
             {
                 Top = SystemParameters.WorkArea.Bottom - Height;
             }
             ;
         }
     }
     catch { }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="DialPad"/> class.
        /// </summary>
        public DialPad(ChatUtil chatUtil)
        {
            InitializeComponent();
            _chatUtil        = chatUtil;
            this.DataContext = _chatUtil;
            txtNumbers.Focus();
            _chatUtil.Contacts.Clear();
            _chatUtil.ContactsFilter.Clear();
            _chatUtil.DialedNumbers = string.Empty;
            MenuItem mnuItem = new MenuItem();

            mnuItem.Header = "Dial";
            mnuItem.VerticalContentAlignment = VerticalAlignment.Center;
            mnuItem.Height     = 18;
            mnuItem.Background = System.Windows.Media.Brushes.Transparent;
            mnuItem.Icon       = new System.Windows.Controls.Image {
                Height = 12, Width = 12, Source = _chatDataContext.GetBitmapImage(new Uri("/Agent.Interaction.Desktop;component/Images/Voice.Short.png", UriKind.Relative))
            };
            mnuItem.Click += new RoutedEventHandler(mnuItem_Click);
            _phoneBookMenu.Items.Add(mnuItem);
            if (_chatUtil.DialedNumbers.Length >= 9 && _chatUtil.ModifiedTextSize != 0)
            {
                txtNumbers.FontSize = _chatUtil.ModifiedTextSize;
            }
            Loaded += (s, e) =>
            {
                Window.GetWindow(this)
                .Closing += (s1, e1) => Somewhere();
            };

            if (ConfigContainer.Instance().AllKeys.Contains("voice.enable.phonebook.double-click-to-call") && ((string)ConfigContainer.Instance().GetValue("voice.enable.phonebook.double-click-to-call")).ToLower().Equals("true"))
            {
                dgvContact.MouseDoubleClick += new MouseButtonEventHandler(dgvContact_MouseDoubleClick);
            }
        }
 /// <summary>
 /// Inserts the agent login activity.
 /// </summary>
 public void InsertAgentLoginActivity()
 {
     try
     {
         if (ConfigContainer.Instance().AllKeys.Contains("tblAgentLogin") &&
             !string.IsNullOrEmpty(ConfigContainer.Instance().GetValue("tblAgentLogin")) && !string.IsNullOrEmpty(settings.AgentLoginID))
         {
             logger.Info("InsertAgentLoginActivity : Entry");
             string time  = DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString();
             string query = "Insert into " + ConfigContainer.Instance().GetValue("tblAgentLogin") +
                            "(Date,AgentLoginID,TimeStamp) values('" + DateTime.Now.Date.ToString() + "','" + settings.AgentLoginID + "','" + time + "')";
             db                  = new Database();
             db.Provider         = "System.Data.SqlClient";
             db.ConnectionString = connectionString;
             db.CreateConnection(true);
             logger.Info("InsertAgentLoginActivity: Connection Created");
             db.ExecuteNonQuery(query);
             logger.Info("InsertAgentLoginActivity: Query Executed : " + query);
             db.CloseConnection();
             logger.Info("InsertAgentLoginActivity: Connection Closed");
             GetLoginDBID(ConfigContainer.Instance().GetValue("tblAgentLogin"), DateTime.Now.Date.ToString(), settings.AgentLoginID, time);
             logger.Info("InsertAgentLoginActivity : Exit");
         }
     }
     catch (Exception ex)
     {
         logger.Error("Exception During Inserting AgentLoginActivity: " + ex.Message);
     }
 }
        public void LoadDispostionCodes(string interactionID)
        {
            try
            {
                if (_chatDataContext.LoadDispositionCodes != null && _chatDataContext.LoadSubDispositionCodes != null)
                {
                    _chatDataContext.dicCMEObjects.Clear();
                    _chatDataContext.dicCMEObjects.Add("chat.disposition.codes", _chatDataContext.LoadDispositionCodes);
                    _chatDataContext.dicCMEObjects.Add("chat.subdisposition.codes", _chatDataContext.LoadSubDispositionCodes);
                    if (ConfigContainer.Instance().AllKeys.Contains("interaction.enable.multi-dispositioncode") && (((string)ConfigContainer.Instance().GetValue("interaction.enable.multi-dispositioncode")).ToLower().Equals("true")))
                    {
                        _chatDataContext.dicCMEObjects.Add("enable.multidisposition.enabled", true);
                    }
                    else
                    {
                        _chatDataContext.dicCMEObjects.Add("enable.multidisposition.enabled", false);
                    }
                    _chatDataContext.dicCMEObjects.Add("DispositionCodeKey", _chatDataContext.DisPositionKeyName);
                    if (ConfigContainer.Instance().AllKeys.Contains("interaction.disposition-object-name"))
                    {
                        _chatDataContext.dicCMEObjects.Add("DispositionName", (string)ConfigContainer.Instance().GetValue("interaction.disposition-object-name"));
                    }
                    else
                    {
                        _chatDataContext.dicCMEObjects.Add("DispositionName", string.Empty);
                    }
                    Pointel.Interactions.DispositionCodes.InteractionHandler.Listener _dispositionCodeListener = new Pointel.Interactions.DispositionCodes.InteractionHandler.Listener();
                    _dispositionCodeListener.NotifyCMEObjects(_chatDataContext.dicCMEObjects);
                    DispositionData disData = new DispositionData()
                    {
                        InteractionID = interactionID
                    };
                    _dispositionUC = _dispositionCodeListener.CreateUserControl();
                    _chatDataContext.DispositionObjCollection = new KeyValuePair <string, object>("DispositionObj", _dispositionUC);
                    stpDispCodelist.Children.Clear();
                    _dispositionUC.NotifyDispositionCodeEvent += new Pointel.Interactions.DispositionCodes.UserControls.Disposition.NotifyDispositionCode(NotifyDispositionCodeEvent);
                    _dispositionUC.Dispositions(Pointel.Interactions.IPlugins.MediaTypes.Chat, disData);

                    if (_dispositionUC != null)
                    {
                        if (!_dispositionUserControls.ContainsKey(interactionID))
                        {
                            _dispositionUserControls.Add(interactionID, _dispositionUC);
                        }
                        else
                        {
                            _dispositionUserControls[interactionID] = _dispositionUC;
                        }
                        stpDispCodelist.Children.Add(_dispositionUC);
                    }
                    isFirstTimeCall = false;
                }
            }
            catch (Exception generalException)
            {
                _logger.Error("Error Occurred as LoadDispostionCodes() :" + generalException.Message);
            }
        }
 public CaseWindow()
 {
     InitializeComponent();
     this.DataContext         = Datacontext.GetInstance();
     this._configContainer    = ConfigContainer.Instance();
     ShadowEffect.ShadowDepth = 0;
     ShadowEffect.Opacity     = 0.5;
     ShadowEffect.Softness    = 0.5;
     ShadowEffect.Color       = (Color)ColorConverter.ConvertFromString("#003660");
     //webBrowser.Visibility = System.Windows.Visibility.Visible;
     //webBrowser.Navigate(new Uri("https://www.google.com"));
 }
        public void StartHIMMSIntegration()
        {
            Thread objThread = new Thread(() =>
            {
                try
                {
                    CfgApplication application = null;
                    if (ConfigContainer.Instance().AllKeys.Contains("CfgApplication"))
                    {
                        application = ConfigContainer.Instance().GetValue("CfgApplication");
                    }
                    if (application != null)
                    {
                        if (!application.Options.ContainsKey("himms-integration"))
                        {
                            _logger.Warn("The HIMMS integration's configuration not found.");
                            return;
                        }

                        KeyValueCollection kvHIMMS = application.Options.GetAsKeyValueCollection("himms-integration");

                        HimmsIntegrationData objHimmsConfiguration = new HimmsIntegrationData();
                        _logger.Trace("Try to parse the HIMMS configuration.");
                        objHimmsConfiguration.ParseConfiguration(kvHIMMS);
                        _logger.Trace("The HIMMS configuration parsed successfully.");
                        //mannual login.
                        //objHimmsConfiguration.UserName = username;
                        //objHimmsConfiguration.Password = password;
                        if (objHimmsConfiguration.IsEnabled)
                        {
                            HimmsSubscriber objHimmsSubscriber = new HimmsSubscriber(objHimmsConfiguration);

                            _logger.Trace("Try to subcribe the HIMMS integration.");

                            objHimmsSubscriber.Subscribe(newCallDataProvider);

                            _logger.Trace("The HIMMS integration subscribed successfully.");
                        }
                    }
                    else
                    {
                        _logger.Warn("The application object is null while start HIMMS integration.");
                    }
                }
                catch (Exception generalException)
                {
                    _logger.Error("Error occurred as " + generalException.Message);
                    _logger.Trace("Error Trace : " + generalException.StackTrace);
                }
            });

            objThread.Start();
        }
        public static int EmailMaxAttachmentSize()
        {
            //Get Attachment Max Size
            int EmailAttachmentMaxSize = 0;
            var sizeString             = (ConfigContainer.Instance().AllKeys.Contains("email.max-attachments-size") ? (string)ConfigContainer.Instance().GetValue("email.max-attachments-size") : string.Empty);
            var amSize = 0;

            if (int.TryParse(sizeString, out amSize))
            {
                EmailAttachmentMaxSize = amSize;
            }
            return(EmailAttachmentMaxSize);
        }
        /// <summary>
        /// Handles the Loaded event of the UserControl control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            this.DataContext = emailDetails;
            ConvertUserData();

            txtNotes.Text = notes;
            if (!(ConfigContainer.Instance().AllKeys.Contains("email.enable.add-case-data") &&
                  ((string)ConfigContainer.Instance().GetValue("email.enable.add-case-data")).ToLower().Equals("true")) &&
                _caseDataAdd != null && _caseDataAdd.Items.Count > 0)
            {
                btnAddCaseData.Visibility = Visibility.Collapsed;
            }
            LoadDispostionCodes(interactionId);
        }
        /// <summary>
        /// Handles the Checked event of the ChkApplicationLevel control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void ChkApplicationLevel_Checked(object sender, RoutedEventArgs e)
        {
            Thread contactControl;

            try
            {
                //if (ConfigContainer.Instance().AllKeys.Contains("GlobalContacts") && ConfigContainer.Instance().GetValue("GlobalContacts") != null)
                //    ProcessConfigurationData(ConfigContainer.Instance().GetValue("GlobalContacts"));

                if (ConfigContainer.Instance().AllKeys.Contains("GlobalContacts") && ConfigContainer.Instance().GetValue("GlobalContacts") != null)
                {
                    try
                    {
                        _chatDataContext.HshApplicationLevel.Clear();
                        foreach (var name in ((KeyValueCollection)ConfigContainer.Instance().GetValue("GlobalContacts")).AllKeys.Where(name => !_chatDataContext.HshApplicationLevel.ContainsKey(name)))
                        {
                            _chatDataContext.HshApplicationLevel.Add(name, ((KeyValueCollection)ConfigContainer.Instance().GetValue("GlobalContacts"))[name].ToString());
                        }
                    }
                    catch (Exception ex)
                    {
                        logger.Error("Error loading when Global contacts : " + ((ex.InnerException == null) ? ex.Message : ex.InnerException.ToString()));
                    }
                }

                _applcationContact = (Hashtable)_chatDataContext.HshApplicationLevel;
                if (!_applcationContact.ContainsKey("type"))
                {
                    _applcationContact.Add("type", 12);
                }
                else
                {
                    _applcationContact["type"] = 12;
                }
                contactControl = new Thread(new ParameterizedThreadStart(ContactController));
                contactControl.Start((object)_applcationContact);
                isGlobalContactChecked = true;
            }
            catch (Exception commonException)
            {
                logger.Error("chkApplicationLevel_CheckedChanged : Error occurred while getting contact details from application level " +
                             commonException.ToString());
            }
            finally
            {
                contactControl = null;
            }
        }
        public static bool IsEmailReachMaximumCount()
        {
            int maximumEmailCount = 5;

            if (ConfigContainer.Instance().AllKeys.Contains("email.max.intstance-count"))
            {
                int.TryParse(((string)ConfigContainer.Instance().GetValue("email.max.intstance-count")), out maximumEmailCount);
            }
            List <Window> emailWindows = Application.Current.Windows.Cast <Window>().Where(x => x.Title.Equals("Email")).ToList();

            if (emailWindows.Count == maximumEmailCount)
            {
                return(true);
            }
            return(false);
        }
        /// <summary>
        /// Handles the Checked event of the ChkGroupLevel control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void ChkGroupLevel_Checked(object sender, RoutedEventArgs e)
        {
            Thread contactControl;

            try
            {
                if (ConfigContainer.Instance().AllKeys.Contains("GroupContacts") && ConfigContainer.Instance().GetValue("GroupContacts") != null)
                {
                    ChatDataContext.hshLoadGroupContact.Clear();
                    try
                    {
                        foreach (string name in ((KeyValueCollection)ConfigContainer.Instance().GetValue("GroupContacts")).Keys)
                        {
                            ChatDataContext.hshLoadGroupContact.Add(name, ((KeyValueCollection)ConfigContainer.Instance().GetValue("GroupContacts"))[name].ToString());
                        }
                    }
                    catch (Exception ex)
                    {
                        logger.Error("Error loading when Group contacts : " + ((ex.InnerException == null) ? ex.Message : ex.InnerException.ToString()));
                    }
                }

                groupContact = (Hashtable)ChatDataContext.hshLoadGroupContact;

                if (!groupContact.ContainsKey("type"))
                {
                    groupContact.Add("type", 13);
                }
                else
                {
                    groupContact["type"] = 13;
                }
                contactControl = new Thread(new ParameterizedThreadStart(ContactController));
                contactControl.Start((object)groupContact);
                isGroupContactChecked = true;
            }
            catch (Exception generalException)
            {
                logger.Error("chkGroup_CheckedChanged : Error occurred while getting contact details from agent group level " +
                             generalException.ToString());
            }
            finally
            {
                contactControl = null;
                //GC.Collect();
            }
        }
Beispiel #24
0
        /// <summary>
        /// Converts a value.
        /// </summary>
        /// <param name="value">The value produced by the binding source.</param>
        /// <param name="targetType">The type of the binding target property.</param>
        /// <param name="parameter">The converter parameter to use.</param>
        /// <param name="culture">The culture to use in the converter.</param>
        /// <returns>A converted value. If the method returns null, the valid null value is used.</returns>
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ImageSource imgSource = null;

            if (value.ToString().ToLower().Contains("email"))
            {
                imgSource = new BitmapImage(new Uri((ConfigContainer.Instance().AllKeys.Contains("image-path") ? (string)ConfigContainer.Instance().GetValue("image-path") : string.Empty) + "\\Email\\Email.png", UriKind.Relative));
            }
            else if (value.ToString().ToLower().Contains("chat"))
            {
                imgSource = new BitmapImage(new Uri((ConfigContainer.Instance().AllKeys.Contains("image-path") ? (string)ConfigContainer.Instance().GetValue("image-path") : string.Empty) + "\\Chat\\Chat.png", UriKind.Relative));
            }
            else
            {
                imgSource = null;
            }
            return(imgSource);
        }
        public void StartWebIntegration(List <ApplicationDataDetails> lstApplication)
        {
            try
            {
                if (lstApplication != null)
                {
                    CfgApplication application = null;
                    if (ConfigContainer.Instance().AllKeys.Contains("CfgApplication"))
                    {
                        application = ConfigContainer.Instance().GetValue("CfgApplication");
                    }

                    if (application != null)
                    {
                        List <WebIntegrationData> lstWebIntegration = GetConfiguredIntegration <WebIntegrationData>("web-integration.");
                        if (lstWebIntegration != null)
                        {
                            for (byte index = 0; index < lstWebIntegration.Count; index++)
                            {
                                if (lstWebIntegration[index].IsConditional && lstApplication.Any(x => x.ApplicationName == lstWebIntegration[index].ApplicationName))
                                {
                                    DesktopMessenger.totalWebIntegration++;
                                    lstWebIntegration[index].ApplicationData = lstApplication.SingleOrDefault(x => x.ApplicationName == lstWebIntegration[index].ApplicationName);
                                    UrlSubscriber objUrlIntegration = new UrlSubscriber(lstWebIntegration[index]);
                                    objUrlIntegration.Subscribe(newCallDataProvider);

                                    // If it is need , Need to call OnNext method.
                                    //objUrlIntegration.OnNext(null);
                                }
                            }
                        }
                    }
                }
                else
                {
                    _logger.Warn("The web integration is null.");
                }
            }
            catch (Exception generalException)
            {
                _logger.Error("Error occurred as " + generalException.Message);
                _logger.Trace("Error trace: " + generalException.Message);
            }
        }
Beispiel #26
0
 /// <summary>
 /// Reads the case data push URL disposition.
 /// </summary>
 public void ReadCaseDataPushUrlDisposition()
 {
     try
     {
         loadCaseDataKey.Clear();
         loadCaseDataFilterKey.Clear();
         loadCaseDataSortingKey.Clear();
         loadAvailablePushURL.Clear();
         dispositionCodes.Clear();
         dispositionSubCodes.Clear();
         if (ConfigContainer.Instance().AllKeys.Contains("ChatAttachDataKey") && ConfigContainer.Instance().GetValue("ChatAttachDataKey") != null)
         {
             loadCaseDataKey = ConfigContainer.Instance().GetValue("ChatAttachDataKey");
         }
         if (ConfigContainer.Instance().AllKeys.Contains("ChatAttachDataFilterKey") && ConfigContainer.Instance().GetValue("ChatAttachDataFilterKey") != null)
         {
             loadCaseDataFilterKey = ConfigContainer.Instance().GetValue("ChatAttachDataFilterKey");
         }
         if (ConfigContainer.Instance().AllKeys.Contains("ChatAttachDataSortKey") && ConfigContainer.Instance().GetValue("ChatAttachDataSortKey") != null)
         {
             loadCaseDataSortingKey = ConfigContainer.Instance().GetValue("ChatAttachDataSortKey");
         }
         if (ConfigContainer.Instance().AllKeys.Contains("ChatPushUrl") && ConfigContainer.Instance().GetValue("ChatPushUrl") != null)
         {
             loadAvailablePushURL = ConfigContainer.Instance().GetValue("ChatPushUrl");
         }
         if (ConfigContainer.Instance().AllKeys.Contains("chat.disposition.codes"))
         {
             dispositionCodes = ConfigContainer.Instance().GetValue("chat.disposition.codes");
         }
         if (ConfigContainer.Instance().AllKeys.Contains("interaction.enable.multi-dispositioncode") && (((string)ConfigContainer.Instance().GetValue("interaction.enable.multi-dispositioncode")).ToLower().Equals("true")))
         {
             if (ConfigContainer.Instance().AllKeys.Contains("chat.subdisposition.codes"))
             {
                 dispositionSubCodes = ConfigContainer.Instance().GetValue("chat.subdisposition.codes");
             }
         }
     }
     catch (Exception ex)
     {
         logger.Error((ex.InnerException == null) ? ex.Message : ex.InnerException.ToString());
     }
 }
 private bool IsValidQueue(string queueName)
 {
     try
     {
         CfgScriptQuery qScripts = new CfgScriptQuery();
         qScripts.ScriptType = Genesyslab.Platform.Configuration.Protocols.Types.CfgScriptType.CFGInteractionQueue;
         qScripts.Name       = queueName;
         qScripts.TenantDbid = ConfigContainer.Instance().TenantDbId;
         CfgScript interactionqueue = ((Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService)ConfigContainer.Instance().ConfServiceObject).RetrieveObject <CfgScript>(qScripts);
         if (interactionqueue != null)
         {
             return(true);
         }
     }
     catch (Exception generalException)
     {
         _logger.Error("Error occurred as :" + generalException.ToString());
     }
     return(false);
 }
Beispiel #28
0
        public bool StorerDispositionDetail(DispositionDetail objDispositionDetail, out string ErrorMessage)
        {
            ErrorMessage = string.Empty;
            try
            {
                string _query = GenerateInserQuery(objDispositionDetail);
                _logger.Info("Query: " + _query);
                Database db = new Database();
                db.Provider = "System.Data.OracleClient";
                _logger.Info("Forming connection string for disposition db.");
                if (ConfigContainer.Instance().AllKeys.Contains("disposition.db.servicename"))
                {
                    db.ConnectionString = "Data Source = (Description=(Address_list=(Address=(Protocol=TCP)(HOST=" + GetValue("disposition.db.host") + ")(PORT=" + GetValue("disposition.db.port") + ")))" +
                                          "(CONNECT_DATA=(SERVICE_NAME=" + GetValue("disposition.db.servicename") + ")));User Id =" + GetValue("disposition.db.userid") + ";Password="******"disposition.db.Password");
                }
                else if (ConfigContainer.Instance().AllKeys.Contains("disposition.db.sid"))
                {
                    db.ConnectionString = "Data Source = (Description=(Address_list=(Address=(Protocol=TCP)(HOST=" + GetValue("disposition.db.host") + ")(PORT=" + GetValue("disposition.db.port") + ")))" +
                                          "(CONNECT_DATA=(SID=" + GetValue("disposition.db.sid") + ")));User Id =" + GetValue("disposition.db.userid") + ";Password="******"disposition.db.Password");
                }

                _logger.Info("Disposition db connection string : " + db.ConnectionString);

                if (string.IsNullOrEmpty(db.ConnectionString))
                {
                    throw new Exception("The database connection string is not configured to disposition database.");
                }
                db.CreateConnection(true);
                db.ExecuteNonQuery(_query);
                db.CloseConnection();
                db           = null;
                ErrorMessage = "Success";
                return(true);
            }
            catch (System.Exception _generalException)
            {
                ErrorMessage = _generalException.Message;
                _logger.Error("Error Occurred as " + _generalException.Message);
            }
            return(false);
        }
Beispiel #29
0
        void mediaPlayer_MediaEnded(object sender, EventArgs e)
        {
            try
            {
                mediaPlayer.Stop();

                //Check the duration is -1, then repeat the audio.
                if (!string.IsNullOrEmpty(((string)ConfigContainer.Instance().GetValue("email.ringing-bell")).Split('|')[2]) && (((string)ConfigContainer.Instance().GetValue("email.ringing-bell")).Split('|')[2]) == "-1")
                {
                    mediaPlayer.Play();
                }
                else
                {
                    isPlayTone = false;
                }
            }
            catch (Exception ex)
            {
                logger.Error("Error occurred in media player ended event " + ex.Message);
            }
        }
 public void BindGrid()
 {
     try
     {
         if (_chatUtil.UserData.Count != 0)
         {
             _chatUtil.NotifyCaseData.Clear();
             foreach (string key in _chatUtil.UserData.Keys)
             {
                 if (_chatUtil.NotifyCaseData.Count(p => p.Key == key) == 0)
                 {
                     if (ConfigContainer.Instance().AllKeys.Contains("chat.enable.case-data-filter") && (((string)ConfigContainer.Instance().GetValue("chat.enable.case-data-filter")).ToLower().Equals("true")))
                     {
                         if ((_chatDataContext.LoadCaseDataFilterKeys != null && _chatDataContext.LoadCaseDataFilterKeys.Contains(key)) || (_chatDataContext.LoadCaseDataFilterKeys != null && _chatDataContext.LoadCaseDataKeys.Contains(key)))
                         {
                             _chatUtil.NotifyCaseData.Add(new ChatCaseData(key, _chatUtil.UserData[key].ToString()));
                         }
                     }
                     else
                     {
                         _chatUtil.NotifyCaseData.Add(new ChatCaseData(key, _chatUtil.UserData[key].ToString()));
                     }
                 }
             }
             if (_chatUtil.UserData.ContainsKey(_chatDataContext.DisPositionKeyName))
             {
                 _chatUtil.NotifyCaseData.Add(new ChatCaseData(_chatDataContext.DisPositionKeyName, _chatUtil.UserData[_chatDataContext.DisPositionKeyName].ToString()));
             }
             if (_chatUtil.UserData.ContainsKey(_chatDataContext.DispositionCollectionKeyName))
             {
                 _chatUtil.NotifyCaseData.Add(new ChatCaseData(_chatDataContext.DispositionCollectionKeyName, _chatUtil.UserData[_chatDataContext.DispositionCollectionKeyName].ToString()));
             }
             _chatUtil.NotifyCaseData = new ObservableCollection <IChatCaseData>(_chatUtil.NotifyCaseData.OrderBy(callData => callData.Key));
         }
     }
     catch (Exception generalException)
     {
         _logger.Error("Error Occurred as BindGrid() :" + generalException.Message);
     }
 }