Exemple #1
0
        private void modifySelectedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                var row      = dataGridViewAll.SelectedRows;
                var name     = row[0].Cells[1].Value.ToString().Replace(" ", "");
                var password = row[0].Cells[2].Value.ToString().Replace(" ", "");
                var perm     = row[0].Cells[3].Value.ToString().Replace(" ", "");

                NewUserAdmin form = new NewUserAdmin(adminDatabase);
                form.Modify(name, password, perm);
                form.ShowDialog();
                var res = form.resultOfAdd;
                form.Dispose();
                switch (res)
                {
                case Auxiliary.States.Close:
                {
                    break;
                }

                case Auxiliary.States.Reload:
                {
                    dataGridViewAll.DataSource = null;
                    LoadAdminDB();
                    break;
                }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, "Error");
            }
        }
Exemple #2
0
        private void addUserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewUserAdmin form = new NewUserAdmin(adminDatabase);

            form.ShowDialog();
            var res = form.resultOfAdd;

            form.Dispose();
            switch (res)
            {
            case Auxiliary.States.Close:
            {
                break;
            }

            case Auxiliary.States.Reload:
            {
                dataGridViewAll.DataSource = null;
                LoadAdminDB();
                break;
            }
            }
        }