Beispiel #1
0
        private void Initialize()
        {
            this.Visible = false;
            InitializeComponent();
            BPContext = new BrightPlatformEntities(UserSession.EntityConnection);
            ucAddQuestion = new AddQuestion(QuestionID);
            oQuestionSize = ucAddQuestion.Size;
            ucAddQuestion.Dock = DockStyle.Fill;
            ucAddQuestion.QuestionGrid = gridViewQuestion;
            ucAddTag = new AddTag(BPContext);
            oTagSize = ucAddTag.Size;
            ucAddTag.Dock = DockStyle.Fill;
            ucAddTag.TagsGrid = gridViewTags;
            BindGridViewQuestion();
            BindLanguage();
            BindGridViewTags();
            BindGridAnswerForm();
            SetValidationRules();
            groupControlAnswerForm.Enabled = false;
            lcgAnswerForm.Enabled = false;

            if (QuestionID > 0)
                LoadQuestion(QuestionID);
            else {
                btnEditQuestion.Enabled = false;
                btnDeleteQuestion.Enabled = false;
            }

            repositoryItemButtonEditAnswerOptions.Click += new EventHandler(repositoryItemButtonEditAnswerOptions_ButtonClick);
            propertyGridControl1.DefaultEditors.Add(typeof(List<AnswerOption>), repositoryItemButtonEditAnswerOptions);

            this.Visible = true;
        }
Beispiel #2
0
 private void btnAddTag_Click(object sender, EventArgs e)
 {
     dialog = new PopupDialog();
     dialog.FormBorderStyle = FormBorderStyle.FixedSingle;
     dialog.MinimizeBox = false;
     dialog.MaximizeBox = false;
     dialog.StartPosition = FormStartPosition.CenterScreen;
     dialog.Text = "Add New Tag";
     ucAddTag = new AddTag(gridViewTags, BPContext);
     ucAddTag.AfterSave += new AddTag.AfterSaveEventHandler(ucAddTag_AfterSave);
     ucAddTag.EditMode = false;
     dialog.Controls.Add(ucAddTag);
     dialog.ClientSize = new Size(oTagSize.Width + 10, oTagSize.Height + 10);
     //dialog.FormClosing += new FormClosingEventHandler(AddTag_FormClosing);
     dialog.ShowDialog(this.ParentForm);
 }
Beispiel #3
0
 private void btnEditTag_Click(object sender, EventArgs e)
 {
     if (gridViewTags.SelectedRowsCount <= 0) {
         MessageBox.Show("Please select one or more tags first.", "Edit Tag", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     dialog = new PopupDialog();
     dialog.FormBorderStyle = FormBorderStyle.FixedSingle;
     dialog.MinimizeBox = false;
     dialog.MaximizeBox = false;
     dialog.StartPosition = FormStartPosition.CenterScreen;
     dialog.Text = "Edit Tag";
     ucAddTag = new AddTag(gridViewTags,BPContext);
     ucAddTag.AfterSave += new AddTag.AfterSaveEventHandler(ucAddTag_AfterSave);
     ucAddTag.EditMode = true;
     dialog.Controls.Add(ucAddTag);
     dialog.ClientSize = new Size(oTagSize.Width + 10, oTagSize.Height + 10);
     dialog.ShowDialog(this.ParentForm);
     //todo disable edit if multiple selection
 }
Beispiel #4
0
 private void ucAddTag_AfterSave(object sender, AddTag.AddTagArgs e)
 {
     btnEditTag.Enabled = true;
     btnDeleteTag.Enabled = true;
     this.BindGridViewTags(e.QuestionTagId);
     ucAddTag.AfterSave -= new AddTag.AfterSaveEventHandler(ucAddTag_AfterSave);
 }