示例#1
0
        private void button_nuevo_Click(object sender, EventArgs e)
        {
            AddEditUser  new_user = new AddEditUser(null);
            DialogResult res      = new_user.ShowDialog(this);

            if (res == DialogResult.OK || res == DialogResult.Cancel)
            {
                refresh_grid();
            }
        }
示例#2
0
        private void button_modif_Click(object sender, EventArgs e)
        {
            if (dataGrid_users.SelectedRows.Count == 0)
            {
                MessageBox.Show("Debe seleccionar un Usuario para modificarlo");
            }
            else
            {
                Usuario user = dataGrid_users.CurrentRow.DataBoundItem as Usuario;

                AddEditUser  mod_user = new AddEditUser(user);
                DialogResult res      = mod_user.ShowDialog(this);

                if (res == DialogResult.OK || res == DialogResult.Cancel)
                {
                    refresh_grid();
                }
            }
        }