public DeleteSportCommand(ISportscardFactory sportscardFactory, ISportService sportService) : base(sportscardFactory) { Guard.WhenArgument(sportscardFactory, "Sportscard Factory can not be null.").IsNull().Throw(); Guard.WhenArgument(sportService, "SportshallService can not be null.").IsNull().Throw(); this.sportService = sportService; this.sportscardFactory = sportscardFactory; }
public CoachRegistrationInputFormViewModel( ISportsFactory sportsFactory, ISportService sportService) { _sportService = sportService; _sportsFactory = sportsFactory; }
public AdminController(IAdminService adminService, IAccountService accountService, IMemoryCache cache, ISportService sportService, IDisciplineService disciplineService, ICompetitionService competitionService, IEventService eventService, IHeatService heatService, IClubService clubService, ICourseService courseService, IDeviceService deviceService, IServiceProvider serviceProvider, ICategoryService categoryService, IChipService chipService, UserManager <ApplicationUser> userManager) { _adminService = adminService; _cache = cache; _accountService = accountService; _sportService = sportService; _disciplineService = disciplineService; _competitionService = competitionService; _eventService = eventService; _heatService = heatService; _clubService = clubService; _courseService = courseService; _deviceService = deviceService; _serviceProvider = serviceProvider; _categoryService = categoryService; _chipService = chipService; _userManager = userManager; }
private void EditSport(string sportName) { SportEditViewModel viewModel = new SportEditViewModel(sportName); SportEditControl control = new SportEditControl(viewModel); Window window = WindowFactory.CreateByContentsSize(control); viewModel.SportEdited += (s, e) => { SportEditModel sportEditModel = e.Sport; SportEditDTO sportEditDTO = Mapper.Map <SportEditModel, SportEditDTO>(sportEditModel); using (ISportService service = factory.CreateSportService()) { ServiceMessage serviceMessage = service.Update(sportEditDTO); RaiseReceivedMessageEvent(serviceMessage.IsSuccessful, serviceMessage.Message); if (serviceMessage.IsSuccessful) { window.Close(); Notify(); } } }; window.Show(); }
public AddSportToSportshallCommand(ISportscardFactory sportscardFactory, ISportService sportService) : base(sportscardFactory) { Guard.WhenArgument(sportService, "SportService can not be null.").IsNull().Throw(); this.sportService = sportService; }
public DisciplineController( IDisciplineService disciplineService, ISportService sportService) { _disciplineService = disciplineService; _sportService = sportService; }
public UIElement GetAddElement() { SportCreateViewModel viewModel = new SportCreateViewModel(); SportCreateControl control = new SportCreateControl(viewModel); viewModel.SportCreated += (s, e) => { SportCreateModel sportCreateModel = e.Sport; SportCreateDTO sportCreateDTO = Mapper.Map <SportCreateModel, SportCreateDTO>(sportCreateModel); using (ISportService service = factory.CreateSportService()) { ServiceMessage serviceMessage = service.Create(sportCreateDTO); RaiseReceivedMessageEvent(serviceMessage.IsSuccessful, serviceMessage.Message); if (serviceMessage.IsSuccessful) { viewModel.SportName = String.Empty; Notify(); } } }; return(control); }
public UIElement GetDisplayElement() { ParticipantListViewModel viewModel = new ParticipantListViewModel(this, facade); ParticipantListControl control = new ParticipantListControl(viewModel); viewModel.ParticipantSelected += (s, e) => { DataServiceMessage <IEnumerable <string> > countryServiceMessage; DataServiceMessage <IEnumerable <string> > sportServiceMessage; using (ICountryService service = factory.CreateCountryService()) { countryServiceMessage = service.GetAll(); RaiseReceivedMessageEvent(countryServiceMessage.IsSuccessful, countryServiceMessage.Message); } using (ISportService service = factory.CreateSportService()) { sportServiceMessage = service.GetAll(); RaiseReceivedMessageEvent(sportServiceMessage.IsSuccessful, sportServiceMessage.Message); } if (countryServiceMessage.IsSuccessful && sportServiceMessage.IsSuccessful) { var countries = countryServiceMessage.Data; var sports = sportServiceMessage.Data; Edit(e.Participant, countries, sports); } }; viewModel.ParticipantDeleteRequest += (s, e) => Delete(e.Participant); return(control); }
public UIElement GetAddElement() { UIElement element = null; using (ISportService service = factory.CreateSportService()) { DataServiceMessage <IEnumerable <string> > serviceMessage = service.GetAll(); RaiseReceivedMessageEvent(serviceMessage.IsSuccessful, serviceMessage.Message); if (serviceMessage.IsSuccessful) { IEnumerable <string> sports = serviceMessage.Data; element = Add(sports); } else { List <ServiceMessage> messages = new List <ServiceMessage>() { serviceMessage }; ErrorViewModel viewModel = new ErrorViewModel(messages); ErrorControl control = new ErrorControl(viewModel); element = control; } } return(element); }
public XmlService(IBetService betService, IEventService eventService, IMatchService matchService, IOddService oddService, ISportService sportService) { this.betService = betService; this.eventService = eventService; this.matchService = matchService; this.oddService = oddService; this.sportService = sportService; }
public NotificationsHub(ISportService sportService, IEventService eventService, IMatchService matchService, IBetService betService, IOddService oddService)//, IHubContext<NotificationsHub> hubContext) { this.sportService = sportService; this.eventService = eventService; this.matchService = matchService; this.betService = betService; this.oddService = oddService; }
public SportsController( MotorsportsContext context, ISportService sportService, IModelStatePopulator <Sport, string> sportModelStatePopulator) { _context = context ?? throw new ArgumentNullException(nameof(context)); _sportService = sportService ?? throw new ArgumentNullException(nameof(sportService)); _sportModelStatePopulator = sportModelStatePopulator ?? throw new ArgumentNullException(nameof(sportModelStatePopulator)); }
public SportsModel( IMapper mapper, UserManager <ApplicationUser> userManager, ISportService sportService) { this.mapper = mapper; this.userManager = userManager; this.sportService = sportService; }
public HomeController(IDbContext dbContext, ISportService sportService, ICompetitionSportService competitionSportService, ICompetitionService competitionService, IParticipationService participationService) { _dbContext = dbContext; _sportService = sportService; _competitionSportService = competitionSportService; _competitionService = competitionService; _participationService = participationService; }
public HomeController(IDbContext dbContext, ISportService sportService, ICompetitionSportService competitionSportService, ICompetitionService competitionService, IParticipationService participationService) { _dbContext = dbContext; _sportService = sportService; _competitionSportService = competitionSportService; _competitionService = competitionService; _participationService = participationService; }
public EventMapper(IEventService eventService, ISportService sportService, IPositionService positionService, IEventAttendanceService attendanceService, UserManager <WebAppUser> userManager) { this.imageService = new ImageService(); this.sportService = sportService; this.positionService = positionService; this.attendanceService = attendanceService; this.userManager = userManager; }
public UIElement GetAddElement() { UIElement element = null; DataServiceMessage <IEnumerable <string> > sportServiceMessage; DataServiceMessage <IEnumerable <TournamentDisplayDTO> > tournamentServiceMessage; DataServiceMessage <IEnumerable <ParticipantTournamentDTO> > participantServiceMessage; using (ITournamentService service = factory.CreateTournamentService()) { tournamentServiceMessage = service.GetAll(); RaiseReceivedMessageEvent(tournamentServiceMessage.IsSuccessful, tournamentServiceMessage.Message); } using (ISportService service = factory.CreateSportService()) { sportServiceMessage = service.GetAll(); RaiseReceivedMessageEvent(sportServiceMessage.IsSuccessful, sportServiceMessage.Message); } using (IParticipantService service = factory.CreateParticipantService()) { participantServiceMessage = service.GetAllWithTournaments(); RaiseReceivedMessageEvent(sportServiceMessage.IsSuccessful, sportServiceMessage.Message); } if (tournamentServiceMessage.IsSuccessful && sportServiceMessage.IsSuccessful && participantServiceMessage.IsSuccessful) { IEnumerable <string> sports = sportServiceMessage.Data; IEnumerable <TournamentDisplayDTO> tournamentDisplayDTOs = tournamentServiceMessage.Data; IEnumerable <ParticipantTournamentDTO> participantTournamentDTOs = participantServiceMessage.Data; IEnumerable <TournamentBaseModel> tournamentBaseModels = tournamentDisplayDTOs .Select(t => Mapper.Map <TournamentDisplayDTO, TournamentBaseModel>(t)) .ToList(); IEnumerable <ParticipantTournamentModel> participantTournamentModels = participantTournamentDTOs .Select(p => Mapper.Map <ParticipantTournamentDTO, ParticipantTournamentModel>(p)) .ToList(); element = Add(sports, tournamentBaseModels, participantTournamentModels); } else { List <ServiceMessage> messages = new List <ServiceMessage>() { sportServiceMessage, tournamentServiceMessage, participantServiceMessage }; ErrorViewModel viewModel = new ErrorViewModel(messages); ErrorControl control = new ErrorControl(viewModel); element = control; } return(element); }
public UIElement GetAddElement() { UIElement element = null; DataServiceMessage <IEnumerable <string> > sportServiceMessage; DataServiceMessage <IEnumerable <TournamentDisplayDTO> > tournamentServiceMessage; DataServiceMessage <IEnumerable <EventDisplayDTO> > eventServiceMessage; using (ISportService service = factory.CreateSportService()) { sportServiceMessage = service.GetAll(); RaiseReceivedMessageEvent(sportServiceMessage.IsSuccessful, sportServiceMessage.Message); } using (ITournamentService service = factory.CreateTournamentService()) { tournamentServiceMessage = service.GetAll(); RaiseReceivedMessageEvent(sportServiceMessage.IsSuccessful, sportServiceMessage.Message); } using (IEventService service = factory.CreateEventService()) { eventServiceMessage = service.GetAll(); RaiseReceivedMessageEvent(sportServiceMessage.IsSuccessful, sportServiceMessage.Message); } if (sportServiceMessage.IsSuccessful && tournamentServiceMessage.IsSuccessful && eventServiceMessage.IsSuccessful) { IEnumerable <TournamentBaseDTO> tournamentDTOs = tournamentServiceMessage.Data.AsEnumerable <TournamentBaseDTO>(); IEnumerable <EventBaseDTO> eventDTOs = eventServiceMessage.Data.AsEnumerable <EventBaseDTO>(); IEnumerable <string> sports = sportServiceMessage.Data; IEnumerable <TournamentBaseModel> tournaments = tournamentDTOs .Select(t => Mapper.Map <TournamentBaseDTO, TournamentBaseModel>(t)); IEnumerable <EventBaseModel> events = eventDTOs .Select(e => Mapper.Map <EventBaseDTO, EventBaseModel>(e)); element = Add(sports, tournaments, events); } else { List <ServiceMessage> messages = new List <ServiceMessage>() { sportServiceMessage, tournamentServiceMessage, eventServiceMessage }; ErrorViewModel viewModel = new ErrorViewModel(messages); ErrorControl control = new ErrorControl(viewModel); element = control; } return(element); }
public CreateModel( IMapper mapper, UserManager <ApplicationUser> userManager, IEventService eventService, ISportService sportService) { this.mapper = mapper; this.userManager = userManager; this.eventService = eventService; this.sportService = sportService; }
public SportsController(ISportService sportRepo, ITeamService teamRepo, IFixtureService fixtureService, ISportTableService tableGenerator, IAuthenticationService authService, IImageService imageService) { sports = sportRepo; fixture = fixtureService; teams = teamRepo; tableService = tableGenerator; images = imageService; authenticator = authService; errors = new ErrorActionResultFactory(this); }
public void SetUp() { sportsStorage = new Mock <ISportRepository>(); teamsStorage = new Mock <ITeamRepository>(); authentication = new Mock <IAuthenticationService>(); serviceToTest = new SportService(sportsStorage.Object, teamsStorage.Object, authentication.Object); testSport = new Sport("Sport", true); testDto = new SportDto() { name = testSport.Name, isTwoTeams = testSport.IsTwoTeams }; }
private void Delete(string sportName) { using (ISportService service = factory.CreateSportService()) { ServiceMessage serviceMessage = service.Delete(sportName); RaiseReceivedMessageEvent(serviceMessage); if (serviceMessage.IsSuccessful) { Notify(); } } }
public override IEnumerable <string> GetAll() { IEnumerable <string> sportNames = null; using (ISportService service = factory.CreateSportService()) { DataServiceMessage <IEnumerable <string> > serviceMessage = service.GetAll(); RaiseReveivedMessageEvent(serviceMessage.IsSuccessful, serviceMessage.Message); sportNames = serviceMessage.IsSuccessful ? serviceMessage.Data : new List <string>(); } return(sportNames); }
public AddTeamPopupViewModel( ITeamService teamService, IValidationObjectFactory validationObjectFactory, ISportService sportService, ISportsFactory sportsFactory, ITeamFactory teamFactory) { _teamService = teamService; _validationObjectFactory = validationObjectFactory; _sportService = sportService; _sportsFactory = sportsFactory; _teamFactory = teamFactory; ResetValidationObjects(); }
public MobileController(ISportService sportService, IMapper <SportEntity, SportDTO> sportMapper, IGroupService groupService, IMapper <GroupEntity, GroupMobileDTO> groupMapper, ICommentService commentService, IVisitorLogService visitorLogService, IMapper <CommentEntity, CommentDTO> commentMapper, IMapper <StudentEntity, VisitorLogDTO> studentVisitMapper, IMapper <VisitorLogEntity, VisitorLogDTO> visitMapper) { this.sportService = sportService; this.sportMapper = sportMapper; this.groupService = groupService; this.groupMapper = groupMapper; this.commentService = commentService; this.visitorLogService = visitorLogService; this.commentMapper = commentMapper; this.visitMapper = visitMapper; this.studentVisitMapper = studentVisitMapper; }
public UIElement GetAddElement() { UIElement element = null; DataServiceMessage <IEnumerable <string> > countryServiceMessage; DataServiceMessage <IEnumerable <string> > sportServiceMessage; using (ICountryService service = factory.CreateCountryService()) { countryServiceMessage = service.GetAll(); RaiseReceivedMessageEvent(countryServiceMessage.IsSuccessful, countryServiceMessage.Message); } using (ISportService service = factory.CreateSportService()) { sportServiceMessage = service.GetAll(); RaiseReceivedMessageEvent(sportServiceMessage.IsSuccessful, sportServiceMessage.Message); } if (countryServiceMessage.IsSuccessful && sportServiceMessage.IsSuccessful) { IEnumerable <string> countries = countryServiceMessage.Data; IEnumerable <string> sports = sportServiceMessage.Data; element = Create(countries, sports); } else { List <ServiceMessage> messages = new List <ServiceMessage>() { countryServiceMessage, sportServiceMessage }; ErrorViewModel viewModel = new ErrorViewModel(messages); ErrorControl control = new ErrorControl(viewModel); element = control; } return(element); }
public CoachProfileContentViewModel( IInviteService inviteService, ISportService sportService, ISportsFactory sportsFactory, ITeamMemberFactory teamMemberFactory, ITeamMemberService teamMemberService, IValidationObjectFactory validationObjectFactory, IStateService stateService) { _sportService = sportService; _sportsFactory = sportsFactory; _inviteService = inviteService; _teamMemberFactory = teamMemberFactory; _teamMemberService = teamMemberService; _validationObjectFactory = validationObjectFactory; _stateService = stateService; AddTeamPopupViewModel = ViewModelLocator.Resolve <AddTeamPopupViewModel>(); AddTeamPopupViewModel.InitializeAsync(this); TeamMemberProviderViewModel = ViewModelLocator.Resolve <TeamMemberProviderViewModel>(); TeamMemberProviderViewModel.InitializeAsync(this); }
public HomeController(ISportService sportService, ICacheProvider cacheProvider, ViewRenderer viewRenderer) { this._sportService = sportService; this._cacheProvider = cacheProvider; this._viewRenderer = viewRenderer; }
public SportController(ISportService sportService) { _sportService = sportService; }
public GetSportVisitsFromCommand(ISportscardFactory sportscardFactory, ISportService sportService) : base(sportscardFactory) { Guard.WhenArgument(sportService, "Sport service can not be null!").IsNull().Throw(); this.sportService = sportService; }
public ListAllSportsCommand(ISportService sportService) { Guard.WhenArgument(sportService, "Sport service can not be null!").IsNull().Throw(); this.sportService = sportService; }
public HomeController() { _sportService = new SportService.SportService(); }
public HomeController(IDbContext dbContext, ISportService sportService) { _dbContext = dbContext; _sportService = sportService; }