/// <summary>
 ///
 /// </summary>
 /// <param name="newInspector"></param>
 private void Inspectors_NewInspector(Inspector newInspector)
 {
     if (newInspector != null)
     {
         InspectorWrapper wrapper = new InspectorWrapper(newInspector);
         _InspectorWrappers.Add(wrapper.GetHashCode(), wrapper);
     }
 }
        public void start()
        {
            try
            {
                if (_item is AppointmentItem)
                {
                    AppointmentItem theItem          = _item as AppointmentItem;
                    String          conferenceNumber = Utility.getConferenceNumber(theItem.Location);

                    InputConfirmWindow ccwnd = null;
                    if (conferenceNumber == null)
                    {
                        ccwnd = new InputConfirmWindow(Error.ERROR_MSG_NO_CONFERENCE_NUMBER, String.Empty);
                    }

                    else if (Utility.checkInvalidLetters(conferenceNumber))
                    {
                        ccwnd = new InputConfirmWindow(Error.ERROR_MSG_INVALID_CONFERENCE_NUMBER, conferenceNumber);
                    }

                    else
                    {
                        ccwnd = new InputConfirmWindow(Error.CONFIRM_MSG_CONFERENCE_NUMBER, conferenceNumber);
                    }

                    if (DialogResult.OK != ccwnd.ShowDialog())
                    {
                        return;
                    }

                    conferenceNumber = ccwnd.DestinationNumber;
                    RestInterface.restCall(conferenceNumber, Utility.getSCSAccountPassWord());
                }
                else if (_item is MailItem)
                {
                    MailItem theItem = _item as MailItem;

                    Hashtable phoneNumberList = null;
                    phoneNumberList = InspectorWrapper.resolveContactNumberFromLocal(theItem.SenderEmailAddress, theItem.SenderName);
                    if (phoneNumberList == null)
                    {
                        phoneNumberList = InspectorWrapper.resolveContactNumberFromGAL(theItem.SenderName);
                    }

                    String calledNumber = String.Empty;
                    if (phoneNumberList == null)
                    {
                        InputConfirmWindow ccwnd = new InputConfirmWindow(Error.ERROR_MSG_NO_SENDER_NUMBER, String.Empty);
                        if (DialogResult.OK != ccwnd.ShowDialog())
                        {
                            return;
                        }
                        calledNumber = ccwnd.DestinationNumber;
                    }
                    else
                    {
                        ComboConfirmWindow ccwnd = new ComboConfirmWindow("Sure to call the sender at this number? (or pick/type a new number)", phoneNumberList);
                        if (DialogResult.Yes != ccwnd.ShowDialog())
                        {
                            return;
                        }
                        calledNumber = ccwnd.DestinationNumber;
                    }

                    RestInterface.restCall(calledNumber, Utility.getSCSAccountPassWord());
                }
                else if (_item is ContactItem)
                {
                    ContactItem theItem = _item as ContactItem;

                    Hashtable phonelist = InspectorWrapper.getPhoneList(theItem);

                    String calledNumber = string.Empty;
                    if (phonelist == null)
                    {
                        InputConfirmWindow ccwnd = new InputConfirmWindow(Error.ERROR_MSG_NO_CONTACT_NUMBER, String.Empty);
                        if (DialogResult.OK != ccwnd.ShowDialog())
                        {
                            return;
                        }
                        calledNumber = ccwnd.DestinationNumber;
                    }

                    else
                    {
                        ComboConfirmWindow ccwnd = new ComboConfirmWindow(Error.CONFIRM_MSG_CONTACT_NUMBER, phonelist);
                        if (DialogResult.Yes != ccwnd.ShowDialog())
                        {
                            return;
                        }
                        calledNumber = ccwnd.DestinationNumber;
                    }

                    RestInterface.restCall(calledNumber, Utility.getSCSAccountPassWord());
                }
            }

            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="control"></param>
        public void SetMeetingLocation(IRibbonControl control)
        {
            bool cancel = false;

            InspectorWrapper.scsmeetingButton_Click(null, ref cancel);
        }
Exemple #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="newInspector"></param>        
        private void Inspectors_NewInspector(Inspector newInspector)
        {

            if (newInspector != null)
            {
                InspectorWrapper wrapper = new InspectorWrapper(newInspector);
                _InspectorWrappers.Add(wrapper.GetHashCode(), wrapper);
            }

        }