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); }
public long NewGeneration(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"); } //Création de l'enregistrement var newEntity = new T_E_Generation(); newEntity.Merge(iNewGeneration); return(DBRecordDataService.Add <T_E_Generation>(newEntity).GenerationId); }
public static void Merge(this T_E_Generation iEntity, Generation iObj) { iEntity.Comments = iObj.Comments; iEntity.CreationDate = iObj.CreationDate; iEntity.CreatorGUID = iObj.CreatorGUID; iEntity.GenerationId = iObj.GenerationId; iEntity.ProjectName = iObj.ProjectName; iEntity.SpecificationId = iObj.SpecificationId; iEntity.StateRef = (short)iObj.State; iEntity.TypeRef = (short)iObj.Type; iEntity.History = iObj.History; }
public static Generation Convert(this T_E_Generation iEntity) { if (iEntity == null) { return(null); } return(new Generation { Comments = iEntity.Comments, CreationDate = iEntity.CreationDate, CreatorGUID = iEntity.CreatorGUID, GenerationId = iEntity.GenerationId, ProjectName = iEntity.ProjectName, SpecificationId = iEntity.SpecificationId, State = (GenerationStatusEnum)iEntity.StateRef, Type = (GenerationTypeEnum)iEntity.TypeRef, History = iEntity.History, }); }