Ejemplo n.º 1
0
        //check which button is clicked
        private void Global_Button_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < ListOfQuestions.Count; i++)
            {
                int indexx = ListOfQuestions.IndexOf(ListOfQuestions[i]);
                if (((Button)sender).Name == "Bewerk" + ListOfQuestions[i].id)
                {
                    int index = ListOfQuestions[i].id;
                    EditQuestionView view = new EditQuestionView(bc, index);
                    bc.qc.editQuestionPanel(index);
                    break;
                }
                else if (((Button)sender).Name == "Verwijder" + ListOfQuestions[i].id)
                {
                    // Are you sure? Dialog
                    DialogResult dialogResult = MessageBox.Show("Weet u zeker dat u " + ListOfQuestions[i].title + " wilt verwijderen?", "", MessageBoxButtons.YesNo);

                    if (dialogResult == DialogResult.Yes)
                    {
                        // Delete the questionlist
                        bc.qc.delete(ListOfQuestions[i]);
                        // Repaint panel
                        bc.qc.editListPanel(index2);
                    }
                    break;
                }
            }
            if (((Button)sender).Name == "Bewerk Naam Vragenlijst")
            {
                Section.Visible = false;
                EditName.Enabled = false;
                TextBox1.Visible = true;
                Save.Visible = true;
            } else if (((Button)sender).Name == "Save")
            {
                Section.Text = TextBox1.Text;
                TextBox1.Visible = false;
                Section.Visible = true;
                Save.Visible = false;
                EditName.Enabled = true;

                questionlist = bc.qlc.get(index2);
                questionlist.title = Section.Text;
                bc.qlc.update(questionlist);
            }
        }
Ejemplo n.º 2
0
 //Sets contentpanel
 public void editQuestionPanel(int id)
 {
     EditQuestionView view = new EditQuestionView(bc, id);
     view.refreshData();
     bc.refreshPanel(view.getPanel());
 }