private void btnAddNew_Click(object sender, EventArgs e) { ConditionView conditionView = new ConditionView(); conditionView.ShowDialog(); if (conditionView.DialogResult == DialogResult.OK) { conditions.Add(conditionView.curCondition); LoadList(); } }
private void btnModify_Click(object sender, EventArgs e) { var selectedRowIndex = dgvConditions.SelectedRows[0].Index; var item = conditions[selectedRowIndex]; ConditionView conditionView = new ConditionView(item); conditionView.ShowDialog(); if (conditionView.DialogResult == DialogResult.OK) { conditions[selectedRowIndex] = conditionView.curCondition; LoadList(); } }