Ejemplo n.º 1
0
        private void btnAddCriterialConstraint_Click(object sender, EventArgs e)
        {
            CriterialConstraintForm addForm = new CriterialConstraintForm(
                this._model.Criteria, this._mainCriterionId);

            if (addForm.ShowDialog() == DialogResult.OK)
            {
                this._criterialConstraints.Add(
                    (CriterialConstraint)addForm.Constraint.Clone());
                this.FillConstraintsDataGrid();
            }
            addForm.Dispose();
        }
Ejemplo n.º 2
0
        private void btnEditCriterialConstraint_Click(object sender, EventArgs e)
        {
            if (this.dgvData.SelectedRows.Count == 0 ||
                this.dgvData.SelectedRows.Count > 1)
            {
                MessageBoxHelper.ShowExclamation("Выберите в списке только одно ограничение для редактирования");
                return;
            }

            TId index = (TId)this.dgvData.SelectedRows[0].Cells[0].Value;
            CriterialConstraintForm editForm = new CriterialConstraintForm(
                this._model.Criteria, this._mainCriterionId, this._criterialConstraints[index]);

            if (editForm.ShowDialog() == DialogResult.OK)
            {
                this.FillConstraintsDataGrid();
            }
            editForm.Dispose();
        }