//------------------------------------------------------------------------- protected override CResultAErreur MyInitChamps() { CResultAErreur result = base.MyInitChamps(); AffecterTitre(I.T("Closing state|671") + ": " + EtatCloture.Libelle); // Init Code état CListeObjetsDonnees lst = new CListeObjetsDonnees(EtatCloture.ContexteDonnee, typeof(CEtatCloture)); lst.Tri = CEtatCloture.c_champCode; int count = lst.Count; if (count > 0 && EtatCloture.IsNew()) { int lastCode = ((CEtatCloture)lst[count - 1]).Code; m_txtNumCode.IntValue = ++lastCode; } else { m_txtNumCode.IntValue = EtatCloture.Code; } // Combo Etat de Base m_cmbxSelectEtatDeBase.Fill( CUtilSurEnum.GetEnumsALibelle(typeof(CEtatClotureBase)), "Libelle", false); m_cmbxSelectEtatDeBase.SelectedValue = (CEtatClotureBase)EtatCloture.EtatBase; return(result); }
//------------------------------------------- private void RefillSansDelai() { m_wndListe.BeginUpdate(); m_wndListe.Items.Clear(); HashSet <DefinitionType> types = new HashSet <DefinitionType>(); m_allDefs.Sort((x, y) => m_nSortOnName * x.Name.CompareTo(y.Name) + m_nSortOnType * x.Type.ToString().CompareTo(y.Type.ToString())); foreach (ListViewItem item in m_wndListeTypes.CheckedItems) { if (item.Tag is DefinitionType) { types.Add((DefinitionType)item.Tag); } } string strSearch = m_txtName.Text.ToUpper(); foreach (IDefinition def in from d in m_allDefs where types.Contains(d.Type) && (strSearch == "" || d.Name.ToUpper().Contains(strSearch)) select d) { ListViewItem item = new ListViewItem(def.Name); item.SubItems.Add(CUtilSurEnum.GetNomConvivial(def.Type.ToString())); item.Tag = def; item.ImageIndex = (int)def.Type; m_wndListe.Items.Add(item); } m_wndListe.EndUpdate(); }
/// <summary> /// Instancie le combobox avec les membres de l'EnumALibelle /// </summary> /// <param name="typeEnumALibelle"></param> public void FillWithEnumALibelle(Type typeEnumALibelle) { DataSource = null; Items.Clear(); DisplayMember = "Libelle"; ValueMember = "CodeInt"; IEnumALibelle[] ienumalibelle = CUtilSurEnum.GetEnumsALibelle(typeEnumALibelle); DataSource = ienumalibelle; }
//-------------------------------------------------------------------- private void DisplayDefinition(TreeNode node) { m_panelViewer.SuspendDrawing(); //Masque le viewer visible foreach (Control ctrl in m_panelViewer.Controls) { ctrl.Visible = false; } IDefinition definition = m_mibTree.GetDefinition(node); if (definition != null) { m_lblType.Text = definition.Name + " (" + CUtilSurEnum.GetNomConvivial(definition.Type.ToString()) + ")"; Type tpViewer = CSNMPClassViewer.GetViewerTypeFor(definition); if (tpViewer != null) { ISNMPClassViewer viewer = null; if (!m_dicViewerConnus.TryGetValue(tpViewer, out viewer)) { viewer = Activator.CreateInstance(tpViewer, null) as ISNMPClassViewer; m_panelViewer.Controls.Add((Control)viewer); ((Control)viewer).Dock = DockStyle.Fill; m_dicViewerConnus[tpViewer] = viewer; } ((Control)viewer).Visible = true; viewer.DisplayElement(definition); viewer.MibNavigator = this; } } /*else * { * TrapType trap = m_mibTree.GetTrap(node); * if (trap != null) * { * m_lblType.Text = trap.Name + " (" + I.T("Trap|20107") + ")"; * if (m_panelDetailTrap == null) * { * m_panelDetailTrap = new CPanelDetailTrap(); * m_panelViewer.Controls.Add(m_panelDetailTrap); * ((Control)m_panelDetailTrap).Dock = DockStyle.Fill; * } * m_panelDetailTrap.Visible = true; * m_panelDetailTrap.DisplayElement(trap); * m_panelDetailTrap.MibNavigator = this; * } * }*/ m_panelViewer.ResumeDrawing(); UpdateBoutonsNavigation(); if (SelectedDefinitionChanged != null) { SelectedDefinitionChanged(this, null); } }
private void CFormEditProprieteListeColonnes_Load(object sender, System.EventArgs e) { // Lance la traduction du formulaire sc2i.win32.common.CWin32Traducteur.Translate(this); FillListeColonnes(); m_cmbAgregate.DataSource = CUtilSurEnum.GetCouplesFromEnum(typeof(OperationsAgregation)); m_cmbAgregate.DisplayMember = "Libelle"; m_cmbAgregate.ValueMember = "Valeur"; }
private void CFormEditVariableFiltreCalculee_Load(object sender, System.EventArgs e) { // Lance la traduction du formulaire sc2i.win32.common.CWin32Traducteur.Translate(this); m_cmbOperation.ValueMember = "Valeur"; m_cmbOperation.DisplayMember = "Libelle"; m_cmbOperation.DataSource = CUtilSurEnum.GetCouplesFromEnum(typeof(OperationsAgregation)); m_cmbOperation.SelectedValue = (int)m_champ.OperationAgregation; //Types finaux m_cmbTypeFinal.Items.Clear(); List <CInfoClasseDynamique> lstTypes = new List <CInfoClasseDynamique>(); lstTypes.Add(new CInfoClasseDynamique(typeof(DBNull), I.T("Default|20007"))); lstTypes.Add(new CInfoClasseDynamique(typeof(int), C2iTypeDonnee.GetLibelleType(TypeDonnee.tEntier))); lstTypes.Add(new CInfoClasseDynamique(typeof(string), C2iTypeDonnee.GetLibelleType(TypeDonnee.tString))); lstTypes.Add(new CInfoClasseDynamique(typeof(bool), C2iTypeDonnee.GetLibelleType(TypeDonnee.tBool))); lstTypes.Add(new CInfoClasseDynamique(typeof(DateTime), C2iTypeDonnee.GetLibelleType(TypeDonnee.tDate))); lstTypes.Add(new CInfoClasseDynamique(typeof(double), C2iTypeDonnee.GetLibelleType(TypeDonnee.tDouble))); m_cmbTypeFinal.DataSource = lstTypes; m_cmbTypeFinal.ValueMember = "Classe"; m_cmbTypeFinal.DisplayMember = "Nom"; Type tp = m_champ.TypeDonneeFinalForce; if (tp == null) { tp = typeof(DBNull); } try { m_cmbTypeFinal.SelectedValue = tp; } catch { } m_chkGrouper.Checked = m_champ.GroupBy; //m_lblSource.Text = m_champ.Source; m_txtNomChamp.Text = m_champ.NomChamp; m_txtFonctionSql.Text = m_champ.FonctionSql; int nIndex = 0; foreach (CSourceDeChampDeRequete source in m_champ.Sources) { CPanelSourceDeRequete panel = new CPanelSourceDeRequete(); panel.Dock = DockStyle.Top; m_panelSources.Controls.Add(panel); panel.BringToFront(); panel.Init(source, nIndex++, m_typeSource, m_defRacineDeChamps); } }
private void CFormEditCumulCroise_Load(object sender, System.EventArgs e) { // Lance la traduction du formulaire sc2i.win32.common.CWin32Traducteur.Translate(this); m_lblChampSource.Text = m_cumul.NomChamp; m_txtPrefix.Text = m_cumul.PrefixFinal; m_cmbOperation.ValueMember = "Valeur"; m_cmbOperation.DisplayMember = "Libelle"; m_cmbOperation.DataSource = CUtilSurEnum.GetCouplesFromEnum(typeof(TypeCumulCroise)); m_cmbOperation.SelectedValue = (int)m_cumul.TypeCumul; m_chkHorsPivot.Checked = m_cumul.HorsPivot; }
//------------------------------------------- private void InitTypes() { m_wndListe.Items.Clear(); foreach (object valeur in Enum.GetValues(typeof(DefinitionType))) { ListViewItem item = new ListViewItem(CUtilSurEnum.GetNomConvivial(valeur.ToString())); item.Tag = valeur; item.Checked = true; item.ImageIndex = (int)valeur; m_wndListeTypes.Items.Add(item); } m_timerOnChangeFiltre.Stop(); }
private void AffecteControlsWithExporteurValues() { if (m_exporteur==null) m_exporteur = new CExporteurDatasetAccess(); CExporteurDatasetAccess exp = (CExporteurDatasetAccess) m_exporteur; m_cmbFormat.DataSource = CUtilSurEnum.GetCouplesFromEnum ( typeof ( VersionAccessExport ) ); foreach ( CUtilSurEnum.CCoupleEnumLibelle couple in (IList)m_cmbFormat.DataSource ) if ( couple.Valeur == (int)exp.VersionAccess ) m_cmbFormat.SelectedItem = couple; if ( m_cmbFormat.SelectedItem == null ) m_cmbFormat.SelectedIndex = 0; }
private void InitFromParametre( ) { CTypeDonneeCumulee typeDonnee = new CTypeDonneeCumulee(CSc2iWin32DataClient.ContexteCourant); if (m_parametre.IdTypeDonneeCumulee != null) { if (!typeDonnee.ReadIfExists(m_parametre.IdTypeDonneeCumulee.Value)) { typeDonnee = null; } } if (typeDonnee == null) { m_tabControl.Visible = false; if (m_cmbTypeDonnee.ElementSelectionne != null) { m_cmbTypeDonnee.ElementSelectionne = null; } return; } m_tabControl.Visible = true; m_cmbTypeDonnee.ElementSelectionne = typeDonnee; DataTable table = m_parametre.GetDataTableModelePourParametrage(CSc2iWin32DataClient.ContexteCourant); if (table != null) { m_panelTableauCroise.InitChamps(table, m_parametre.TableauCroise); m_panelTableauCroise.Enabled = true; } else { m_panelTableauCroise.Enabled = false; } m_panelFormatHeader.Init(m_parametre.FormatHeader, null, true); m_panelFormatRows.Init(m_parametre.FormatRows, null, false); InitFormatsChamps(); InitFiltres(m_panelFiltresDeBase, m_parametre.FiltresDeBase, false); InitFiltres(m_panelFiltresUser, m_parametre.FiltresUtilisateur, true); m_cmbOperation.ValueMember = "Valeur"; m_cmbOperation.DisplayMember = "Libelle"; m_cmbOperation.DataSource = CUtilSurEnum.GetCouplesFromEnum(typeof(OperationsAgregation)); m_cmbOperation.SelectedValue = (int)m_parametre.OperationCumul; m_txtLibelleTotal.Text = m_parametre.LibelleTotal; m_chkShowExportButton.Checked = m_parametre.ShowExportButton; m_chkShowHeader.Checked = m_parametre.ShowHeader; }
private static CResultAErreur ShowHelp() { CResultAErreur result = CResultAErreur.True; foreach (object value in Enum.GetValues(typeof(EErreurs))) { result.EmpileErreur((int)value + " : " + CUtilSurEnum.GetNomConvivial(value.ToString())); } result.EmpileErreur(I.T("Errors : |30003")); result.EmpileErreur("[Variable name]=[Variable value] : Specify a process variable value. If the variable name or the variable value contains spaces, use \"|30004"); result.EmpileErreur(I.T("ProcessId=x : Specify the process to run, where x is the Internal ID of the process to run|30005")); result.EmpileErreur(I.T("Help : to display help about TimosProcess|30006")); result.EmpileErreur(I.T("TimosProcess command line arguments|30007")); return(result); }
//------------------------------------------------------------------- private void InitCombos() { if (m_bComboInit) { return; } //m_cmbTypeVersion.ProprieteAffichee = "Libelle"; //m_cmbTypeVersion.ListDonnees = CUtilSurEnum.GetEnumsALibelle(typeof(CTypeVersion)); m_cmbTypeVersion.Fill( CUtilSurEnum.GetEnumsALibelle(typeof(CTypeVersion)), "Libelle", true); m_bComboInit = true; }
//------------------------------------------------------------------------- public void Init(IContrainteDeProjet contrainte) { m_contrainte = contrainte; m_selectModeContrainte.Fill( CUtilSurEnum.GetEnumsALibelle(typeof(CModeContrainteDeGantt)), "Libelle", false); if (contrainte != null) { m_selectModeContrainte.SelectedValue = contrainte.Mode; m_dtContrainte.Value = contrainte.Date; m_txtCommentaire.Text = contrainte.Commentaire; } }
public static List <IEnumALibelle> GetListGrave() { List <IEnumALibelle> lstGrave = new List <IEnumALibelle>(CUtilSurEnum.GetEnumsALibelle(typeof(CGraviteAlarmeAvecMasquage))); IEnumALibelle nonGrave = new CGraviteAlarmeAvecMasquage(EGraviteAlarmeAvecMasquage.EndAlarm); lstGrave.Remove(nonGrave); IEnumALibelle maskBrig = new CGraviteAlarmeAvecMasquage(EGraviteAlarmeAvecMasquage.MaskBrig); lstGrave.Remove(maskBrig); IEnumALibelle maskAdmin = new CGraviteAlarmeAvecMasquage(EGraviteAlarmeAvecMasquage.MaskAdmin); lstGrave.Remove(maskAdmin); return(lstGrave); }
/// //////////////////////////////////////////////////// protected override void InitChamps() { base.InitChamps(); m_txtLibelle.Text = ActionCreerHandler.LibelleEvenement; m_panelParametreDeclenchement.Init(ActionCreerHandler.ParametreDeclencheur); FillListeVariablesElement(); m_comboVariableElement.SelectedValue = ActionCreerHandler.VariableElement; m_cmbGestionCode.DataSource = CUtilSurEnum.GetCouplesFromEnum(typeof(CActionCreerHandlerEvenement.TypeGestionCode)); foreach (CUtilSurEnum.CCoupleEnumLibelle couple in (IEnumerable)m_cmbGestionCode.DataSource) { if (couple.Valeur == (int)ActionCreerHandler.TypeDeGestionDuCodeEvenement) { m_cmbGestionCode.SelectedItem = couple; } } //m_chkCodeUnique.Checked = ActionCreerHandler.HandlerACodeUnique; }
//------------------------------------------------------------------------- protected override CResultAErreur MyInitChamps() { CResultAErreur result = base.MyInitChamps(); AffecterTitre(I.T("Equipment status|230") + " " + StatutEquipement.Libelle); m_cmbStatutDeBase.Fill( CUtilSurEnum.GetEnumsALibelle(typeof(CStatutBaseEquipement)), "Libelle", false); m_cmbStatutDeBase.SelectedValue = (CStatutBaseEquipement)StatutEquipement.StatutDeBase; return(result); }
public static Image[] GetImageListSeverity(Size sz, CContexteDonnee ctx) { List <Image> lstImages = new List <Image>(); List <IEnumALibelle> lstGrave = new List <IEnumALibelle>(CUtilSurEnum.GetEnumsALibelle(typeof(CCouleurAlarme))); foreach (CCouleurAlarme couleur in lstGrave) { Image bmp = new Bitmap(sz.Width, sz.Height); Graphics g = Graphics.FromImage(bmp); Brush br = new SolidBrush(GetColor(couleur.Code, ctx)); Rectangle rct = new Rectangle(0, 0, sz.Width, sz.Height); g.FillRectangle(br, rct); br.Dispose(); g.DrawRectangle(Pens.Black, rct); lstImages.Add(bmp); } return(lstImages.ToArray()); }
private void Init() { m_txtConfirmLength.Text = m_alarmeGeree.DureeMin.ToString(); m_AlarmNb.Text = (m_alarmeGeree.AlarmgereeFreqNb == null) ? "" : m_alarmeGeree.AlarmgereeFreqNb.ToString(); m_txtPerSec.Text = (m_alarmeGeree.AlarmgereeFreqPeriod == null) ? "" : m_alarmeGeree.AlarmgereeFreqPeriod.ToString(); m_txtComments.Text = m_alarmeGeree.Comment; m_txtSeuilNom.Text = m_alarmeGeree.AlarmgereeSeuilNom; m_txtBottomLevel.Text = (m_alarmeGeree.SeuilBas == null)? "" : m_alarmeGeree.SeuilBas.ToString(); m_txtTopLevel.Text = (m_alarmeGeree.SeuilHaut == null)? "" : m_alarmeGeree.SeuilHaut.ToString(); m_txtOID.Text = m_alarmeGeree.Threshold_OID; m_txtActions.Text = m_alarmeGeree.Corrective_Action; m_chkAlarmLocal.Checked = m_alarmeGeree.AlarmgereeLocal; m_chkAcquitter.Checked = m_alarmeGeree.Alarmgeree_Acquitter; m_chkDisplay.Checked = m_alarmeGeree.AlarmgereeAfficher; m_chkSurveiller.Checked = m_alarmeGeree.AlarmgereeSurveiller; m_chkAutoMib.Checked = m_alarmeGeree.Automatic_MIB; m_chkActiveSon.Checked = m_alarmeGeree.AlarmgereeSon; List <IEnumALibelle> lstProtocol = new List <IEnumALibelle>(CUtilSurEnum.GetEnumsALibelle(typeof(CProtocole))); m_cmbProtocol.Fill(lstProtocol, "Libelle", false); m_cmbProtocol.SelectedValue = m_alarmeGeree.AlarmgereeProtocol; List <IEnumALibelle> lstSon = new List <IEnumALibelle>(CUtilSurEnum.GetEnumsALibelle(typeof(CTypeSon))); m_cmbTypeSon.Fill(lstSon, "Libelle", false); m_cmbTypeSon.SelectedValue = m_alarmeGeree.AlarmgereeTypeSon; List <IEnumALibelle> lstGrave = CGraviteAlarmeAvecMasquage.GetListGrave(); m_cmbSeverity.Fill(lstGrave, "Libelle", false); m_cmbSeverity.SelectedValue = m_alarmeGeree.AlarmgereeGravite; List <IEnumALibelle> lstEvent = new List <IEnumALibelle>(CUtilSurEnum.GetEnumsALibelle(typeof(CAlarmEvent))); m_cmbEventType.Fill(lstEvent, "Libelle", false); m_cmbEventType.SelectedValue = m_alarmeGeree.AlarmgereeEvent; InitCauses(); }
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); } }
/// ////////////////////////////////////////// protected override void InitChamps() { base.InitChamps(); m_wndAideFormule.FournisseurProprietes = ObjetEdite.Process; m_wndAideFormule.ObjetInterroge = typeof(CProcess); m_txtFormuleCle.Init(m_wndAideFormule.FournisseurProprietes, m_wndAideFormule.ObjetInterroge); m_txtFormuleDescriptif.Init(m_wndAideFormule.FournisseurProprietes, m_wndAideFormule.ObjetInterroge); m_txtFormuleLibelle.Init(m_wndAideFormule.FournisseurProprietes, m_wndAideFormule.ObjetInterroge); m_txtFormuleVariable.Init(m_wndAideFormule.FournisseurProprietes, m_wndAideFormule.ObjetInterroge); CListeObjetsDonnees liste = new CListeObjetsDonnees(CSc2iWin32DataClient.ContexteCourant, typeof(CCategorieGED)); m_wndListeCategories.Remplir(liste, false); foreach (ListViewItem item in m_wndListeCategories.Items) { CCategorieGED cat = (CCategorieGED)item.Tag; if (ActionGenererEtat.ListeIdsCategoriesStockage.Contains(cat.Id)) { item.Checked = true; } else { item.Checked = false; } } liste = new CListeObjetsDonnees(CSc2iWin32DataClient.ContexteCourant, typeof(sc2i.documents.C2iRapportCrystal)); m_comboModeleEtat.ListDonnees = liste; C2iRapportCrystal rapport = new C2iRapportCrystal(CSc2iWin32DataClient.ContexteCourant); m_tableIdVariableToFormule.Clear(); if (rapport.ReadIfExists(ActionGenererEtat.IdEtatCrystal)) { m_comboModeleEtat.SelectedValue = rapport; CMultiStructureExport multiStructure = rapport.MultiStructure; if (multiStructure != null) { foreach (IVariableDynamique variable in multiStructure.ListeVariables) { m_tableIdVariableToFormule[variable.IdVariable] = ActionGenererEtat.GetExpressionForVariableFiltre(variable.IdVariable); } } } else { m_comboModeleEtat.SelectedValue = null; } UpdateListeVariables(); m_txtFormuleCle.Text = ActionGenererEtat.ExpressionCle.GetString(); m_txtFormuleDescriptif.Text = ActionGenererEtat.ExpressionDescriptif.GetString(); m_txtFormuleLibelle.Text = ActionGenererEtat.ExpressionLibelle.GetString(); m_cmbFormat.DisplayMember = "Libelle"; m_cmbFormat.ValueMember = "Valeur"; m_cmbFormat.DataSource = CUtilSurEnum.GetCouplesFromEnum(typeof(TypeFormatExportCrystal)); m_cmbFormat.SelectedValue = (int)ActionGenererEtat.FormatExport; m_chkStocker.Checked = ActionGenererEtat.StockerDansLaGed; m_chkImprimer.Checked = ActionGenererEtat.ImprimerSurClient; }
/// /////////////////////////////////////////// protected override string GetMyLibelle() { string strLib = I.T("Each @1 @2|101", m_nEcart.ToString(), CUtilSurEnum.GetNomConvivial(m_nUnite.ToString())); return(strLib); }