Esempio n. 1
0
        private void editGroupButton_Click(object sender, EventArgs e)
        {
            if (groupsListBox.SelectedIndex < 0)
            {
                return;
            }

            Group group = getSelectedGroup();

            EditNameWindow editNameWindow = new EditNameWindow(group);

            editNameWindow.ShowDialog();

            if (editNameWindow.saveButtonClicked)
            {
                group.Name = editNameWindow.NewName;
                groupsListBox.DataSource = null;
                groupsListBox.DataSource = groupData.getGroups();
                groupData.sortGroups();
                UnsavedData = true;
            }
        }
Esempio n. 2
0
        private void Manager_DialBegin(object sender, AsterNET.Manager.Event.DialBeginEvent e)
        {
            if (Properties.Settings.Default.Phone == "")
            {
                return;
            }
            if (e.DialString.IndexOf(Properties.Settings.Default.Phone) < 0 &&
                e.Attributes["destcalleridnum"] != Properties.Settings.Default.Phone)
            {
                return;
            }

            ATS.LastCallNum  = e.CallerIdNum;
            ATS.LastCallName = e.CallerIdName;
            LogWriter.Instance.WriteToLog("Call " + ATS.LastCallNum + " " + ATS.LastCallName);

            if (Properties.Settings.Default.ShowPopup)
            {
                string title = "Звонок";
                if (e.DialString.IndexOf(Properties.Settings.Default.Phone) < 0)
                {
                    title = "Перехват от " + e.DialString;
                }
                ShowPopup(title, string.Format("Телефон {0} \r\n{1}", ATS.LastCallNum, ATS.LastCallName));
            }
            if (e.CallerIdName == string.Empty || e.CallerIdName == Const.Phone.UNKNOWN)
            {
                LogWriter.Instance.WriteToLog("Add contact ");
                Application.Current.Dispatcher.Invoke((Action) delegate
                {
                    EditNameWindow editNameWindow     = new EditNameWindow();
                    editNameWindow.tbStateButton.Text = "Добавить";
                    editNameWindow.Title            = "Добавление нового контакта";
                    editNameWindow.lblPhone.Content = ATS.LastCallNum;
                    editNameWindow.ShowDialog();
                });
            }
        }
Esempio n. 3
0
        private void editIssueButton_Click(object sender, EventArgs e)
        {
            if (issueListBox.SelectedIndex < 0)
            {
                return;
            }

            Group group = getSelectedGroup();
            Issue issue = group.issues[issueListBox.SelectedIndex];

            EditNameWindow editNameWindow = new EditNameWindow(issue);

            editNameWindow.ShowDialog();

            if (editNameWindow.saveButtonClicked)
            {
                issue.name = editNameWindow.NewName;
                issueListBox.DataSource = null;
                issueListBox.DataSource = getSelectedGroup().issues;
                group.sortIssues();
                UnsavedData = true;
            }
        }