//------------------------------------------------------------------- public override CResultAErreur VerifieDonnees(CObjetDonnee objet) { CResultAErreur result = CResultAErreur.True; try { CStock stock = (CStock)objet; if (stock.Libelle == "") { result.EmpileErreur(I.T("Stock label cannot be empty|111")); } if (!CObjetDonneeAIdNumerique.IsUnique(stock, CStock.c_champLibelle, stock.Libelle)) { result.EmpileErreur(I.T("Another Stock with the same label already exists|112")); } if (stock.TypeStock == null) { result.EmpileErreur(I.T("Stock Type cannot be empty|116")); } if (stock.Site == null) { result.EmpileErreur(I.T("The Stock related Site cannot be empty|117")); } if (result) { result = SObjetAFilsACoordonneeServeur.VerifieDonnees(stock); } if (result) { result = stock.VerifieCoordonnee(); } } catch (Exception e) { result.EmpileErreur(new CErreurException(e)); } return(result); }
//------------------------------------------------------------------- public override CResultAErreur VerifieDonnees(CObjetDonnee objet) { CResultAErreur result = CResultAErreur.True; try { CEquipement equipement = (CEquipement)objet; if (equipement.TypeEquipement == null) { result.EmpileErreur(I.T("The Equipment type cannot be null|109")); } if (equipement.Statut == null) { result.EmpileErreur(I.T("The Equipment Status must be defined|125")); } if (equipement.Emplacement == null) { result.EmpileErreur(I.T("Select an initial place for the equipment|137")); } else { if (equipement.EquipementContenant != null) { CTypeEquipement[] typeIncluantPoss = equipement.TypeEquipement.TousLesTypesIncluants; bool bTypePoss = false; foreach (CTypeEquipement tEqtPoss in typeIncluantPoss) { if (tEqtPoss == equipement.EquipementContenant.TypeEquipement) { bTypePoss = true; break; } } if (!bTypePoss) { result.EmpileErreur(I.T("The parent Equipment '@1' cannot contain this Equipment because its type isn't in the incluable types list|10000", equipement.EquipementContenant.Libelle)); } if (equipement.Emplacement.Id != equipement.EquipementContenant.Emplacement.Id) { result.EmpileErreur(I.T("The Equipment '@1' place cannot be different from the container equipment '@2' place|30000", equipement.Libelle, equipement.EquipementContenant.Libelle)); } } } if (result) { result = SObjetAFilsACoordonneeServeur.VerifieDonnees(equipement); } if (result) { result = equipement.VerifieCoordonnee(); } /*if (result) * result = CUtilElementAChamps.VerifieDonnees(equipement);*/ } catch (Exception e) { result.EmpileErreur(new CErreurException(e)); } return(result); }