Ejemplo n.º 1
0
        public ServiceBase(ILoggedUserProvider loggedUserProvider, IUnitOfWork unitOfWork)
        {
            if (unitOfWork == null)
                throw new ArgumentNullException("unitOfWork");
            UnitOfWork = unitOfWork;

            LoggedUserProvider = loggedUserProvider;
        }
        public AccountProfileService(ILoggedUserProvider loggedUserProvider, IUnitOfWork unitOfWork, RepositoryFactoryBase repositoryFactory)
            : base(loggedUserProvider, unitOfWork)
        {
            if (repositoryFactory == null)
                throw new ArgumentNullException("repositoryFactory");

            _userMessageRepository = repositoryFactory.CreateRepository<UserMessage>();
            _userRepository = repositoryFactory.CreateRepository<User>();
        }
Ejemplo n.º 3
0
 public AddProductCommand(IStoreContext context, IWriter writer, IReader reader,
                          IProductService productService, IUserService userService, ILoggedUserProvider loggedUserProvider)
     : base(context, writer, reader)
 {
     Guard.WhenArgument(productService, "productService").IsNull().Throw();
     Guard.WhenArgument(userService, "userService").IsNull().Throw();
     Guard.WhenArgument(loggedUserProvider, "loggedUserProvider").IsNull().Throw();
     this.productService     = productService;
     this.userService        = userService;
     this.loggedUserProvider = loggedUserProvider;
 }
 public ItemEditorViewModel(IContainerExtension extension, ILoggedUserProvider provider)
 {
     containerExtension  = extension;
     loggedUser          = provider;
     SaveCommand         = new DelegateCommand(SaveCustomer);
     NewCommand          = new DelegateCommand(NewCustomer);
     UpdateCommand       = new DelegateCommand(UpdateCustomer);
     LanguageSwapCommand = new DelegateCommand(SwapLang);
     dialogService       = containerExtension.Resolve <IDialogService>();
     aggregator          = containerExtension.Resolve <IEventAggregator>();
 }
Ejemplo n.º 5
0
        public ResourceService(ILoggedUserProvider loggedUserProvider, IUnitOfWork unitOfWork, RepositoryFactoryBase repositoryFactory)
            : base(loggedUserProvider, unitOfWork)
        {
            if (repositoryFactory == null)
                throw new ArgumentNullException("repositoryFactory");

            _platformRepository = repositoryFactory.CreateRepository<Platform>();
            _commentRepository = repositoryFactory.CreateRepository<Comment>();
            _userRepository = repositoryFactory.CreateRepository<User>();
            _userCommentRepository = repositoryFactory.CreateRepository<UserComment>();
        }
Ejemplo n.º 6
0
        public UserLoginCommand(IModelFactory factory, IUserService userService, IStoreContext context,
                                ILoggedUserProvider loggedUserProvider, IWriter writer, IReader reader)
            : base(context, writer, reader)
        {
            Guard.WhenArgument(factory, "model factory").IsNull().Throw();
            Guard.WhenArgument(userService, "userService").IsNull().Throw();
            Guard.WhenArgument(loggedUserProvider, "loggedUserProvider").IsNull().Throw();

            this.factory            = factory;
            this.userService        = userService;
            this.loggedUserProvider = loggedUserProvider;
        }
Ejemplo n.º 7
0
 public ProductService(IStoreContext context, ILoggedUserProvider loggedUserProvider, IWriter writer,
                       IModelFactory modelFactory)
 {
     Guard.WhenArgument(context, "context").IsNull().Throw();
     Guard.WhenArgument(loggedUserProvider, "loggedUserProvider").IsNull().Throw();
     Guard.WhenArgument(writer, "writer").IsNull().Throw();
     Guard.WhenArgument(modelFactory, "modelFactory").IsNull().Throw();
     this.context            = context;
     this.loggedUserProvider = loggedUserProvider;
     this.writer             = writer;
     this.modelFactory       = modelFactory;
 }
Ejemplo n.º 8
0
 public CustomerRegisterViewModel(IContainerExtension container, IDialogService dialog, IEventAggregator eventAggregator)
 {
     containerExtension = container;
     dialogService      = dialog;
     aggregator         = eventAggregator;
     SearchCommand      = new DelegateCommand(SearchCustomer);
     SaveCommand        = new DelegateCommand(SaveCustomer);
     NewCommand         = new DelegateCommand(NewCustomer);
     UpdateCommand      = new DelegateCommand(UpdateCustomer);
     DeleteCommand      = new DelegateCommand(DeleteCustomer);
     loggedUser         = containerExtension.Resolve <ILoggedUserProvider>();
 }
Ejemplo n.º 9
0
 public MasterRegisterViewModel(IContainerExtension container)
 {
     containerExtension     = container;
     BranchEditorCommand    = new DelegateCommand(ShowBranchEditor);
     BranchAccEditorCommand = new DelegateCommand(ShowBranchAccEditor);
     BankEditorCommand      = new DelegateCommand(ShowBankEditor);
     MeasureEditorCommand   = new DelegateCommand(ShowMeasureEditor);
     loggedUser             = containerExtension.Resolve <ILoggedUserProvider>();
     dialogService          = containerExtension.Resolve <IDialogService>();
     aggregator             = containerExtension.Resolve <IEventAggregator>();
     CanAccessBranch        = false;
 }
Ejemplo n.º 10
0
        public UserService(IPasswordSecurityHasher hasher, IStoreContext context, ILoggedUserProvider loggedUserProvider, IModelFactory factory)
        {
            Guard.WhenArgument(hasher, "passwordHasher").IsNull().Throw();
            Guard.WhenArgument(context, "context").IsNull().Throw();
            Guard.WhenArgument(loggedUserProvider, "loggedUserProvider").IsNull().Throw();
            Guard.WhenArgument(factory, "factory").IsNull().Throw();

            this.context            = context;
            this.hasher             = hasher;
            this.loggedUserProvider = loggedUserProvider;
            this.factory            = factory;
        }
Ejemplo n.º 11
0
 public UnitOfMeasureEditorViewModel(IContainerExtension extension, ILoggedUserProvider provider)
 {
     containerExtension          = extension;
     loggedUser                  = provider;
     SaveCommand                 = new DelegateCommand(SaveUom);
     NewCommand                  = new DelegateCommand(NewUom);
     UpdateCommand               = new DelegateCommand(UpdateUom);
     GridSelectionChangedCommand = new DelegateCommand(GridSelectionChanged);
     TypeChangedCommand          = new DelegateCommand(TypeChanged);
     dialogService               = containerExtension.Resolve <IDialogService>();
     aggregator                  = containerExtension.Resolve <IEventAggregator>();
 }
 public ItemRegisterViewModel(IContainerExtension container)
 {
     containerExtension    = container;
     SearchText            = string.Empty;
     SearchCommand         = new DelegateCommand(SearchItem);
     ItemEditorCommand     = new RelayParameterizedCommand((p) => ShowItemEditor(bool.Parse(p.ToString())));
     GroupEditorCommand    = new DelegateCommand(ShowGroupEditor);
     SubGroupEditorCommand = new DelegateCommand(ShowSubGroupEditor);
     UomEditorCommand      = new DelegateCommand(ShowUomEditor);
     loggedUser            = containerExtension.Resolve <ILoggedUserProvider>();
     dialogService         = containerExtension.Resolve <IDialogService>();
 }
Ejemplo n.º 13
0
        public GamesController(IGamesRepository gamesRepository, IBetsRepository betsRepository, IBetsResolver betsResolver, ILoggedUserProvider loggedUserProvider, IDateTimeProvider dateTimeProvider, IUsersRepository usersRepository, IActionLogsRepository actionLogsRepository)
        {
            if (gamesRepository == null)
            {
                throw new ArgumentNullException("gamesRepository");
            }
            this.gamesRepository = gamesRepository;

            if (betsRepository == null)
            {
                throw new ArgumentNullException("betsRepository");
            }
            this.betsRepository = betsRepository;

            if (betsResolver == null)
            {
                throw new ArgumentNullException("betsResolver");
            }
            this.betsResolver = betsResolver;

            if (loggedUserProvider == null)
            {
                throw new ArgumentNullException("loggedUserProvider");
            }
            this.loggedUserProvider = loggedUserProvider;

            if (dateTimeProvider == null)
            {
                throw new ArgumentNullException("dateTimeProvider");
            }
            this.dateTimeProvider = dateTimeProvider;

            if (dateTimeProvider == null)
            {
                throw new ArgumentNullException("dateTimeProvider");
            }
            this.dateTimeProvider = dateTimeProvider;

            if (usersRepository == null)
            {
                throw new ArgumentNullException("usersRepository");
            }
            this.usersRepository = usersRepository;

            if (actionLogsRepository == null)
            {
                throw new ArgumentNullException("actionLogsRepository");
            }
            this.actionLogsRepository = actionLogsRepository;
        }
Ejemplo n.º 14
0
        public AccountService(ILoggedUserProvider loggedUserProvider, IUnitOfWork unitOfWork, RepositoryFactoryBase repositoryFactory)
            : base(loggedUserProvider, unitOfWork)
        {
            if (repositoryFactory == null)
                throw new ArgumentNullException("repositoryFactory");

            _userRepository = repositoryFactory.CreateRepository<User>();
            _roleRepository = repositoryFactory.CreateRepository<Role>();
            _userExternalInfoRepository = repositoryFactory.CreateRepository<UserExternalInfo>();
            _userActivateTokenRepository = repositoryFactory.CreateRepository<UserActivateToken>();
            _userInfoRepository = repositoryFactory.CreateRepository<UserInfo>();
            _userResetTokenRepository = repositoryFactory.CreateRepository<UserResetToken>();
            _sexRepository = repositoryFactory.CreateRepository<Sex>();
        }
Ejemplo n.º 15
0
        public ServiceFactory(ILoggedUserProvider loggedUserProvider, IUnitOfWork unitOfWork, RepositoryFactoryBase repositoryFactory)
        {
            if (unitOfWork == null)
                throw new ArgumentNullException("unitOfWork");
            _unitOfWork = unitOfWork;

            if (repositoryFactory == null)
                throw new ArgumentNullException("repositoryFactory");
            _repositoryFactory = repositoryFactory;

            if (loggedUserProvider == null)
                throw new ArgumentNullException("loggedUserProvider");
            _loggedUserProvider = loggedUserProvider;
        }
Ejemplo n.º 16
0
		public AccountController(ILoggedUserProvider loggedUserProvider, ServiceFactoryBase serviceFactory, IAuthenticationService authenticationService, IMailer mailer)
			: base(loggedUserProvider, serviceFactory)
		{
			if (mailer == null)
				throw new ArgumentNullException("mailer");
			_mailer = mailer;

			if (authenticationService == null)
				throw new ArgumentNullException("authenticationService");
			_authenticationService = authenticationService;
			_authenticationService.AuthenticationManager = AuthenticationManager;

			_accountService = ServiceFactory.CreateAccountService();
		}
Ejemplo n.º 17
0
        public BetsController(IBetsRepository betsRepository, IBetValidator betValidator, ILoggedUserProvider userProivider, IDateTimeProvider dateTimeProvider, IActionLogsRepository actionLogsRepository, IGamesRepository gamesRepository)
        {
            userManager = new UserManager <MundialitoUser>(new UserStore <MundialitoUser>(new MundialitoContext()));
            if (gamesRepository == null)
            {
                throw new ArgumentNullException("gamesRepository");
            }
            this.gamesRepository = gamesRepository;

            if (betsRepository == null)
            {
                throw new ArgumentNullException("betsRepository");
            }
            this.betsRepository = betsRepository;

            if (betValidator == null)
            {
                throw new ArgumentNullException("betValidator");
            }
            this.betValidator = betValidator;

            if (userProivider == null)
            {
                throw new ArgumentNullException("userProivider");
            }
            this.userProivider = userProivider;

            if (dateTimeProvider == null)
            {
                throw new ArgumentNullException("dateTimeProvider");
            }
            this.dateTimeProvider = dateTimeProvider;

            if (actionLogsRepository == null)
            {
                throw new ArgumentNullException("actionLogsRepository");
            }
            this.actionLogsRepository = actionLogsRepository;
        }
Ejemplo n.º 18
0
        public GeneralBetsController(IGeneralBetsRepository generalBetsRepository, ILoggedUserProvider userProivider, IDateTimeProvider dateTimeProvider, IActionLogsRepository actionLogsRepository)
        {
            if (generalBetsRepository == null)
            {
                throw new ArgumentNullException("generalBetsRepository");
            }
            if (userProivider == null)
            {
                throw new ArgumentNullException("userProivider");
            }
            if (dateTimeProvider == null)
            {
                throw new ArgumentNullException("dateTimeProvider");
            }
            if (actionLogsRepository == null)
            {
                throw new ArgumentNullException("actionLogsRepository");
            }

            this.dateTimeProvider      = dateTimeProvider;
            this.generalBetsRepository = generalBetsRepository;
            this.userProivider         = userProivider;
            this.actionLogsRepository  = actionLogsRepository;
        }
Ejemplo n.º 19
0
        public BaseController(ILoggedUserProvider loggedUserProvider)
        {
            _loggedUserProvider = loggedUserProvider;

            this.CurrentUser = _loggedUserProvider.GetLoggedUser();
        }
Ejemplo n.º 20
0
        public BetsController(IBetsRepository betsRepository, IBetValidator betValidator, ILoggedUserProvider userProivider, IDateTimeProvider dateTimeProvider, IActionLogsRepository actionLogsRepository)
        {
            if (betsRepository == null)
            {
                throw new ArgumentNullException("betsRepository");
            }
            this.betsRepository = betsRepository;

            if (betValidator == null)
            {
                throw new ArgumentNullException("betValidator");
            }
            this.betValidator = betValidator;

            if (userProivider == null)
            {
                throw new ArgumentNullException("userProivider");
            }
            this.userProivider = userProivider;

            if (dateTimeProvider == null)
            {
                throw new ArgumentNullException("dateTimeProvider");
            }
            this.dateTimeProvider = dateTimeProvider;

            if (actionLogsRepository == null)
            {
                throw new ArgumentNullException("actionLogsRepository");
            }
            this.actionLogsRepository = actionLogsRepository;
        }
Ejemplo n.º 21
0
 public NewsController(ILoggedUserProvider loggedUserProvider, ServiceFactoryBase serviceFactory)
     : base(loggedUserProvider, serviceFactory)
 {
     _newsService = ServiceFactory.CreateNewsService();
     _resourceService = serviceFactory.CreateResourceService();
 }
 public AccountProfileController(ILoggedUserProvider loggedUserProvider, ServiceFactoryBase serviceFactory)
     : base(loggedUserProvider, serviceFactory)
 {
     _accountService = serviceFactory.CreateAccountService();
     _accountProfileService = serviceFactory.CreateAccountProfileService();
 }
        private GamesController CreateController(IGamesRepository gamesRepository, IBetsRepository betsRepository, IBetsResolver betsResolver, ILoggedUserProvider userProvider, IDateTimeProvider dateTimeProvider)
        {
            var actionLogsRepository = new Mock <IActionLogsRepository>();

            return(new GamesController(gamesRepository, betsRepository, betsResolver, userProvider, dateTimeProvider, actionLogsRepository.Object));
        }
Ejemplo n.º 24
0
 public ScrumController(ICustomerManager customerManager, ICustomerCardRowManager customerCardRowManager, IMapper mapper, ICustomerCardManager customerCardManager, ILoggedUserProvider loggedUserProvider) : base(loggedUserProvider)
 {
     _customerManager        = customerManager;
     _customerCardManager    = customerCardManager;
     _customerCardRowManager = customerCardRowManager;
     _mapper = mapper;
 }
Ejemplo n.º 25
0
 public UserTypeController(ILoggedUserProvider loggedUserProvider, IUserTypeManager userTypeManager, IMapper mapper) : base(loggedUserProvider)
 {
     _userTypeManager = userTypeManager;
     _mapper          = mapper;
 }
Ejemplo n.º 26
0
        private BetsController CreateController(IBetsRepository betsRepository, IBetValidator betValidator, ILoggedUserProvider userProvider, IDateTimeProvider dateTimeProvider)
        {
            var actionLogsRepository = new Mock <IActionLogsRepository>();
            var gamesRepository      = new Mock <IGamesRepository>();

            return(new BetsController(betsRepository, betValidator, userProvider, dateTimeProvider, actionLogsRepository.Object, gamesRepository.Object));
        }
        private GeneralBetsController CreateController(IGeneralBetsRepository repository, ILoggedUserProvider userProvider, IDateTimeProvider dateTimeProvider)
        {
            var actionLogsRepository = new Mock <IActionLogsRepository>();

            return(new GeneralBetsController(repository, userProvider, dateTimeProvider, actionLogsRepository.Object));
        }
Ejemplo n.º 28
0
 public HomeController(ILoggedUserProvider loggedUserProvider, ServiceFactoryBase serviceFactory)
     : base(loggedUserProvider, serviceFactory)
 {
     _newsService = serviceFactory.CreateNewsService();
 }