Esempio n. 1
0
        private void AddUserToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            var editor = new EditUser()
            {
                Id = "", Name = ""
            };

            if (editor.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            NameMapping.Add(
                new NameMapping()
            {
                Id   = editor.Id,
                Name = editor.Name
            }
                );
            LoadDatabaseUser();
            EnableSave();
        }
Esempio n. 2
0
        private void editUserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex < 0)
            {
                return;
            }

            EditUser editor = new EditUser()
            {
                Id   = NameMapping[listBox1.SelectedIndex].Id,
                Name = NameMapping[listBox1.SelectedIndex].Name
            };

            if (editor.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            NameMapping[listBox1.SelectedIndex].Id   = editor.Id;
            NameMapping[listBox1.SelectedIndex].Name = editor.Name;
            LoadDatabaseUser();
        }