Ejemplo n.º 1
0
        private void AddItem(object sender, EventArgs e)
        {
            using (var inputDialog = new StudentInputDialogForm())
            {
                DialogResult result = inputDialog.ShowDialog();

                if (DialogResult.OK == result)
                {
                    _students.Add(inputDialog.StudentInput);
                }
            }
        }
Ejemplo n.º 2
0
        private void UpdateItem(object sender, EventArgs e)
        {
            if (1 != outputListBox.SelectedIndices.Count)
            {
                return;
            }

            using (var inputDialog = new StudentInputDialogForm(_students[outputListBox.SelectedIndex]))
            {
                DialogResult result = inputDialog.ShowDialog();

                if (DialogResult.OK == result)
                {
                    _students[outputListBox.SelectedIndex] = inputDialog.StudentInput;
                }
            }
        }