コード例 #1
0
        // global button event handler
        public void global_button_click(object sender, EventArgs e)
        {
            string str = splitString(((Button)sender).Name, true);
            string qlId = splitString(((Button)sender).Name, false);

            if (str == "Open")
            {
                List<Question> ListofQuestions = bc.qc.getQuestions(Int32.Parse(((Button)sender).Tag.ToString()));

                if (ListofQuestions.Count != 0)
                {
                    ShowQuestionView view = new ShowQuestionView(bc, Int32.Parse(((Button)sender).Tag.ToString()));
                    bc.refreshPanel(view.getPanel());
                } else
                {
                    MessageBox.Show("Hier staan geen vragen in!");
                }
            }
            else if (str == "Edit")
            {
                EditQuestionlistView view = new EditQuestionlistView(bc, Int32.Parse(((Button)sender).Tag.ToString()));
                bc.qc.editListPanel(Int32.Parse(((Button)sender).Tag.ToString()));
            }
            else if (str == "Delete")
            {
                DialogResult dialogResult = MessageBox.Show("Weet u zeker dat u deze vragenlijst compleet wilt verwijderen?", "", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    bc.cc.deleteQuestionlist(Int32.Parse(((Button)sender).Tag.ToString()), Int32.Parse(qlId));
                    Questionlist ql = bc.qlc.get(Int32.Parse(qlId));
                    bc.qlc.delete(ql);
                    bc.cc.setOverviewPanel();
                }
            }
        }
コード例 #2
0
 //Sets contentpanel
 public void setShowPanel()
 {
     ShowQuestionView view = new ShowQuestionView(bc, 1);
     bc.refreshPanel(view.getPanel());
 }