private void createCheckItemBtn_Click(object sender, EventArgs e) { var dialog = new CheckItemDialog(new CheckItem(), false, _checkItemRepo.GetAllTypes()); var result = dialog.ShowDialog(); if (result == DialogResult.OK) { _checkItemRepo.Add(dialog.Item); reloadCheckItems(); } }
private void editCheckItemBtn_Click(object sender, EventArgs e) { var selected = checklistLv.SelectedIndices; if (selected.Count == 1) { var selectedIndex = selected[0]; var checkItem = _checkItems[selectedIndex]; var dialog = new CheckItemDialog(checkItem, true, _checkItemRepo.GetAllTypes()); var result = dialog.ShowDialog(); if (result == DialogResult.OK) { _checkItemRepo.Edit(dialog.Item); reloadCheckItems(); } } }