private void cmbDateVolAller_SelectedIndexChanged(object sender, EventArgs e) { if (radioAllerRetour.Checked) { PLA_GetDateByVolId_Result oDateSimple = (PLA_GetDateByVolId_Result)cmbDateVolAller.SelectedItem; //Date vol simple VOL_SelectAllListChoix_Result oVol = (VOL_SelectAllListChoix_Result)cmbVolAller.SelectedItem; BLPlannings oBl = new BLPlannings(); List <PLA_GetDateByVolIdDateCritere_Result> oList = new List <PLA_GetDateByVolIdDateCritere_Result>(); VOL_SelectAllListChoixRetour_Result oVolRetour = new VOL_SelectAllListChoixRetour_Result(); try { oVolRetour = BLVols.GetVolRetour(oVol.VOL_ID_VILLE_ARR, oVol.VOL_ID_VILLE_DEP); oList = BLPlannings.GetDatesVol(oVolRetour.VOL_ID, oDateSimple.PLAN_VOL_DATE); cmbDateVolRetour.DataSource = oList; cmbDateVolRetour.ValueMember = "PLAN_ID"; cmbDateVolRetour.DisplayMember = "PLAN_VOL_DATE"; } catch (CustomError cEx) { MessageBox.Show(cEx.Message); } catch (Exception ex) { CustomError cEx = new CustomError(666); MessageBox.Show(cEx.Message); } } }
// Dès que le texte de la textbox change, ça veut dire qu'on veut un vol retour et on trigger un get des dates du retour s'il y en a private void txtVolRetour_TextChanged(object sender, EventArgs e) { VOL_SelectAllListChoix_Result oVol = (VOL_SelectAllListChoix_Result)cmbVolAller.SelectedItem; cmbDateVolRetour.Enabled = true; PLA_GetDateByVolId_Result oDateSimple = (PLA_GetDateByVolId_Result)cmbDateVolAller.SelectedItem; try { VOL_SelectAllListChoixRetour_Result oVolRetour = BLVols.GetVolRetour(oVol.VOL_ID_VILLE_ARR, oVol.VOL_ID_VILLE_DEP); List <PLA_GetDateByVolIdDateCritere_Result> oList = BLPlannings.GetDatesVol(oVolRetour.VOL_ID, oDateSimple.PLAN_VOL_DATE); cmbDateVolRetour.DataSource = oList; cmbDateVolRetour.ValueMember = "PLAN_ID"; cmbDateVolRetour.DisplayMember = "PLAN_VOL_DATE"; } catch (CustomError cEx) { MessageBox.Show(cEx.Message); } catch (Exception ex) { CustomError cEx = new CustomError(666); MessageBox.Show(cEx.Message); } }
private void cmbVolAller_SelectedIndexChanged(object sender, EventArgs e) { VOL_SelectAllListChoix_Result oVol = (VOL_SelectAllListChoix_Result)cmbVolAller.SelectedItem; List <PLA_GetDateByVolId_Result> oList = new List <PLA_GetDateByVolId_Result>(); try { cmbDateVolAller.DataSource = BLPlannings.GetDatesVol(oVol.VOL_ID); // on récupère les dates pour le vol choisi cmbDateVolAller.ValueMember = "PLAN_ID"; cmbDateVolAller.DisplayMember = "PLAN_VOL_DATE"; if (radioAllerRetour.Checked) //si le vol retour est choisi { VOL_SelectAllListChoixRetour_Result oVolRetour = BLVols.GetVolRetour(oVol.VOL_ID_VILLE_ARR, oVol.VOL_ID_VILLE_DEP); //récup vol retour txtVolRetour.Text = oVolRetour.LIB_VOL.ToString(); } } catch (CustomError cEx) { MessageBox.Show(cEx.Message); } catch (Exception ex) { CustomError cEx = new CustomError(666); MessageBox.Show(cEx.Message); } }