Exemple #1
0
 private void applyFlatButton_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(nameFlatTextBox.Text) || string.IsNullOrEmpty(behaviourComboBox.Text) ||
         string.IsNullOrEmpty(powerflatComboBox.Text) || string.IsNullOrEmpty(groupTypeComboBox.Text) ||
         string.IsNullOrEmpty(financialSituationFlatComboBox.Text) || string.IsNullOrEmpty(infoTextBox.Text))
     {
         MessageBox.Show("Merci de renseigner toutes les informations !");
         return;
     }
     if (id == -1)
     {
         if (!web.CreateRelation(nameFlatTextBox.Text, behaviourComboBox.Text, powerflatComboBox.Text, groupTypeComboBox.Text,
                                 financialSituationFlatComboBox.Text, (int)effectifNumericUpDown.Value, infoTextBox.Text))
         {
             MessageBox.Show("Impossible d'ajouter une relation !");
         }
     }
     else
     {
         if (!web.EditRelation(id, nameFlatTextBox.Text, behaviourComboBox.Text, powerflatComboBox.Text, groupTypeComboBox.Text,
                               financialSituationFlatComboBox.Text, (int)effectifNumericUpDown.Value, infoTextBox.Text))
         {
             MessageBox.Show("Impossible de mettre à jour la relation !");
         }
     }
     Close();
 }