예제 #1
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());
     }
 }
        // Reply All - True
        /// <summary>
        /// Notifies the email reply.
        /// </summary>
        /// <param name="parentIxnId">The parent ixn identifier.</param>
        /// <param name="isReplyAll">if set to <c>true</c> [is reply all].</param>
        public void NotifyEmailReply(string parentIxnId, bool isReplyAll = false)
        {
            EmailMainWindow emailMainWindow = new EmailMainWindow(parentIxnId, isReplyAll);

            emailMainWindow.Show();
        }
        /// <summary>
        /// Notifies the new email.
        /// </summary>
        /// <param name="emailAddress">The email address.</param>
        /// <param name="contactID">The contact identifier.</param>
        public void NotifyNewEmail(string emailAddress, string contactID, string outboundIXNID = null)
        {
            EmailMainWindow emailMainWindow = new EmailMainWindow(emailAddress, contactID, outboundIXNID);

            emailMainWindow.Show();
        }
        /// <summary>
        /// Notifies the email interaction.
        /// </summary>
        /// <param name="message">The message.</param>
        public void NotifyEmailInteraction(Genesyslab.Platform.Commons.Protocols.IMessage message)
        {
            try
            {
                switch (message.Id)
                {
                case EventInvite.MessageId:

                    // Newly Added
                    // Start
                    CheckAutoAnswer(message as EventInvite);
                    // Stop

                    //Old Code
                    // Start
                    //  EventInvite eventInvite = message as EventInvite;
                    //if (ConfigContainer.Instance().AllKeys.Contains("email.enable.auto-answer")
                    //    && ((string)ConfigContainer.Instance().GetValue("email.enable.auto-answer")).ToLower().Equals("true"))
                    //{
                    //    //EmailNotifier.needPerformAccept = true;
                    //    _taskbarNotifier.eventInvite = eventInvite;
                    //    _taskbarNotifier.ReadContactName();
                    //    _taskbarNotifier.DoEmailAccept();
                    //}
                    //else
                    //    ShowEmailNotifier(eventInvite);
                    // Stop

                    break;

                case EventRevoked.MessageId:
                    EventRevoked eventRevoked = message as EventRevoked;
                    if (_taskbarNotifier != null)
                    {
                        _taskbarNotifier.BindInfo(eventRevoked);
                    }

                    break;

                case EventAck.MessageId:
                    EventAck eventAck = message as EventAck;

                    break;

                case EventPulledInteractions.MessageId:
                    EventPulledInteractions puledIteraction = message as EventPulledInteractions;
                    if (puledIteraction.Interactions != null && puledIteraction.Interactions.Count > 0)
                    {
                        string[] keys           = puledIteraction.Interactions.AllKeys;
                        var      _interactionID = keys[0];
                        if (_interactionID != null)
                        {
                            EmailMainWindow mailWindow = new EmailMainWindow(puledIteraction);
                            mailWindow.Show();
                        }
                    }
                    break;
                }
            }
            catch (Exception exception)
            {
                logger.Error("NotifyEmailInteraction" + exception.ToString());
            }
        }