//------------------------------------------------ public void Init(CDossierSuivi sousDossier) { if (m_createur == null) { m_createur = new CCreateur2iFormulaireObjetDonnee(sousDossier.ContexteDonnee.IdSession); } m_dossier = sousDossier; if (sousDossier.TypeDossier.FormulaireResume == null) { m_formulaireAffiche = null; m_panelFormulaire.Visible = false; return; } m_panelFormulaire.Visible = true; if (m_formulaireAffiche == null || m_formulaireAffiche != sousDossier.TypeDossier.FormulaireResume) { m_formulaireAffiche = sousDossier.TypeDossier.FormulaireResume; foreach (Control ctrl in m_panelFormulaire.Controls) { ctrl.Visible = false; ctrl.Dispose(); } m_panelFormulaire.Controls.Clear(); m_createur.CreateControlePrincipalEtChilds(m_panelFormulaire, m_formulaireAffiche.Formulaire, new CFournisseurGeneriqueProprietesDynamiques()); } m_createur.ElementEdite = sousDossier; }
////////////////////////////////////////////////////////////////////// public override CResultAErreur VerifieDonnees(CObjetDonnee objet) { CResultAErreur result = CResultAErreur.True; try { CDossierSuivi DossierSuivi = (CDossierSuivi)objet; if (DossierSuivi.Libelle == "") { result.EmpileErreur(I.T("Workbook label should not be empty|306")); } if (DossierSuivi.TypeDossier == null) { result.EmpileErreur(I.T("The Worbook Type connot be null|307")); } else if (DossierSuivi.ElementSuivi != null && DossierSuivi.TypeDossier.TypeSuivi != null && !DossierSuivi.ElementSuivi.GetType().Equals(DossierSuivi.TypeDossier.TypeSuivi)) { result.EmpileErreur(I.T("Workbook linked element is not of the expected type (@1)|308", DynamicClassAttribute.GetNomConvivial(DossierSuivi.TypeDossier.TypeSuivi))); } CRelationDossierSuivi_ChampCustomServeur relServeur = new CRelationDossierSuivi_ChampCustomServeur(IdSession); foreach (CRelationDossierSuivi_ChampCustom rel in CNettoyeurValeursChamps.RelationsChampsNormales(DossierSuivi)) { CResultAErreur resultTmp = relServeur.VerifieDonnees(rel); if (!resultTmp) { result.Erreur.EmpileErreurs(resultTmp.Erreur); result.SetFalse(); } } Hashtable m_tableRelationsToElements = new Hashtable(); foreach (CRelationDossierSuivi_Element relElement in DossierSuivi.RelationsElements) { m_tableRelationsToElements[relElement.RelationParametre_TypeElement.Id] = true; } return(result); } catch (Exception e) { result.EmpileErreur(new CErreurException(e)); result.EmpileErreur(I.T("Workbook data error|309")); } return(result); }
//------------------------------------------------- public static CObjetDonneeAIdNumerique GetBuildPermitSubmission( CProjet projetRacine, CProjet projetCandidat, string strNomFichier) { //Cherche le projet "Build permit" CProjet projet = GetObjetProjetFromTemplate("BUILD_PERMIT", projetRacine) as CProjet; if (projet != null) { foreach (CDossierSuivi dossier in CDossierSuivi.GetListeDossiersForElement(projet)) { if (dossier.TypeDossier.Id == 9) { return(dossier); } } } return(projet); }
static int s_nIdNegatif = -1; // Utile pour les carac template vides public CCaracteristique(DataSet ds, IObjetDonneeAIdNumeriqueAuto objetEdite, Type typeObjetEdite, string strParentElementType, int nParentElementId, int nOrdre, int nIdGroupe, bool isTemplate) { m_objetEdite = objetEdite; // Cela peut être une caractéristique, mais pas frocément DataTable dt = ds.Tables[c_nomTable]; if (dt == null) { return; } DataRow row = dt.NewRow(); string strId = ""; string strLibelle = "Nouvel élément"; int nTimosId = s_nIdNegatif--; string strTypeElement = ""; if (typeObjetEdite != null) { strTypeElement = typeObjetEdite.ToString(); } int nIdMetaType = -1; if (objetEdite != null) { if (!isTemplate) { nTimosId = objetEdite.Id; } strTypeElement = objetEdite.GetType().ToString(); int nLastPoint = strTypeElement.LastIndexOf("."); strId = strTypeElement.Substring(nLastPoint + 1, strTypeElement.Length - nLastPoint - 1) + nTimosId; strLibelle = objetEdite.DescriptionElement; if (objetEdite is CCaracteristiqueEntite) { CCaracteristiqueEntite carac = objetEdite as CCaracteristiqueEntite; strLibelle = carac.Libelle; if (strLibelle == "") { strLibelle = carac.TypeCaracteristique.Libelle; } if (carac.TypeCaracteristique != null) { nIdMetaType = carac.TypeCaracteristique.Id; } } else if (objetEdite is CDossierSuivi) { CDossierSuivi workbook = objetEdite as CDossierSuivi; strLibelle = workbook.Libelle; if (workbook.TypeDossier != null) { nIdMetaType = workbook.TypeDossier.Id; } } else if (objetEdite is CSite) { CSite site = objetEdite as CSite; strLibelle = site.Libelle; if (site.TypeSite != null) { nIdMetaType = site.TypeSite.Id; } } } row[c_champId] = strId; row[c_champTimosId] = nTimosId; row[c_champElementType] = strTypeElement; row[c_champTitre] = strLibelle; row[c_champOrdreAffichage] = nOrdre; row[c_champIdGroupeChamps] = nIdGroupe; row[c_champIsTemplate] = isTemplate; row[c_champIdMetaType] = nIdMetaType; row[c_champParentElementType] = strParentElementType; row[c_champParentElementId] = nParentElementId; m_row = row; dt.Rows.Add(row); }