예제 #1
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;
             * }*/
        }
예제 #2
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;
                        }
                    }
                }
            }
        }