public override CResultAErreur MajChamps() { CResultAErreur result = base.MajChamps(); if (!result) { return(result); } JoursBinaires jrs = JoursBinaires.Aucun; for (int n = 0; n < 7; n++) { if (m_wndListeJours.Items[n].Checked) { jrs |= CUtilDate.GetJourBinaireForBaseLundi(n); } } CPlanificationTacheFrequente plFreq = (CPlanificationTacheFrequente)Planification; plFreq.JoursExecution = jrs; if (m_wndHeureFin.ValeurHeure == null) { m_wndHeureFin.ValeurHeure = 23; } plFreq.HeureFin = (double)m_wndHeureFin.ValeurHeure; plFreq.Ecart = m_wndEcart.IntValue; plFreq.Unite = (CPlanificationTacheFrequente.EUniteTemps)m_cmbUnite.SelectedValue; return(result); }
public override void InitChamps(CPlanificationTache planification) { CUtilSurEnum.CCoupleEnumLibelle[] couples = CUtilSurEnum.GetCouplesFromEnum(typeof(CPlanificationTacheFrequente.EUniteTemps)); m_cmbUnite.DataSource = couples; m_cmbUnite.DisplayMember = "Libelle"; m_cmbUnite.ValueMember = "Valeur"; base.InitChamps(planification); CPlanificationTacheFrequente plFreq = (CPlanificationTacheFrequente)planification; for (int n = 0; n < 7; n++) { if ((plFreq.JoursExecution & CUtilDate.GetJourBinaireForBaseLundi(n)) != 0) { m_wndListeJours.Items[n].Checked = true; } else { m_wndListeJours.Items[n].Checked = false; } } int nIndex = 0; foreach (CUtilSurEnum.CCoupleEnumLibelle couple in couples) { if (couple.Valeur == (int)plFreq.Unite) { m_cmbUnite.SelectedIndex = nIndex; } nIndex++; } m_wndHeureFin.ValeurHeure = plFreq.HeureFin; m_wndEcart.DoubleValue = plFreq.Ecart; foreach (ListViewItem item in m_wndListeJours.Items) { item.Text = I.TT(GetType(), item.Text); } }