Ejemplo n.º 1
0
 public AddTaskResourceViewModel(string taskID, string projectID)
 {
     this.TaskID                   = taskID;
     this.ProjectID                = projectID;
     projectRepository             = new ProjectRepository();
     projectTaskRepository         = new ProjectTaskRepository();
     this.AvailableResources       = new ObservableCollection <User>();
     LoadAvailableResourcesCommand = new Command(async() => await loadAvailableResourcesAsync());
 }
Ejemplo n.º 2
0
        public UnitOfWork(DataDbContext context)
        {
            _context      = context;
            _repositories = new ConcurrentDictionary <Type, object>();

            Project     = new ProjectRepository(context);
            ProjectTask = new ProjectTaskRepository(context);
            User        = new UserRepository(context);
        }
Ejemplo n.º 3
0
 public TaskDetailViewModel(ProjectTask task, string projectColor)
 {
     TaskRepository             = new ProjectTaskRepository();
     this.Name                  = task.Name;
     this.PercentComplete       = task.PercentComplete;
     this.Description           = task.Description;
     this.DueDate               = task.DueDate;
     this.TaskID                = task.Id;
     this.ProjectID             = task.ProjectID;
     this.ProjectColor          = projectColor;
     this.Comments              = new ObservableCollection <CommentListItemModel>();
     LoadProjectCommentsCommand = new Command(async() => await loadProjectCommentsAsync());
 }
Ejemplo n.º 4
0
        public ProjectDetailViewModel(Project project)
        {
            this.Project          = project;
            projectTaskRepository = new ProjectTaskRepository();
            projectRepository     = new ProjectRepository();

            this.ProjectID          = project.Id;
            this.Name               = project.Name;
            this.Color              = project.Color;
            this.Description        = project.Description;
            this.Tasks              = new ObservableCollection <ProjectTask>();
            LoadProjectTasksCommand = new Command(async() => await LoadProjectTasksAsync());
        }
Ejemplo n.º 5
0
        public async Task GetCompletionPercentage()
        {
            ProjectTaskRepository     repository = new ProjectTaskRepository();
            IEnumerable <ProjectTask> tasks      = await repository.GetByCriteria(x => x.ProjectID == this.Id);

            if (tasks.Count() > 0)
            {
                this.PercentComplete = Math.Round(tasks.Sum(x => x.PercentComplete) / tasks.Count()) + "%";
            }
            else
            {
                this.PercentComplete = "0%";
            }
        }
Ejemplo n.º 6
0
        public AddProjectTaskViewModel()
        {
            projectTaskRepository = new ProjectTaskRepository();

            DueDate = DateTime.Today;
        }
Ejemplo n.º 7
0
 public AddCommentViewModel(string taskID)
 {
     this.TaskID    = taskID;
     taskRepository = new ProjectTaskRepository();
 }