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 DeleteLock(long iLockId)
        {
            if (iLockId < 1)
            {
                throw new Exception("L'ID du lock est invalide");
            }

            var theEntity = DBRecordDataService.GetSingle <T_E_Lock>(x => x.LockId == iLockId);

            //Suppression base de données
            DBRecordDataService.Delete <T_E_Lock>(theEntity);
        }
Ejemplo n.º 3
0
        public void DeleteGeneration(long iGenerationId)
        {
            if (iGenerationId < 1)
            {
                throw new Exception("L'ID de la genenration est invalide");
            }

            var theEntity = DBRecordDataService.GetSingle <T_E_Generation>(x => x.GenerationId == iGenerationId);

            //Suppression base de données
            DBRecordDataService.Delete <T_E_Generation>(theEntity);
        }
Ejemplo n.º 4
0
        public void DeleteSpecification(long iSpecificationId)
        {
            if (iSpecificationId < 1)
            {
                throw new Exception("L'ID de la spécification est invalide");
            }

            var theEntity = DBRecordDataService.GetSingle <T_E_Specification>(x => x.SpecificationId == iSpecificationId);

            //Suppression base de données
            DBRecordDataService.DeleteSpecification(iSpecificationId);
        }
Ejemplo n.º 5
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);
        }