Beispiel #1
0
        private void Btn_Modifier_Click(object sender, EventArgs e)
        {
            Modifier_Surveillance ModifierSurv = new Modifier_Surveillance();

            if (ModifierSurv.ShowDialog() == DialogResult.OK)
            {
            }
        }
Beispiel #2
0
        private void Btn_Modifier_Click(object sender, EventArgs e)
        {
            if (CurrentListSurv != null && CurrentListSurv.Count > 0)
            {
                if (DtgListeProgrames.SelectedCells.Count > 0)
                {
                    int             IndexRowSelected = DtgListeProgrames.SelectedCells[0].RowIndex;
                    DataGridViewRow SelectedRow      = DtgListeProgrames.Rows[IndexRowSelected];

                    if (SelectedRow.Cells["Nom Salle"].Value != null &&
                        SelectedRow.Cells["Nom Salle"].Value.ToString().Trim().Length != 0 &&
                        IndexRowSelected < CurrentListSurv.Count)
                    {
                        CurrentIndex = IndexRowSelected;
                        //MessageBox.Show("ind " + CurrentIndex + " Count " + CurrentListSurv.Count);
                        Modifier_Surveillance ModifierSurv = new Modifier_Surveillance(
                            CurrentListSurv, CurrentEns, CurrentIndex);

                        if (ModifierSurv.ShowDialog() == DialogResult.OK)
                        {
                            Surveillances NewSurv = new Surveillances(ModifierSurv.CurrentSurveillance);
                            CurrentListSurv.RemoveAt(CurrentIndex);
                            CurrentListSurv.Add(NewSurv);

                            CurrentDataTableProgrammes.Rows.RemoveAt(CurrentIndex);
                            CurrentDataTableProgrammes.Rows.Add(
                                NewSurv.PropSalle.PropNom,
                                NewSurv.PropSeance.PropNom,
                                NewSurv.PropSeance.PropHeureDebut,
                                NewSurv.PropSeance.PropHeureFin,
                                NewSurv.PropDateSurveillance
                                );
                            IsUpdated = true;
                            DtgListeProgrames.DataSource = CurrentDataTableProgrammes;
                        }
                    }
                    else
                    {
                        MessageBox.Show("Selectionner un valid programme");
                    }
                }
                else
                {
                    MessageBox.Show("Selectionner un programme");
                }
            }
            else
            {
                MessageBox.Show("Ajouter des programmes");
            }
        }