private void btnAddQuestion_Click(object sender, RoutedEventArgs e) { ChangeTxt objchangetxt = new ChangeTxt("Add Question", "Enter new a Question.", true); objchangetxt.Owner = this; this.IsEnabled = false; objchangetxt.ShowDialog(); if (objchangetxt.DialogResult == true) { objcall.Questions.Add(new Question(objchangetxt.txtOut.Text)); } }
private void btnAddGroup_Click(object sender, RoutedEventArgs e) { ChangeTxt objchangetxt = new ChangeTxt("Add Call Group", "Enter new Call Group name."); objchangetxt.Owner = this; this.IsEnabled = false; objchangetxt.ShowDialog(); if (objchangetxt.DialogResult == true) { Answer answer = new Answer(objchangetxt.txtOut.Text); objcall.Answers.Add(answer); cmbGroup.SelectedItem = answer; } }
private void btnRenameGroup_Click(object sender, RoutedEventArgs e) { if (cmbGroup.SelectedIndex == -1) { MessageBox.Show("please select one Group"); return; } ChangeTxt objchangetxt = new ChangeTxt("Rename Call Group", "Enter another Call Group name."); objchangetxt.Owner = this; this.IsEnabled = false; objchangetxt.txtOut.Text = (cmbGroup.SelectedItem as Answer).Name; objchangetxt.ShowDialog(); if (objchangetxt.DialogResult == true) { (cmbGroup.SelectedItem as Answer).Name = objchangetxt.txtOut.Text; } }
private void btnEditItem_Click(object sender, RoutedEventArgs e) { if (lstItems.SelectedIndex == -1) { MessageBox.Show("please select one item"); return; } ChangeTxt objchangetxt = new ChangeTxt("Edit Call Group Item", "Change Call Group item "); objchangetxt.Owner = this; this.IsEnabled = false; objchangetxt.txtOut.Text = (lstItems.SelectedItem as Item).Value; objchangetxt.ShowDialog(); if (objchangetxt.DialogResult == true) { (lstItems.SelectedItem as Item).Value = objchangetxt.txtOut.Text; } }
private void btnEditQuestion_Click(object sender, RoutedEventArgs e) { if (lstQustion.SelectedIndex == -1) { MessageBox.Show("please select one question "); return; } ChangeTxt objchangetxt = new ChangeTxt("Edit Question", "Change the Question.", true); objchangetxt.Owner = this; this.IsEnabled = false; objchangetxt.txtOut.Text = (lstQustion.SelectedItem as Question).Content; objchangetxt.ShowDialog(); if (objchangetxt.DialogResult == true) { (lstQustion.SelectedItem as Question).Content = objchangetxt.txtOut.Text; } }
private void btnAddItem_Click(object sender, RoutedEventArgs e) { if (cmbGroup.SelectedIndex == -1) { MessageBox.Show("please select one Group"); return; } ChangeTxt objchangetxt = new ChangeTxt("Add Call Group Item", "Enter new Call Group item name."); objchangetxt.Owner = this; this.IsEnabled = false; objchangetxt.ShowDialog(); if (objchangetxt.DialogResult == true) { Item item = new Item(); item.Value = objchangetxt.txtOut.Text; (cmbGroup.SelectedItem as Answer).Items.Add(item); } }