Ejemplo n.º 1
0
        public void UpdateTemplateName(string iDossierName, string iNewTemplateName)
        {
            if (iDossierName.IsNullOrEmpty())
            {
                throw new Exception("Le nom du dossier est invalide");
            }

            if (iNewTemplateName.IsNullOrEmpty())
            {
                throw new Exception("Le nouveau nom d'affichage est invalide");
            }

            var theEntity = DBRecordDataService.GetSingle <T_E_Dossier>(x => x.Name == iDossierName);

            if (theEntity.IsTemplate == false)
            {
                throw new Exception("Seul un modèle peut être renommé");
            }

            //Vérification doublons
            if (DBRecordDataService.Any <T_E_Dossier>(x => x.TemplateName == iNewTemplateName))
            {
                throw new Exception("Le dossier modèle'{0}' est déjà existant".FormatString(iNewTemplateName));
            }

            theEntity.TemplateName = iNewTemplateName;
            DBRecordDataService.Update(theEntity);
        }
Ejemplo n.º 2
0
        public void UpdageGeneration(EquinoxeExtend.Shared.Object.Record.Generation iNewGeneration)
        {
            if (iNewGeneration.GenerationId < 1)
            {
                throw new Exception("L'id de la génération est invalide");
            }

            if (iNewGeneration.CreatorGUID == null)
            {
                throw new Exception("L'id du createur n'est pas valide");
            }

            if (iNewGeneration.ProjectName.IsNullOrEmpty())
            {
                throw new Exception("Le nom du projet est invalide");
            }

            if (iNewGeneration.SpecificationId < 1)
            {
                throw new Exception("L'id de la specification est invalide");
            }

            //Modification de l'enregistrement
            var theEntity = new T_E_Generation();

            theEntity.Merge(iNewGeneration);
            DBRecordDataService.Update(theEntity);
        }
Ejemplo n.º 3
0
        public void UpdateDossier(EquinoxeExtend.Shared.Object.Record.Dossier iDossier)
        {
            if (iDossier.Name.IsNullOrEmpty())
            {
                throw new Exception("Le nom du dossier est invalide");
            }

            if (DBRecordDataService.Any <T_E_Dossier>(x => x.Name == iDossier.Name) == false)
            {
                throw new Exception("Le dossier est inexistant");
            }

            var theEntity = new T_E_Dossier();

            theEntity.Merge(iDossier);
            DBRecordDataService.Update(theEntity);
        }
Ejemplo n.º 4
0
        public void UpdateDescription(string iDossierName, string iNewDescription)
        {
            if (iDossierName.IsNullOrEmpty())
            {
                throw new Exception("Le nom du dossier est invalide");
            }

            var theEntity = DBRecordDataService.GetSingle <T_E_Dossier>(x => x.Name == iDossierName);

            if (theEntity.IsTemplate == false)
            {
                throw new Exception("Seul un modèle peut modifier sa description ");
            }

            theEntity.TemplateDescription = iNewDescription;
            DBRecordDataService.Update(theEntity);
        }