public void groupe(object sender, EventArgs e) { for (int i = 0; i < cl_buttons.Count; i++) { if (cl_buttons[i] == ((Bunifu.Framework.UI.BunifuFlatButton)sender)) { id = id_classes[i]; break; } } nomgr = ((Bunifu.Framework.UI.BunifuFlatButton)sender).Text; if (lastClick != null) { lastClick.selected = false; } lastClick = (Bunifu.Framework.UI.BunifuFlatButton)sender; lastClick.selected = true; analyse.Hide(); Groupe Groupe_Form = new Groupe(id, Home.nomgr); Groupe_Form.TopLevel = false; Groupe_Form.Parent = this; Groupe_Form.Location = new Point(panel1.Width, bunifuSeparator1.Location.Y); Groupe_Form.Show(); AddForm(Groupe_Form); Home_ResizeBegin(sender, e); Back.Visible = true; HomeButton.Visible = true; }
private void bunifuCustomDataGrid1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { if (e.ColumnIndex == 4) { for (int i = 0; i < HomePreview.ClassButton.Count; i++) { if (bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == HomePreview.ClassButton[i].Text) { HomePreview.id = HomePreview.id_classes[i]; } } Groupe Groupe_Form = new Groupe(HomePreview.id, bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()); HomePreview.resizeLocationForm(Groupe_Form); } else if (e.ColumnIndex == 5) { if (bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[6].Value.ToString() == "0") { if (MessageBox.Show("voulez-vous réinitialise le mot de passe", "changer le mot de passe", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) { string pass = generatePassword(bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[0].Value.ToString()); bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[5].Value = pass; } } } } }
private void bunifuCustomDataGrid1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { if (e.ColumnIndex == 4) { for (int i = 0; i < HomePreview.ClassButton.Count; i++) { if (bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == HomePreview.ClassButton[i].Text) { HomePreview.id = HomePreview.id_classes[i]; } } Groupe Groupe_Form = new Groupe(HomePreview.id, bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()); HomePreview.resizeLocationForm(Groupe_Form); } else if (e.ColumnIndex == 5) { if (bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[6].Value.ToString() == "0") { if (MessageBox.Show("voulez-vous réinitialise le mot de passe", "changer le mot de passe", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) { string pass = generatePassword(bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[0].Value.ToString()); bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[5].Value = pass; using (FolderBrowserDialog dlg = new FolderBrowserDialog()) { dlg.Description = "Select a folder"; if (dlg.ShowDialog() == DialogResult.OK) { string Nom = bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[1].Value.ToString(); string Prenom = bunifuCustomDataGrid1.Rows[e.RowIndex].Cells[2].Value.ToString(); password p = new password(Nom, Prenom, pass, dlg.SelectedPath + "\\" + "mot de pass de " + Nom + " " + Prenom + ".pdf"); MessageBox.Show("mot de pass bien generee"); } } } } } } }
public void Classe_Click(object sender, EventArgs e) { for (int i = 0; i < ClassButton.Count; i++) { if (ClassButton[i] == ((BunifuFlatButton)sender)) { id = id_classes[i]; break; } } if (lastClick != null) { lastClick.selected = false; } ((BunifuFlatButton)sender).selected = true; lastClick = ((BunifuFlatButton)sender); nomgr = ((BunifuFlatButton)sender).Text; Groupe Groupe_Form = new Groupe(id, nomgr); resizeLocationForm(Groupe_Form); }