Esempio n. 1
0
        private void simpleButtonEdit_Click(object sender, EventArgs e)
        {
            int selCount = gridSelection.SelectedCount;
            if (gridViewQuestion.RowCount < 1 || selCount == 0)
                return;

            WaitDialog.Show(ParentForm, "Loading components...");
            m_SelectedRowHandle = gridViewQuestion.FocusedRowHandle;
            popupDialog = new PopupDialog();
            popupDialog.Padding = new System.Windows.Forms.Padding(0);
            //Padding pads = popupDialog.Padding;
            //pads.Left = 5;
            popupDialog.ClientSize = new Size(1660, 980);
            //popupDialog.WindowState = FormWindowState.Maximized;
            popupDialog.StartPosition = FormStartPosition.CenterScreen;
            popupDialog.Text = "Edit Question";

            GridView view = gridViewQuestion;
            if (view != null || view.SelectedRowsCount > 0) {
                var ctqt = view.GetRow(view.GetSelectedRows()[0]) as CTQuestionTags;
                ucNewQuestion1 = new Modules.NewQuestions(ctqt.question_id);
                ucNewQuestion1.AfterSave += new NewQuestions.AfterSaveEventHandler(ucNewQuestion1_AfterSave);
            }

            //ucNewQuestion1.ParentControl = this;
            ucNewQuestion1.Dock = DockStyle.Fill;
            popupDialog.Controls.Add(ucNewQuestion1);
            //popupDialog.ClientSize = new Size(ucNewQuestion1.Width + 10, ucNewQuestion1.Height + 10);
            popupDialog.FormClosing += new FormClosingEventHandler(popupDialog_FormClosing);
            WaitDialog.Close();
            popupDialog.ShowDialog(this.ParentForm);
            gridSelection.ClearSelection();
        }
Esempio n. 2
0
 private void ucNewQuestion1_AfterSave(object sender, NewQuestions.EditQuestionArgs e)
 {
     WaitDialog.Show(ParentForm, "Reloading questions...");
     QuestionId = e.QuestionId;
     var objSource = BPContext.FIQuestionTags(null);
     gridControlQuestions.DataSource = objSource;
     if (e.OnEditMode)
         gridViewQuestion.FocusedRowHandle = m_SelectedRowHandle;
     else {
         for (int i = 0; i < gridViewQuestion.DataRowCount; i++) {
             CTQuestionTags _item = gridViewQuestion.GetRow(i) as CTQuestionTags;
             if (_item.question_id == e.QuestionId) {
                 gridViewQuestion.FocusedRowHandle = i;
                 break;
             }
         }
     }
     ucNewQuestion1.AfterSave -= new NewQuestions.AfterSaveEventHandler(ucNewQuestion1_AfterSave);
     WaitDialog.Close();
 }
Esempio n. 3
0
 private void simpleButtonAdd_Click(object sender, EventArgs e)
 {
     WaitDialog.Show(ParentForm, "Loading components...");
     popupDialog = new PopupDialog();
     //Padding pads = popupDialog.Padding;
     //pads.Left = 5;
     //popupDialog.WindowState = FormWindowState.Maximized;
     popupDialog.Padding = new System.Windows.Forms.Padding(0);
     popupDialog.StartPosition = FormStartPosition.CenterScreen;
     popupDialog.Text = "Add Question";
     ucNewQuestion1 = new Modules.NewQuestions();
     ucNewQuestion1.AfterSave += new NewQuestions.AfterSaveEventHandler(ucNewQuestion1_AfterSave);
     //ucNewQuestion1.ParentControl = this;
     ucNewQuestion1.Dock = DockStyle.Fill;
     popupDialog.Controls.Add(ucNewQuestion1);
     popupDialog.ClientSize = new Size(1660, 980);
     //popupDialog.ClientSize = new Size(ucNewQuestion1.Width + 10, ucNewQuestion1.Height + 10);
     //popupDialog.FormClosing += new FormClosingEventHandler(popupDialog_FormClosing);
     WaitDialog.Close();
     popupDialog.ShowDialog(this.ParentForm);
 }