Exemple #1
0
 public async Task SetBranchesAssignedManagers(SeniorManagerIndexVM indexVM)
 {
     foreach (Branch branch in indexVM.Branches)
     {
         branch.AssignedManager = await _repo.Manager.GetManagerByBranchId(branch.BranchId);
     }
 }
Exemple #2
0
        // GET: SeniorManagers
        public async Task <IActionResult> Index()
        {
            SeniorManagerIndexVM indexVM = new SeniorManagerIndexVM();

            indexVM.SeniorManager = await GetCurrentSeniorManager();

            if (indexVM.SeniorManager == null)
            {
                return(RedirectToAction("Create"));
            }
            indexVM.Branches = await _repo.Branch.GetAllBranches(indexVM.SeniorManager.SeniorManagerId);
            await SetBranchesAssignedManagers(indexVM);
            await SetBranchesQualityOfWorks(indexVM.Branches);

            return(View(indexVM));
        }