private void buttonListUnapprovedUsers_Click(object sender, EventArgs e) { var approveUsersPage = new ApproveUsersPage(); approveUsersPage.Show(); this.Close(); }
private void buttonApprove_Click(object sender, EventArgs e) { var ids = dataGridView1.Rows .Cast <DataGridViewRow>() .Where(row => row.Cells[0].Value != null) .Where(row => (bool)(row.Cells["IsApproved"] as DataGridViewCheckBoxCell).Value) .Select(row => (int)(row.Cells["Id"].Value)) .ToList(); foreach (var id in ids) { AppContext.Client.ApproveUsers(id); } var approveUserPage = new ApproveUsersPage(); approveUserPage.Show(); this.Close(); }