Пример #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));
        }
Пример #3
0
 public static void Merge(this T_E_Specification iEntity, Specification iObj)
 {
     iEntity.SpecificationId = iObj.SpecificationId;
     iEntity.Name            = iObj.Name;
     iEntity.DossierId       = iObj.DossierId;
     iEntity.ProjectVersion  = iObj.ProjectVersion;
     iEntity.Controls        = iObj.Controls;
     iEntity.Constants       = iObj.Constants;
     iEntity.CreationDate    = iObj.CreationDate;
     iEntity.Comments        = iObj.Comments;
     iEntity.CreatorGUID     = iObj.CreatorGUID;
 }
Пример #4
0
        public static Specification Convert(this T_E_Specification iEntity)
        {
            if (iEntity == null)
            {
                return(null);
            }

            return(new Specification
            {
                SpecificationId = iEntity.SpecificationId,
                Name = iEntity.Name,
                DossierId = iEntity.DossierId,
                ProjectVersion = iEntity.ProjectVersion,
                Controls = iEntity.Controls,
                Constants = iEntity.Constants,
                CreationDate = iEntity.CreationDate,
                Comments = iEntity.Comments,
                CreatorGUID = iEntity.CreatorGUID,
            });
        }