Exemplo n.º 1
0
        public ActionResult CoachList(CoachListViewModel model)
        {
            //頁面dropdownlist
            model.AreaList            = new SelectList(service.GetCountry(), "Value", "Text");
            model.TrainingProgramList = new SelectList(service.GetTrainingProgramList(), "Value", "Text");
            model.CourseList          = new SelectList(service.GetCourseList(), "Value", "Text");

            //search
            int pageIndex = model.PageIndex < 1 ? 1 : model.PageIndex;
            var list      = new List <CoachData>();

            list            = service.GetCoachList(model.searchPara);
            model.coachList = list.OrderBy(c => c.Name).ToPagedList(pageIndex, PageSize);

            return(View(model));
        }
        public MainWindowViewModel()
        {
            NavCommand = new RelayCommand <string>(OnNav);

            _ageRangeListViewModel = ContainerHelper.Container.Resolve <AgeRangeListViewModel>();
            //
            _ageRangeFormViewModel = ContainerHelper.Container.Resolve <AgeRangeFormViewModel>();

            _coachListViewModel = ContainerHelper.Container.Resolve <CoachListViewModel>();
            //_coachDetailViewModel = ContainerHelper.Container.Resolve<CoachDetailViewModel>();
            _coachFormViewModel = ContainerHelper.Container.Resolve <CoachFormViewModel>();

            _genderListViewModel = ContainerHelper.Container.Resolve <GenderListViewModel>();
            //_genderDetailViewModel = ContainerHelper.Container.Resolve<GenderDetailViewModel>();
            _genderFormViewModel = ContainerHelper.Container.Resolve <GenderFormViewModel>();

            _guardianListViewModel = ContainerHelper.Container.Resolve <GuardianListViewModel>();
            //_guardianDetailViewModel = ContainerHelper.Container.Resolve<GuardianDetailViewModel>();
            _guardianFormViewModel = ContainerHelper.Container.Resolve <GuardianFormViewModel>();

            _locationListViewModel = ContainerHelper.Container.Resolve <LocationListViewModel>();
            //_locationDetailViewModel = ContainerHelper.Container.Resolve<LocationDetailViewModel>();
            _locationFormViewModel = ContainerHelper.Container.Resolve <LocationFormViewModel>();

            _organizerListViewModel = ContainerHelper.Container.Resolve <OrganizerListViewModel>();
            //_organizerDetailViewModel = ContainerHelper.Container.Resolve<OrganizerDetailViewModel>();
            _organizerFormViewModel = ContainerHelper.Container.Resolve <OrganizerFormViewModel>();

            _playerListViewModel = ContainerHelper.Container.Resolve <PlayerListViewModel>();
            //_playerDetailViewModel = ContainerHelper.Container.Resolve<PlayerDetailViewModel>();
            _playerFormViewModel = ContainerHelper.Container.Resolve <PlayerFormViewModel>();

            _scheduleListViewModel = ContainerHelper.Container.Resolve <ScheduleListViewModel>();
            //_scheduleDetailViewModel = ContainerHelper.Container.Resolve<ScheduleDetailViewModel>();
            _scheduleFormViewModel = ContainerHelper.Container.Resolve <ScheduleFormViewModel>();

            _sportListViewModel = ContainerHelper.Container.Resolve <SportListViewModel>();
            //_sportDetailViewModel = ContainerHelper.Container.Resolve<SportDetailViewModel>();
            _sportFormViewModel = ContainerHelper.Container.Resolve <SportFormViewModel>();

            _sportsEventListViewModel = ContainerHelper.Container.Resolve <SportsEventListViewModel>();
            //_sportsEventDetailViewModel = ContainerHelper.Container.Resolve<SportsEventDetailViewModel>();
            _sportsEventFormViewModel = ContainerHelper.Container.Resolve <SportsEventFormViewModel>();


            //_ageRangeListViewModel.DetailAgeRangeRequested += NavToAgeRangeDetail;
            _ageRangeListViewModel.AddAgeRangeRequested  += NavToAddAgeRange;
            _ageRangeListViewModel.EditAgeRangeRequested += NavToEditAgeRange;
            _ageRangeFormViewModel.Done += NavToAgeRangeList;

            //_coachListViewModel.DetailCoachRequested += NavToCoachDetail;
            _coachListViewModel.AddCoachRequested  += NavToAddCoach;
            _coachListViewModel.EditCoachRequested += NavToEditCoach;
            _coachFormViewModel.Done += NavToCoachList;

            //_genderListViewModel.DetailGenderRequested += NavToGenderDetail;
            _genderListViewModel.AddGenderRequested  += NavToAddGender;
            _genderListViewModel.EditGenderRequested += NavToEditGender;
            _genderFormViewModel.Done += NavToGenderList;

            //_guardianListViewModel.DetailGuardianRequested += NavToGuardianDetail;
            _guardianListViewModel.AddGuardianRequested  += NavToAddGuardian;
            _guardianListViewModel.EditGuardianRequested += NavToEditGuardian;
            _guardianFormViewModel.Done += NavToGuardianList;

            //_locationListViewModel.DetailLocationRequested += NavToLocationDetail;
            _locationListViewModel.AddLocationRequested  += NavToAddLocation;
            _locationListViewModel.EditLocationRequested += NavToEditLocation;
            _locationFormViewModel.Done += NavToLocationList;

            //_organizerListViewModel.DetailOrganizerRequested += NavToOrganizerDetail;
            _organizerListViewModel.AddOrganizerRequested  += NavToAddOrganizer;
            _organizerListViewModel.EditOrganizerRequested += NavToEditOrganizer;
            _organizerFormViewModel.Done += NavToOrganizerList;

            //_playerListViewModel.DetailPlayerRequested += NavToPlayerDetail;
            _playerListViewModel.AddPlayerRequested  += NavToAddPlayer;
            _playerListViewModel.EditPlayerRequested += NavToEditPlayer;
            _playerFormViewModel.Done += NavToPlayerList;

            //_scheduleListViewModel.DetailScheduleRequested += NavToScheduleDetail;
            _scheduleListViewModel.AddScheduleRequested  += NavToAddSchedule;
            _scheduleListViewModel.EditScheduleRequested += NavToEditSchedule;
            _scheduleFormViewModel.Done += NavToScheduleList;

            //_sportListViewModel.DetailSportRequested += NavToSportDetail;
            _sportListViewModel.AddSportRequested  += NavToAddSport;
            _sportListViewModel.EditSportRequested += NavToEditSport;
            _sportFormViewModel.Done += NavToSportList;

            //_sportsEventListViewModel.DetailSportsEventRequested += NavToSportsEventDetail;
            _sportsEventListViewModel.AddSportsEventRequested  += NavToAddSportsEvent;
            _sportsEventListViewModel.EditSportsEventRequested += NavToEditSportsEvent;
            _sportsEventFormViewModel.Done += NavToSportsEventList;
        }