private void BtnAdd_Click(object sender, EventArgs e) { frmMaintainUsers users = new frmMaintainUsers(this); users.setMode("add"); // frmParent frmParent = Users; // Users.MdiParent = frmParent; users.ShowDialog(); }
private void AddNewUserToolStripMenuItem_Click(object sender, EventArgs e) { frmSearchUser user = new frmSearchUser(); frmMaintainUsers users = new frmMaintainUsers(user); frmParent parent = this; users.setMode("add"); users.clearForm(); users.MdiParent = parent; users.Show(); }
private void BtnSelectUser_Click(object sender, EventArgs e) { frmMaintainUsers maintainUsers = new frmMaintainUsers(users); maintainUsers.setUserID(dgViewUsers.Rows[rowIndex].Cells[0].Value.ToString()); maintainUsers.setMode("update"); // MessageBox.Show((dgViewUsers.Rows[rowIndex].Cells[3].Value.ToString())); maintainUsers.setName(dgViewUsers.Rows[rowIndex].Cells[1].Value.ToString()); maintainUsers.setSurname(dgViewUsers.Rows[rowIndex].Cells[2].Value.ToString()); maintainUsers.setUsername(dgViewUsers.Rows[rowIndex].Cells[4].Value.ToString()); maintainUsers.setPassword(dgViewUsers.Rows[rowIndex].Cells[5].Value.ToString()); maintainUsers.setAdminP(dgViewUsers.Rows[rowIndex].Cells[3].Value.ToString()); maintainUsers.ShowDialog(); }
private void AddToolStripMenuItem2_Click(object sender, EventArgs e) { //add new user if (getUserAdmin() == false) { MessageBox.Show("Access denied: Only admin users have access to this feature"); } else { frmSearchUser user = new frmSearchUser(); frmMaintainUsers users = new frmMaintainUsers(user); frmParent parent = this; users.setMode("add"); users.clearForm(); users.MdiParent = parent; users.Show(); } }