Ejemplo n.º 1
0
        private void dgPhones_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == colConfigure.Index)
            {
                WOSI.CallButler.Data.CallButlerPhoneStatusDataset.PhoneStatusRow statusRow = (WOSI.CallButler.Data.CallButlerPhoneStatusDataset.PhoneStatusRow)dgPhones.Rows[e.RowIndex].Tag;

                ManagePhone(statusRow.RemoteAddress);
            }
        }
        public WOSI.CallButler.Data.CallButlerPhoneStatusDataset GetPhoneStatus()
        {
            WOSI.CallButler.Data.CallButlerPhoneStatusDataset psData = new WOSI.CallButler.Data.CallButlerPhoneStatusDataset();

            WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensions = dataProvider.GetExtensions(Properties.Settings.Default.CustomerID);

            // Loop through each extension and get a status for it
            foreach (WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension in extensions)
            {
                WOSI.CallButler.Data.CallButlerPhoneStatusDataset.PhoneStatusRow statusRow = psData.PhoneStatus.NewPhoneStatusRow();
                PBXPresenceInfo[] presenceInfo = GetPresenceInfoForExtension(extension.ExtensionNumber);

                statusRow.ExtensionID     = extension.ExtensionID;
                statusRow.ExtensionNumber = extension.ExtensionNumber;
                statusRow.FirstName       = extension.FirstName;
                statusRow.LastName        = extension.LastName;
                statusRow.StatusCode      = (int)WOSI.CallButler.Data.PhoneExtensionStatus.Offline;

                if (presenceInfo != null && presenceInfo.Length > 0)
                {
                    foreach (PBXPresenceInfo tmpPInfo in presenceInfo)
                    {
                        if (tmpPInfo.Status != PBXPresenceStatus.Offline)
                        {
                            statusRow.StatusCode     = (int)WOSI.CallButler.Data.PhoneExtensionStatus.Online;
                            statusRow.RemoteAddress += tmpPInfo.RemoteAddress + " ";

                            break;
                        }
                    }

                    statusRow.RemoteAddress = statusRow.RemoteAddress.Trim();
                }

                psData.PhoneStatus.AddPhoneStatusRow(statusRow);
            }

            return(psData);
        }
Ejemplo n.º 3
0
        private void dgPhones_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            WOSI.CallButler.Data.CallButlerPhoneStatusDataset.PhoneStatusRow statusRow = (WOSI.CallButler.Data.CallButlerPhoneStatusDataset.PhoneStatusRow)dgPhones.Rows[e.RowIndex].Tag;

            ManagePhone(statusRow.RemoteAddress);
        }