private void ArtNew_Click(object sender, EventArgs e)
        {
            var editForm = new EditArticleForm();

            editForm.ShowDialog();
            if (editForm.DialogResult == DialogResult.OK)
            {
                guide.Articles.Add(new WaterObject(editForm.Water));
                ArticleBindingSource.ResetBindings(false);
                guide.changed = true;
            }
        }
Exemplo n.º 2
0
 private void EditQueForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.DialogResult == DialogResult.Cancel)
     {
         return;
     }
     EditArticleForm.Сhek(MainBox, e);
     EditArticleForm.Сhek(RightCbox, e);
     EditArticleForm.Сhek(QuestionPoints, e);
     if (question.AnswerOptions.Count == 0)
     {
         e.Cancel = true;
     }
 }
        private void ArtEdit_Click(object sender, EventArgs e)
        {
            if (!(ArticleList.SelectedItem is WaterObject item))
            {
                return;
            }
            int index    = guide.Articles.IndexOf(item);
            var editForm = new EditArticleForm(item);

            editForm.ShowDialog();
            if (editForm.DialogResult == DialogResult.OK)
            {
                guide.Articles[index] = new WaterObject(editForm.Water);
                ArticleBindingSource.ResetBindings(false);
                guide.changed = true;
            }
        }
        private void ETF1_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (this.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            EditArticleForm.Сhek(NameBox, e);
            bool res = test.Questions.Count == 0;

            if (res)
            {
                OptionList.BackColor = Color.LightPink;
                e.Cancel             = true;
            }
            else
            {
                OptionList.BackColor = Color.LightGreen;
            }
        }