private void btSup_Click(object sender, EventArgs e) { try { int i = (int)this.grdEtudient.CurrentRow.Index; int ide = int.Parse(this.grdEtudient.Rows[i].Cells[1].Value.ToString()); Etudient et = this.f1.find(new Etudient(ide)); this.f1.Gr.Remove(et); Form2 f2 = null; if (this.rdTout.Checked) { f2 = new Form2(this.f1, this.f1.Gr); } if (this.rdTDI.Checked) { f2 = new Form2(this.f1, this.f1.lstGr("TDI")); } if (this.rdTRI.Checked) { f2 = new Form2(this.f1, this.f1.lstGr("TRI")); } f2.Show(); this.Dispose(); } catch (Exception ex) { } }
public Etudient find(Etudient et) { foreach (Etudient val in this.gr) { if (val.Equals(et)) { return(val); } } return(null); }
public override bool Equals(object obj) { Etudient e = (Etudient)obj; return(this.ide == e.ide); }