private void ExcecuteDeleteDepartments() { AllDepartments = _depoRepo.GetAllDepartments(); foreach (var goal in Goals) { goal.RelatedDepartments.RemoveAll(x => x == SelectedGoal.Id); } AllDepartments.Single(x => x.Id == SelectedDepartment.Id).Deleted = true; _depoRepo.SaveDepartments(AllDepartments); AllDepartments = _depoRepo.GetAllDepartments(); UpdateCanvas(); }
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(); }
public async Task <IActionResult> Index() { var depts = await departmentRepo.GetAllDepartments(); return(View(depts)); }
public async Task <IActionResult> Create() { ViewBag.Departments = await departmentRepo.GetAllDepartments(); return(View()); }
public IList <Depatment> GetAllDepartments() { return(_IdepartmentRepo.GetAllDepartments()); }