예제 #1
0
        public void UpdateSpecification(EquinoxeExtend.Shared.Object.Record.Specification iSpecification)
        {
            if (iSpecification.SpecificationId < 1)
            {
                throw new Exception("L'ID de la spéfication est invalide");
            }

            if (iSpecification.DossierId < 1)
            {
                throw new Exception("L'ID du dossier est invalide");
            }

            if (iSpecification.Name.IsNullOrEmpty())
            {
                throw new Exception("Le nom de la spéfication est invalide");
            }

            if (iSpecification.ProjectVersion < 1)
            {
                throw new Exception("La version de projet est invalide");
            }

            if (DBRecordDataService.Any <T_E_Specification>(x => x.SpecificationId == iSpecification.SpecificationId) == false)
            {
                throw new Exception("La specification est inexistante");
            }

            var theEntity = new T_E_Specification();

            theEntity.Merge(iSpecification);
            DBRecordDataService.UpdateSpecification(theEntity);
        }
예제 #2
0
        public long NewSpecification(EquinoxeExtend.Shared.Object.Record.Specification iNewSpecification)
        {
            if (iNewSpecification.Name.IsNullOrEmpty())
            {
                throw new Exception("Le nom de la spécification est invalide");
            }

            if (iNewSpecification.ProjectVersion < 1)
            {
                throw new Exception("La version de projet est invalide");
            }

            if (DBRecordDataService.Any <T_E_Specification>(x => x.Name == iNewSpecification.Name))
            {
                throw new Exception("La spécification de ce nom existe déjà");
            }

            if (iNewSpecification.CreatorGUID == null)
            {
                throw new Exception("Le nom du createur est invalide");
            }

            if (iNewSpecification.CreationDate == null)
            {
                throw new Exception("La date de création est invalide");
            }

            //Création de l'enregistrement
            var newEntity = new T_E_Specification();

            newEntity.Merge(iNewSpecification);

            return(DBRecordDataService.AddSpecification(newEntity));
        }