private void newRoleToolStripMenuItem_Click(object sender, EventArgs e) { RolesForm rf = new RolesForm(); //create a new reference to the RolesForm.cs and opens the form related to that script rf.ShowDialog(); LoadDataIntoDataGridView(); }
private void AddUserRoleButton_Click(object sender, EventArgs e) { if (LoggedInUser.RoleId == 1) { //Display Form and Do what you want RolesForm rf = new RolesForm(); rf.ShowDialog(); } else { MessageBox.Show("You are not allowed to perform this operation.", "Access Denied", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void RolesDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (RolesDataGridView.Rows.Count > 0) //if the data grid has more than 0 rows { int roleId = Convert.ToInt32(RolesDataGridView.SelectedRows[0].Cells[0].Value); RolesForm RolesForm = new RolesForm(); RolesForm.RoleId = roleId; RolesForm.IsUpdate = true; RolesForm.ShowDialog(); LoadDataIntoDataGridView(); } }
private void newRoleToolStripMenuItem_Click(object sender, EventArgs e) { RolesForm rf = new RolesForm(); rf.ShowDialog(); }