Ejemplo n.º 1
0
        private void ExcecuteDeleteGoal()
        {
            foreach (var goal in Goals)
            {
                goal.RelatesGoals.Remove(SelectedGoal.Id);
            }
            Goals.Remove(SelectedGoal);

            _repo.SaveGoals(Goals);
            Goals = _repo.GetAllGoals();
        }
Ejemplo n.º 2
0
        public ActionResult <IEnumerable <GoalReadDto> > GetAllGoals()
        {
            var goals = _goalRepo.GetAllGoals();
            var model = _mapper.Map <IEnumerable <GoalReadDto> >(goals);

            return(Ok(model));
        }
Ejemplo n.º 3
0
        private void UpdateGoals()
        {
            switch (SelectedmatrixLevel)
            {
            case "One":
                FilteredGoals = _repo.GetAllGoals();
                break;

            case "Two":
                FilteredGoals = _repo.GetAllGoals().Where(x => x.GoalType != GoalType.LongTerm).ToList();
                break;

            case "Three":
                FilteredGoals = _repo.GetAllGoals().Where(x => x.GoalType != GoalType.LongTerm).ToList();
                break;
            }
        }
Ejemplo n.º 4
0
 public UserInputViewModel(IGoalRepo repo, IidService idService)
 {
     _repo             = repo;
     _idService        = idService;
     AddNewGoal        = new DelegateCommand(ExcecuteAddNewGoal, CanExcecuteAddNewGoal);
     AddRelatedGoal    = new DelegateCommand(ExcecuteAddRelatedGoal, CanExcecuteAddRelatedGoal);
     RemoveRelatedGoal = new DelegateCommand(ExcecuteRemoveRelatedGoal, CanExcecuteRemoveRelatedGoal);
     DeleteGoal        = new DelegateCommand(ExcecuteDeleteGoal, CanExcecuteDeleteGoal);
     Goals             = _repo.GetAllGoals();
 }
Ejemplo n.º 5
0
 public ReportsViewModel(
     IGoalRepo repo,
     IDepartmentRepo deporepo)
 {
     _repo            = repo;
     _deporepo        = deporepo;
     _goals           = _repo.GetAllGoals();
     _departments     = _deporepo.GetAllDepartments();
     _repo.NewData   += OnNewRepoData;
     LevelOneReport   = GenerateLevelOneReport();
     LevelTwoReport   = GenerateLevelTwoReport();
     LevelThreeReport = GenerateLevelThreeReport();
 }
Ejemplo n.º 6
0
        public LevelOneMatrixViewModel(
            IDepartmentRepo depoRepo,
            IGoalRepo repo,
            IPersonRepo personRepo,
            ILevelMatrixService levelOneMatrixService,
            ILevelMatrixService leveltwoMatrixService,
            ILevelMatrixService levelTreeMatrixService,
            IidService idService)
        {
            SelectedmatrixLevel = "One";
            _depoRepo           = depoRepo;
            _repo                   = repo;
            _personRepo             = personRepo;
            _levelOneMatrixService  = levelOneMatrixService;
            _leveltwoMatrixService  = leveltwoMatrixService;
            _levelTreeMatrixService = levelTreeMatrixService;
            _repo.NewData          += OnNewRepoData;
            _idService              = idService;
            AddNewGoal              = new DelegateCommand(ExcecuteAddNewGoal, CanExcecuteAddNewGoal);
            AddRelatedGoal          = new DelegateCommand(ExcecuteAddRelatedGoal, CanExcecuteAddRelatedGoal);
            RemoveRelatedGoal       = new DelegateCommand(ExcecuteRemoveRelatedGoal, CanExcecuteRemoveRelatedGoal);
            DeleteGoal              = new DelegateCommand(ExcecuteDeleteGoal, CanExcecuteDeleteGoal);
            //DeletePerson = new DelegateCommand(ExcecuteDeletePerson, CanExcecuteDeletePerson);
            //AddNewPerson = new DelegateCommand(ExcecuteAddNewPerson, CanExcecuteAddNewPerson);
            //AddRelatedPerson = new DelegateCommand(ExcecuteAddRelatedPerson, CanExcecuteAddRelatedPerson);
            GetLevelOneMatrix       = new DelegateCommand(ExcecuteGetLevelOneMatrix);
            GetLevelTwoMatrix       = new DelegateCommand(ExcecuteGetLevelTwoMatrix, CanExcecuteGetLevelTwoMatrix);
            GetLevelThreeMatrix     = new DelegateCommand(ExcecuteGetLevelThreeMatrix, CanExcecuteGetLevelThreeMatrix);
            AddNewDepartment        = new DelegateCommand(ExcecuteAddNewDepartment, CanExcecuteAddNewDepartment);
            RemoveRelatedDepartment = new DelegateCommand(ExcecuteRemoveRelatedDepartment, CanExcecuteRemoveRelatedDepartment);
            AddRelatedDepartment    = new DelegateCommand(ExcecuteAddRelatedDepartment, CanExcecuteAddRelatedDepartment);
            DeleteDepartments       = new DelegateCommand(ExcecuteDeleteDepartments, CanExcecuteDeleteDepartments);
            //RemoveRelatedPerson = new DelegateCommand(ExcecuteRemoveRelatedPerson, CanExcecuteRemoveRelatedPerson);
            UpdateDepartments();
            Goals = _repo.GetAllGoals();
            UpdateGoals();

            //UpdatePeople();
            UpdateCanvas();
        }