private void Select_listview_permission() { List <string> list_permission = new List <string>(); foreach (DataRow dt_row in Permission_ds.Select_permission_by_usergroup(_usergroup).Rows) { list_permission.Add(dt_row["permission"].ToString()); } foreach (ListViewItem lv_item in listview_permission.Items) { lv_item.Checked = list_permission.Contains(lv_item.Text); } }
private void Setup_grd_permission() { if (grd_usergroup.SelectedCells.Count == 0) { return; } string str_usergroup = grd_usergroup.SelectedRows[0].Cells["usergroup"].Value.ToString(); grd_permission.DataSource = null; grd_permission.DataSource = Permission_ds.Select_permission_by_usergroup(str_usergroup); grd_permission.Columns["permission"].Width = 160; grd_permission.Columns["permission_desc"].Width = 200; }
private void Setup_grd_permission() { if (grd_usergroup.SelectedCells.Count == 0) { return; } string str_usergroup = grd_usergroup.SelectedRows[0].Cells["usergroup"].Value.ToString(); bool is_administrator = str_usergroup == "ADMINISTRATOR"; editToolStripMenuItem.Enabled = !is_administrator; btn_edit.Enabled = !is_administrator; removeToolStripMenuItem.Enabled = !is_administrator; btn_remove.Enabled = !is_administrator; grd_permission.DataSource = null; grd_permission.DataSource = Permission_ds.Select_permission_by_usergroup(str_usergroup); grd_permission.Columns["permission"].Width = 160; grd_permission.Columns["permission_desc"].Width = 200; }