private void buttonEditFeeling_Click(object sender, EventArgs e)
 {
     if (dataGridViewFeeling.SelectedRows.Count == 1)
     {
         GetFeeling_Result selected = (GetFeeling_Result)dataGridViewFeeling.SelectedRows[0].DataBoundItem;
         FormEditFeeling   form     = new FormEditFeeling();
         form.CurrentClient = CurrentClient;
         try {
             form.LoadFeeling(selected.ClientId);
             DialogResult result = form.ShowDialog();
             if (result == DialogResult.OK)
             {
                 PopulateFeelings();
             }
         } catch (Exception ex) {
             ModelError modelError = new ModelError(ex);
             MessageBox.Show(modelError.Message, "Erreur fatale!", MessageBoxButtons.OK, MessageBoxIcon.Error);
             if (modelError.Number == ModelError.INVALID_OPERATION)
             {
                 PopulateFeelings();
             }
         }
     }
 }
Example #2
0
 private void buttonEditFeeling_Click(object sender, EventArgs e) {
   if(dataGridViewFeeling.SelectedRows.Count == 1) {
     GetFeeling_Result selected = (GetFeeling_Result)dataGridViewFeeling.SelectedRows[0].DataBoundItem;
     FormEditFeeling form = new FormEditFeeling();
     form.CurrentClient = CurrentClient;
     try {
       form.LoadFeeling(selected.ClientId);
       DialogResult result = form.ShowDialog();
       if(result == DialogResult.OK) {
         PopulateFeelings();
       }
     } catch(Exception ex) {
       ModelError modelError = new ModelError(ex);
       MessageBox.Show(modelError.Message, "Erreur fatale!", MessageBoxButtons.OK, MessageBoxIcon.Error);
       if(modelError.Number == ModelError.INVALID_OPERATION) {
         PopulateFeelings();
       }
     }
   }
 }