public EventController(
     IEventService <IEvent> eventService,
     IParticipantService <IParticipant> participantService)
 {
     _eventService       = eventService;
     _participantService = participantService;
 }
 /// <summary>
 /// Creates a new ParticipantExchangeVisitorsController with the given service.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="participantService">the participant service.</param>
 /// <param name="userProvider">the user provider service.</param>
 public ParticipantExchangeVisitorsController(IParticipantExchangeVisitorService service, IParticipantService participantService, IUserProvider userProvider)
 {
     Contract.Requires(service != null, "The participantPersonSevis service must not be null.");
     this.service            = service;
     this.participantService = participantService;
     this.userProvider       = userProvider;
 }
Beispiel #3
0
        private void Edit(ParticipantDisplayModel participantDisplayModel, IEnumerable <string> countries, IEnumerable <string> sports)
        {
            ParticipantInfoViewModel viewModel = new ParticipantInfoViewModel(participantDisplayModel, sports, countries);
            ParticipantInfoControl   control   = new ParticipantInfoControl(viewModel);
            Window window = WindowFactory.CreateByContentsSize(control);

            viewModel.ParticipantEdited += (s, e) =>
            {
                ParticipantEditModel participantEditModel = e.Participant;
                ParticipantEditDTO   participantEditDTO   = Mapper.Map <ParticipantEditModel, ParticipantEditDTO>(participantEditModel);

                using (IParticipantService service = factory.CreateParticipantService())
                {
                    ServiceMessage serviceMessage = service.Update(participantEditDTO);
                    RaiseReceivedMessageEvent(serviceMessage.IsSuccessful, serviceMessage.Message);

                    if (serviceMessage.IsSuccessful)
                    {
                        window.Close();
                        Notify();
                    }
                }
            };

            window.Show();
        }
 /// <summary>
 /// Creates a new ParticipantsController with the given service.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="userProvider">The user provider.</param>
 public ParticipantsController(IParticipantService service, IUserProvider userProvider)
 {
     Contract.Requires(service != null, "The participant service must not be null.");
     Contract.Requires(userProvider != null, "The user provider must not be null.");
     this.service      = service;
     this.userProvider = userProvider;
 }
Beispiel #5
0
        public BracketService(IParticipantService participantService, ICategoryService categoryService)
        {
            //TODO: will need battle service to store newly generated battle objects

            _participantService = participantService;
            _categoryService    = categoryService;
        }
Beispiel #6
0
        private UIElement Create(IEnumerable <string> countries, IEnumerable <string> sports)
        {
            ParticipantCreateViewModel viewModel = new ParticipantCreateViewModel(countries, sports);
            ParticipantCreateControl   control   = new ParticipantCreateControl(viewModel);

            viewModel.ParticipantCreated += (s, e) =>
            {
                ParticipantBaseModel participantModel = e.Participant;
                ParticipantBaseDTO   participantDTO   = Mapper.Map <ParticipantBaseModel, ParticipantBaseDTO>(participantModel);

                using (IParticipantService service = factory.CreateParticipantService())
                {
                    ServiceMessage serviceMessage = service.Create(participantDTO);
                    RaiseReceivedMessageEvent(serviceMessage.IsSuccessful, serviceMessage.Message);

                    if (serviceMessage.IsSuccessful)
                    {
                        Notify();
                        viewModel.ParticipantName = String.Empty;
                    }
                }
            };

            return(control);
        }
Beispiel #7
0
 public ParticipantsController(IParticipantService participantService, IUserService userService,
                               ICurrentUser currentUser)
 {
     _participantService = participantService;
     _userService        = userService;
     _currentUser        = currentUser;
 }
Beispiel #8
0
 public ServeService(IContactService contactService,
                     IContactRelationshipService contactRelationshipService,
                     IOpportunityService opportunityService,
                     MinistryPlatform.Translation.Services.Interfaces.IEventService eventService,
                     IParticipantService participantService,
                     IGroupParticipantService groupParticipantService,
                     IGroupService groupService,
                     ICommunicationService communicationService,
                     IAuthenticationService authenticationService,
                     IConfigurationWrapper configurationWrapper,
                     IApiUserService apiUserService,
                     IResponseService responseService)
 {
     _contactService = contactService;
     _contactRelationshipService = contactRelationshipService;
     _opportunityService = opportunityService;
     _eventService = eventService;
     _participantService = participantService;
     _groupParticipantService = groupParticipantService;
     _groupService = groupService;
     _communicationService = communicationService;
     _authenticationService = authenticationService;
     _configurationWrapper = configurationWrapper;
     _apiUserService = apiUserService;
     _responseService = responseService;
 }
        /// <summary>
        /// Initializes a new instance of the ParticipantDetailViewModel class.
        /// </summary>
        public ParticipantDetailViewModel(IParticipantService participantService)
        {
            _participantService = participantService;

            //
            // TODO: Register for ParticipantSelectionMessage messages
            //
            Messenger.Default.Register <ParticipantSelectionMessage>(this, message =>
            {
                _participantService.GetById(message.ParticipantId, (p, error) =>
                {
                    if (error != null)
                    {
                        // Report error here
                        return;
                    }

                    Id        = p.Id;
                    FirstName = p.FirstName;
                    LastName  = p.LastName;
                    Company   = p.Company;
                });
            }
                                                                     );
        }
        public void TestInitializer()
        {
            _unitOfWork          = Substitute.For <IUnitOfWork2>();
            _lotteryParticipants = _unitOfWork.MockDbSetForAsync <LotteryParticipant>();

            _participantService = new ParticipantService(_unitOfWork);
        }
        /// <summary>
        /// Initializes a new instance of the ParticipantsViewModel class.
        /// </summary>
        public ParticipantsViewModel(IParticipantService participantService)
        {
            _participantService = participantService;

            var ops = new ObservableCollection <ParticipantViewModel>();

            _participantService.GetAll((ps, error) =>
            {
                if (error != null)
                {
                    // Report error here
                    return;
                }

                foreach (var p in ps)
                {
                    ops.Add(new ParticipantViewModel
                    {
                        Id        = p.Id,
                        FirstName = p.FirstName,
                        LastName  = p.LastName,
                        Company   = p.Company
                    }
                            );
                }

                Participants = ops;
            });
        }
 public ParticipantController(IMapper mapper, IParticipantService participantService,
                              IParticipantFactory factory)
 {
     this.mapper             = mapper;
     this.participantService = participantService;
     this.factory            = factory;
 }
Beispiel #13
0
 public CreateAccountPageViewModel(ILogger logger, IUiNavigationService navigationService, IParticipantService participantService)
 {
     _logger             = logger;
     _navigationService  = navigationService;
     _participantService = participantService;
     RegisterCommand     = new DelegateCommand(async() => await Register());
 }
 public ParticipantRazorService(
     IParticipantService participantService,
     NavigationManager navigationManager)
 {
     _participantService = participantService;
     _navigationManager  = navigationManager;
 }
 public ParticipantController(IHearingsService hearingsService, IParticipantService participantService, IKinlyPlatformService kinlyPlatformService,
                              IPollyRetryService pollyRetryService)
 {
     _hearingService       = hearingsService;
     _participantService   = participantService;
     _kinlyPlatformService = kinlyPlatformService;
     _pollyRetryService    = pollyRetryService;
 }
Beispiel #16
0
 public ChatroomController(IChatroomService chatroomService
                           , IParticipantService participantService
                           , UserManager <ApplicationUser> userManager)
 {
     _chatroomService    = chatroomService ?? throw new ArgumentNullException(nameof(chatroomService));
     _participantService = participantService ?? throw new ArgumentNullException(nameof(participantService));
     _userManager        = userManager ?? throw new ArgumentNullException(nameof(userManager));
 }
Beispiel #17
0
 public SessionsController(IEfRepository <ApplicationCore.Entities.Participant> userRepository
                           , IParticipantService participantService
                           , IMapper mapper)
 {
     _userRepository     = userRepository;
     _participantService = participantService;
     _mapper             = mapper;
 }
 public ParticipantApplicationServiceBase(IParticipantService service, IUnitOfWork uow, ICache cache, CurrentUser user) :
     base(service, uow, cache)
 {
     base.SetTagNameCache("Participant");
     this._validatorAnnotations = new ValidatorAnnotations <ParticipantDto>();
     this._service = service;
     this._user    = user;
 }
 public GroupController(crds_angular.Services.Interfaces.IGroupService groupService,
                        IAuthenticationService authenticationService,
                        IParticipantService participantService)
 {
     this.groupService = groupService;
     this.authenticationService = authenticationService;
     this.participantService = participantService;
 }
Beispiel #20
0
 public UserController(IUserService userService, IParticipantService participantService,
                       IMapper mapper, IUserFactory factory)
 {
     this.userService        = userService;
     this.participantService = participantService;
     this.mapper             = mapper;
     this.factory            = factory;
 }
 public ParticipantsController(IParticipantService participantService, IAuthenticationService authenticationService,
                               ICustomEncoder customEncoder, IUserService userService)
 {
     _authenticationService = authenticationService;
     _participantService    = participantService;
     _customEncoder         = customEncoder;
     _userService           = userService;
 }
Beispiel #22
0
 public AuctionCommandHandlers(IAuctionRepository repository, IAuctionService service
                               , IEventPublisher publisher, IParticipantService participantService)
 {
     _repository         = repository;
     this._service       = service;
     _publisher          = publisher;
     _participantService = participantService;
 }
 public OrderController(IParticipantService participantService, ICartService cartService, IOrderService orderService, ITransactionService transactionService, IConfigurationService configurationService)
 {
     this._participantService   = participantService;
     this._cartService          = cartService;
     this._orderService         = orderService;
     this._transactionService   = transactionService;
     this._configurationService = configurationService;
 }
 public TeamService(ITeamRepository repository, ITokenFactory tokenFactory,
                    IEmailHelper emailHelper, IParticipantService participantService)
 {
     _repository         = repository;
     _tokenFactory       = tokenFactory;
     _emailHelper        = emailHelper;
     _participantService = participantService;
 }
Beispiel #25
0
 public DataInitializer(IUserService userService, ILeaderService leaderService, ILogger <DataInitializer> logger,
                        ICourseService courseService, IParticipantService participantService)
 {
     _userService        = userService;
     _leaderService      = leaderService;
     _logger             = logger;
     _courseService      = courseService;
     _participantService = participantService;
 }
 public ParticipantsController(IMapper mapper, IParticipantService service,
                               IValidator <ParticipantCreateRequestBody> validator,
                               IValidator <ParticipantUpdateRequestBody> updateValidator)
 {
     _mapper          = mapper;
     _service         = service;
     _createValidator = validator;
     _updateValidator = updateValidator;
 }
Beispiel #27
0
        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 OpportunityServiceImpl(IMinistryPlatformService ministryPlatformService,
                               IAuthenticationService authenticationService,
                               IConfigurationWrapper configurationWrapper,
                               IParticipantService participantService,
     IApiUserService apiUserService)
     : base(authenticationService, configurationWrapper)
 {
     _ministryPlatformService = ministryPlatformService;
     _participantService = participantService;
     _apiUserService = apiUserService;
 }
Beispiel #29
0
        public ParticipantDetailViewModel(IEventAggregator eventAggregator, IParticipantService participantService)
            : base(eventAggregator)
        {
            _participantService = participantService;

            DeleteCommand        = new DelegateCommand(() => _ = DeleteAsync());
            SaveCommand          = new DelegateCommand(() => _ = SaveAsync());
            IncreaseScoreCommand = new DelegateCommand(() => _ = IncreaseScoreAsync());
            DecreaseScoreCommand = new DelegateCommand(() => _ = DecreaseScoreAsync());
            CancelCommand        = new DelegateCommand(() => _ = CancelAsync());
        }
Beispiel #30
0
        /// <summary>
        /// Creates an identity object for a participant that matches the specified 'key'.
        /// </summary>
        /// <param name="service"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public static ClaimsIdentity CreateIdentity(this IParticipantService service, Guid key)
        {
            if (key == Guid.Empty)
            {
                return(null);
            }

            var participant = service.Get(key);
            var claims      = service.GetClaims(participant.Id.Value);

            return(new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme));
        }
Beispiel #31
0
        public ParticipantDetailViewModel(
            IMessenger messenger,
            IParticipantService participantService
            )
        {
            _messenger          = messenger;
            _participantService = participantService;

            _saveParticipantCommand = new RelayCommand(() => SaveParticipant());

            _messenger.Register <ParticipantSelectionMessage>(this, OnParticipantSelected);
        }
Beispiel #32
0
        public void SetUp()
        {
            _lotteryService = Substitute.For <ILotteryService>();

            _unitOfWork = Substitute.For <IUnitOfWork2>();

            _kudosService       = Substitute.For <IKudosService>();
            _participantService = Substitute.For <IParticipantService>();
            _asyncRunner        = Substitute.For <IAsyncRunner>();
            var logger = Substitute.For <ILogger>();

            _sut = new LotteryAbortJob(_kudosService, _participantService, logger, _asyncRunner, _unitOfWork, _lotteryService);
        }
Beispiel #33
0
        public ParticipantListViewModel(IEventAggregator eventAggregator, IUnityContainer unityContainer, IParticipantService participantService)
            : base(eventAggregator)
        {
            _unityContainer     = unityContainer;
            _participantService = participantService;

            ItemsSource.CollectionChanged += OnCollectionChanged;

            AddParticipantCommand    = new DelegateCommand <Participant>(x => _ = AddParticipantAsync(x));
            DeleteParticipantCommand = new DelegateCommand <Participant>(x => _ = DeleteParticipantAsync(x));
            RefreshCommand           = new DelegateCommand(() => _ = RefreshParticipantAsync());

            _ = InitAsync();
        }
 public ChildcareService(IEventParticipantService eventParticipantService,
                         ICommunicationService communicationService,
                         IConfigurationWrapper configurationWrapper,
                         IContactService contactService,
                         MinistryPlatform.Translation.Services.Interfaces.IEventService eventService,
                         IParticipantService participantService,
                         IServeService serveService,
                         IDateTime dateTimeWrapper,
                         IApiUserService apiUserService, Interfaces.IEventService crdsEventService)
 {
     _eventParticipantService = eventParticipantService;
     _communicationService = communicationService;
     _configurationWrapper = configurationWrapper;
     _contactService = contactService;
     _crdsEventService = crdsEventService;
     _eventService = eventService;
     _participantService = participantService;
     _serveService = serveService;
     _dateTimeWrapper = dateTimeWrapper;
     _apiUserService = apiUserService;
 }
Beispiel #35
0
 public EventService(TranslationEventService eventService,
                     IGroupService groupService,
                     ICommunicationService communicationService,
                     IContactService contactService,
                     IContentBlockService contentBlockService,
                     IConfigurationWrapper configurationWrapper,
                     IApiUserService apiUserService,
                     IContactRelationshipService contactRelationshipService,
                     IGroupParticipantService groupParticipantService, IParticipantService participantService)
 {
     _eventService = eventService;
     _groupService = groupService;
     _communicationService = communicationService;
     _contactService = contactService;
     _contentBlockService = contentBlockService;
     _configurationWrapper = configurationWrapper;
     _apiUserService = apiUserService;
     _contactRelationshipService = contactRelationshipService;
     _groupParticipantService = groupParticipantService;
     _participantService = participantService;
 }
 public FillRateSystemController(IQuestionService questions, IParticipantService participant, IParticipantAnswerService userAnswers)
 {
     this.questions = questions;
     this.participant = participant;
     this.participantAnswers = userAnswers;
 }
Beispiel #37
0
 public UserService(IDbGenericRepository<User> users, IParticipantService participants)
 {
     this.users = users;
     this.participants = participants;
 }
Beispiel #38
0
 public UserController(IUserService users, IParticipantService participants, IRateSystemService rateSystems)
 {
     this.users = users;
     this.participants = participants;
     this.rateSystems = rateSystems;
 }
Beispiel #39
0
 public HomeController(IParticipantService participants, IReceiptService receipts)
 {
     _participantservice = participants;
     _receiptService = receipts;
 }