private void btnEdit_Click(object sender, EventArgs e) { frmAddRoles.Is_Edit = true; frmAddRoles.RoleID = Convert.ToInt32(dgvRolls.CurrentRow.Cells[0].Value.ToString()); new frmAddRoles().ShowDialog(); db = new dcAccountancyDataContext(); bsShowRolles.DataSource = db.FillRoles(); if (dgvRolls.Rows.Count == 0) { btnDelete.Enabled = btnEdit.Enabled = false; } else { btnDelete.Enabled = btnEdit.Enabled = true; } }
private void buttonX7_Click(object sender, EventArgs e) { frmAddUsers.IsEdit = true; frmAddUsers.User_ID = (int)dgvShowUsers.CurrentRow.Cells[0].Value; frmAddUsers.Role_ID = (int)dgvShowUsers.CurrentRow.Cells[1].Value; new frmAddUsers().ShowDialog(); db = new dcAccountancyDataContext(); if (dgvShowUsers.Rows.Count == 0) { btnDelete.Enabled = btnEdit.Enabled = false; } else { btnDelete.Enabled = btnEdit.Enabled = true; } }