Ejemplo n.º 1
0
        public void UpdateProject(models.Project project)
        {
            sourceModel.UpdateProject(toDataModel(project));

            var index = projects.IndexOfFirst(p => p.Id == project.Id);

            projects[index] = project;

            ProjectsChangedEvent?.Invoke(projects);
        }
Ejemplo n.º 2
0
        public void DeleteProject(models.Project project)
        {
            sourceModel.DeleteProject((int)project.Id);

            var index = projects.IndexOfFirst(p => p.Id == project.Id);

            projects.RemoveAt(index);

            ProjectsChangedEvent?.Invoke(projects);
        }
Ejemplo n.º 3
0
 private ProjectDataModel toDataModel(models.Project project)
 {
     return(new ProjectDataModel((int)project.Id, project.Name, project.Budget, project.Description));
 }