コード例 #1
0
ファイル: LandViewModel.cs プロジェクト: TakeActionNow/OSM
 public LandViewModel(string argNaam, string argContinent, ManagerViewModel argManagerViewModel, CompetitieViewModel argCompetitieViewModel)
 {
     Naam = argNaam;
     Continent = argContinent;
     ManagerViewModel = argManagerViewModel;
     CompetitieViewModel = argCompetitieViewModel;
 }
コード例 #2
0
        public CompetitieViewModel GetCompetitieViewModelByLandId(int argLandId)
        {
            CompetitieModel compM = _competitieRepo.GetCompetitieByLandID(argLandId);
            CompetitieViewModel compVM = new CompetitieViewModel(compM);

            //Get the managerCompetitieModel
            ManagerCompetitieModel managerCompetitieModel = _managerCompetitieRepo.GetManagerCompetitieModel(compM.Competitie_ID);
            compVM.ManagerPunten = managerCompetitieModel.ManagerPunten;

            //Get the landVM
            LandModel lModel = compM.LandModel;
            LandViewModel lVM = new LandViewModel(lModel);
            //Get the managerVM
            ManagerModel mModel = compM.ManagerModel;
            ManagerViewModel managerVM = new ManagerViewModel(mModel);
            //Set them in the compVM before returning.
            compVM.LandVM = lVM;
            compVM.ManaVM = managerVM;

            return compVM;
        }