Beispiel #1
0
 private Project(IDatabaseProject entity)
     : this(entity as IProject, entity.SyncStatus, entity.LastSyncErrorMessage, entity.IsDeleted)
 {
     Client               = entity.Client == null ? null : Models.Client.From(entity.Client);
     Workspace            = entity.Workspace == null ? null : Models.Workspace.From(entity.Workspace);
     Tasks                = entity.Tasks == null ? null : entity.Tasks.Select(Models.Task.From);
     SyncStatus           = entity.SyncStatus;
     LastSyncErrorMessage = entity.LastSyncErrorMessage;
     IsDeleted            = entity.IsDeleted;
 }
Beispiel #2
0
 public ProjectSuggestion(IDatabaseProject project)
 {
     ProjectId     = project.Id;
     ProjectName   = project.Name;
     ProjectColor  = project.Color;
     NumberOfTasks = project.Tasks?.Count() ?? 0;
     ClientName    = project.Client?.Name ?? "";
     WorkspaceName = project.Workspace?.Name ?? "";
     Tasks         = project.Tasks?.Select(task => new TaskSuggestion(task)).ToList() ?? new List <TaskSuggestion>();
 }
        public ProjectSuggestionViewModel(IDatabaseProject project)
        {
            Id           = project.Id;
            ProjectName  = project.Name;
            ProjectColor = project.Color;

            if (project.Client == null)
            {
                return;
            }

            ClientName = project.Client.Name;
        }
Beispiel #4
0
 public RealmProject(IDatabaseProject entity, Realms.Realm realm)
     : this(entity as IProject, realm)
 {
     IsDirty = entity.IsDirty;
 }
Beispiel #5
0
 public static Project From(IDatabaseProject entity)
 => new Project(entity);