Example #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         int             userID          = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["uID"].Value.ToString());
         UpdateUserAdmin updateUserAdmin = new UpdateUserAdmin(AppFunctions.getUser(
                                                                   AppFunctions.getUserTable(userID)),
                                                               this);
         updateUserAdmin.ShowDialog();
     }
     else
     {
         MessageBox.Show("A row should be selected.");
     }
 }
Example #2
0
 private void btnChangePerm_Click(object sender, EventArgs e)
 {
     if (adminHomeCurrentAdmin.Permission.PermissionType != Permission.perm.ALL)
     {
         MessageBox.Show("Access not granted. Contact Administration for help. ");
         return;
     }
     if (dataGridView1.SelectedRows.Count > 0)
     {
         int userID = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["uID"].Value.ToString());
         ChangePermissionAdmin changePermissionAdmin = new ChangePermissionAdmin(AppFunctions.getUser(
                                                                                     AppFunctions.getUserTable(userID)),
                                                                                 adminHomeCurrentAdmin);
         changePermissionAdmin.ShowDialog();
     }
     else
     {
         MessageBox.Show("A row should be selected.");
     }
 }