コード例 #1
0
        private WOSI.CallButler.Data.CallButlerDataset.CallHistoryRow GetUnderlyingRow(DataGridViewRow row)
        {
            DataRowView rv = (DataRowView)row.DataBoundItem;

            WOSI.CallButler.Data.CallButlerDataset.CallHistoryRow callRow = (WOSI.CallButler.Data.CallButlerDataset.CallHistoryRow)rv.Row;
            return(callRow);
        }
コード例 #2
0
        private void ViewInContactManager(DataGridViewRow row)
        {
            WOSI.CallButler.Data.CallButlerDataset.CallHistoryRow callRow = GetUnderlyingRow(row);

            IContactItem item = ContactManager.SearchContact(callRow.CallerUsername, callRow.CallerDisplayName);

            if (item == null || (callRow.IsCallerUsernameNull() || callRow.CallerUsername.Length == 0) && (callRow.IsCallerDisplayNameNull() || callRow.CallerDisplayName.Length == 0))
            {
                if (MessageBox.Show(CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallHistoryView_ContactNotFound), CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.CallHistoryView_NoContactFound), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    item          = ContactItemFactory.CreateContactItem(ContactManager);
                    item.FullName = callRow.CallerDisplayName;
                    item.BusinessTelephoneNumber = StringUtils.FormatPhoneNumber(callRow.CallerUsername);
                    ContactManager.ShowContactForm(item);
                }
            }
            else
            {
                ContactManager.ShowContactForm(item);
            }

            /*if (item != null)
             * {
             *  callRow.CallerDisplayName = item.FullName;
             * }*/
        }
コード例 #3
0
        private void LoadSelectedContacts()
        {
            if (ContactManager.IsInstalled)
            {
                WOSI.CallButler.Data.CallButlerDataset.CallHistoryRow[] rows = (WOSI.CallButler.Data.CallButlerDataset.CallHistoryRow[])GetSelectedGridRows();

                foreach (WOSI.CallButler.Data.CallButlerDataset.CallHistoryRow row in rows)
                {
                    IContactItem item = ContactManager.SearchContact(row.CallerUsername, row.CallerDisplayName);
                    if (item == null)
                    {
                        item = ContactItemFactory.CreateContactItem(ContactManager, row.CallerDisplayName, row.CallerUsername);
                    }
                    ContactManager.ShowContactForm(item);

                    if (row.Table.Columns["OriginalIndex"] != null)
                    {
                        WOSI.CallButler.Data.CallButlerDataset.CallHistoryRow cRow = GetUnderlyingRow(dgCalls.Rows[Convert.ToInt32(row["OriginalIndex"])]);
                        if (item != null)
                        {
                            cRow.CallerDisplayName = item.FullName;
                        }
                    }
                }
            }
        }
コード例 #4
0
        void telecomProvider_CallEnded(object sender, LineEventArgs e)
        {
            if (e.LineNumber == lineNumber)
            {
                try
                {
                    LoggingService.AddLogEntry(LogLevel.Basic, "(Line " + e.LineNumber + ") Call Ended", false);

                    StopSounds(e.LineNumber);

                    // Add a call history item
                    if (Properties.Settings.Default.EnableCallHistory)
                    {
                        WOSI.CallButler.Data.CallButlerDataset.CallHistoryDataTable callHistoryTable = new WOSI.CallButler.Data.CallButlerDataset.CallHistoryDataTable();
                        WOSI.CallButler.Data.CallButlerDataset.CallHistoryRow       callHistoryItem  = callHistoryTable.NewCallHistoryRow();

                        callHistoryItem.CallDuration      = (TimeSpan)(DateTime.Now - callStartTime);
                        callHistoryItem.CallerDisplayName = imlInterp.CallerDisplayName;
                        callHistoryItem.CallerHost        = imlInterp.CallerHost;
                        callHistoryItem.CallerUsername    = imlInterp.CallerUsername;
                        callHistoryItem.ToUsername        = imlInterp.DialedUsername;
                        callHistoryItem.ToHost            = imlInterp.DialedHost;
                        callHistoryItem.CallID            = Guid.NewGuid();
                        callHistoryItem.CustomerID        = Properties.Settings.Default.CustomerID;
                        callHistoryItem.Timestamp         = callStartTime;

                        callHistoryTable.AddCallHistoryRow(callHistoryItem);

                        dataProvider.PersistCallHistory(callHistoryItem);
                    }
                }
                catch (Exception ex)
                {
                    LoggingService.AddLogEntry(LogLevel.ErrorsOnly, "(Line " + lineNumber + ") Unable to add a call history entry: " + ex.ToString(), true);
                }

                //UpdateExtensionCall(e.LineNumber, CallStatus.NotOnCall, null, null);
                //UpdateExtensionCallStatus(CallStatus.NotOnCall);

                try
                {
                    if (imlInterp == null)
                    {
                        LoggingService.AddLogEntry(LogLevel.ErrorsOnly, "**** Iml Interpreter is NULL", true);
                    }

                    imlInterp.SignalHangup();
                }
                catch (Exception ex)
                {
                    LoggingService.AddLogEntry(LogLevel.ErrorsOnly, "(Line " + lineNumber + ") Unable to signal the end of a script: " + ex.ToString(), true);
                }

                if (imlInterp.ImlScript == null)
                {
                    // Automatically unlock our line
                    Locked = false;
                }

                callID    = Guid.Empty;
                extension = null;

                CheckAvailability();
            }
        }