public void SetCurrentProject(Guid projectId) { if (Type == OrgUserTypesRepository.TeamUser || Type == OrgUserTypesRepository.ExternalUser) { if (!Assignments.Any(a => a.ProjectId == projectId)) { throw new ValidationException("The user is not allowed to access this project's data!"); } } CurrentProjectId = projectId; }
public IStObjServiceFinalManualMapping?GetFinalMapping( IActivityMonitor m, StObjObjectEngineMap engineMap, IAutoServiceKindComputeFacade kindComputeFacade, ref bool success) { if (!_finalMappingDone) { _finalMappingDone = true; Class.ComputeFinalTypeKind(m, kindComputeFacade, new Stack <AutoServiceClassInfo>(), ref success); if (Assignments.Any()) { _finalMapping = engineMap.CreateServiceFinalManualMapping(this); } } return(_finalMapping); }
public virtual object Clone() { liteDashboardSettings clone = new liteDashboardSettings(); clone.Type = Type; clone.IdCommunity = IdCommunity; clone.Container = (ContainerSettings)Container.Clone(); clone.Pages = Pages.Select(p => (litePageSettings)p.Clone()).ToList(); clone.ForAll = ForAll; clone.FullWidth = FullWidth; clone.Status = Status; clone.IdCreatedBy = IdCreatedBy; clone.IdModifiedBy = IdModifiedBy; clone.ModifiedOn = ModifiedOn; clone.Active = (Active) ? false : Active; if (Assignments.Any()) { clone.Assignments = Assignments.Where(a => a.Deleted == BaseStatusDeleted.None).Select(a => (liteDashboardAssignment)a.Clone()).ToList(); } clone.Deleted = Deleted; clone.Id = Id; return(clone); }