Exemplo n.º 1
0
 public ClientServices(IRepository repository, IClientRepository clientRepository, IAccountRepository accountRepository, IHelper helper)
 {
     _repository = repository;
     _clientRepository = clientRepository;
     _accountRepository = accountRepository;
     _helper = helper;
 }
Exemplo n.º 2
0
        private AccountCheckStream()
        {
            walletRepository = new WalletRepository();
            accountRepository = AccountRepository.Instance;
            orderRepository = OrderRepository.Instance;
            profitCalculator = ProfitCalculator.Instance;
            tradeManager = ManagerTrade.Instance.tradeManager;
            brokerRepository = new BrokerRepository();

            threadIntervalMils = AppConfig.GetIntParam("CheckLoop.Interval", 100);

            schedules = new[]
                {
                    new Schedule(CheckOrders, AppConfig.GetIntParam("CheckLoop.IntervalOrders", 300)),
                    new Schedule(CheckMargin, AppConfig.GetIntParam("CheckLoop.IntervalMargin", 15000)),
                    new Schedule(CheckSwap, AppConfig.GetIntParam("CheckLoop.IntervalSwap", 1000)),
                    new Schedule(RenewSubscriptions, AppConfig.GetIntParam("CheckLoop.UpdateSubscriptions", 1000))
                };

            // параметры начисления свопов
            var dicMetadata = brokerRepository.GetMetadataByCategory("SWAP");
            object swapHourGmtObj, minutesToCheckSwapObj;
            if (!dicMetadata.TryGetValue("Hour.GMT", out swapHourGmtObj))
                swapHourGmtObj = 21;
            swapCheckHourGmt = (int) swapHourGmtObj;

            if (!dicMetadata.TryGetValue("MinutesToCheck", out minutesToCheckSwapObj))
                minutesToCheckSwapObj = 0;
            minutesToCheckSwap = (int)minutesToCheckSwapObj;
        }
Exemplo n.º 3
0
 public HomeController(IDataCenterRepository _centerRepository, IMaterialRepository _materialRepository, IAccountRepository _rightRepository, IManagementRepository _managementRepository)
 {
     centerService = new DataCenterService(_centerRepository);
     accountService = new AccountService(_rightRepository);
     materialService = new MaterialService(_materialRepository);
     managementService = new ManagementService(_managementRepository);
 }
        protected override void Context()
        {
            _handler = Resolve<AccountHandlers>();
            _accountRepository = Resolve<IAccountRepository>();

            _handler.AsDynamic().Handle(new AccountCreated(_id, "John Doe BVBA", "John", "Doe", "*****@*****.**", DateTime.UtcNow) { Version = 1 });
        }
Exemplo n.º 5
0
        public static IAccountRepository GetAccountRepo()
        {
            if (accountRepository == null)
                accountRepository = new AccountRepository();

            return accountRepository;
        }
Exemplo n.º 6
0
        public SetupModule(IAggregateRootRepository repository,
                           IAccountRepository accountRepository,
                           IIdGenerator idGenerator)
            :base("/setup")
        {
            Get["/"] = _ =>
            {
                if (accountRepository.Count() > 0)
                    return HttpStatusCode.NotFound;

                return View["Index"];
            };

            Post["/"] = _ =>
            {
                var model = this.Bind<CreateModel>();

                if (accountRepository.Count() > 0)
                    return HttpStatusCode.NotFound;

                var account = new Domain.Account(idGenerator.NextGuid(),
                    model.Name, model.FirstName, model.LastName, model.Email);

                account.ChangePassword(model.Password);
                account.MakeAdmin();

                repository.Save(account);

                return Response.AsRedirect("/");
            };
        }
 public void SetUp()
 {
     _mockRepository = new MockRepository();
     _accountRepository = _mockRepository.StrictMock<IAccountRepository>();
     _transactionsRepository = _mockRepository.StrictMock<ITransactionsRepository>();
     _paymentGateway = _mockRepository.StrictMock<IPaymentGateway>();
 }
Exemplo n.º 8
0
 public AccountsController(IAccountRepository accountRepository, INotificationService notificationService, IAccountsSettingsService accountsSettingsService, IUserProfileService userProfileService)
 {
     this.accountRepository = accountRepository;
       this.notificationService = notificationService;
       this.accountsSettingsService = accountsSettingsService;
       this.userProfileService = userProfileService;
 }
 public ConfirmFriendshipRequestPresenter()
 {
     _webContext = new SPKTCore.Core.Impl.WebContext();
     _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
     _redirector = new SPKTCore.Core.Impl.Redirector();
 }
 public AccountServices(IAccountRepository accountRepository, PredictabullWebRequest predictabullWebRequest)
 {
     _siteHome = "service.predict-a-bull.com/api";
     //_siteHome = "localhost:49573/api";
     _predictabullWebRequest = new PredictabullWebRequest();
     _accountRepository = accountRepository;
 }
Exemplo n.º 11
0
 public JobController()
 {
     this.profileRepo = new ProfileRepository(new MVCEntities());
     this.jobRepo = new JobRepository(new MVCEntities());
     this.accountRepo = new AccountRepository(new MVCEntities());
     this.notiRepo = new NotificationRepository(new MVCEntities());
 }
        public void AoAcessarACadaDeAcessoADadosParaConsultarSeDeterminadoEmailJaEstaCadastrado_DeveRetornarFalsoCasoNaoExitaOEmail()
        {
            var user = new User
            {
                Name = "Daniel Silva Moreira",
                Email = "*****@*****.**",
                Phone = "3133333333",
                CellPhone = "3188888888",
                Address = "Rua Teste",
                Number = 123,
                District = "Centro",
                City = "Belo Horizonte",
                ZipCode = 30246130,
                State = "MG",
                Password = "******",
                UserType = "user"
            };

            const string email = "*****@*****.**";

            var auxContext = new LivrariaTDDContext();

            auxContext.Users.Add(user);

            auxContext.SaveChanges();

            var mockContext = new LivrariaTDDContext();

            _repository = new AccountRepository(mockContext);

            var result = _repository.CheckEmail(email);

            Assert.False(result);
        }
Exemplo n.º 13
0
        public BankModule(ICashDispenser dispenser, IAccountRepository accountRepo)
        {
            _dispenser = dispenser;
            _accountRepo = accountRepo;

            Get["/"] = _ =>
                           {
                               return @"<html>
                                          <body>
                                            <form action='/withdraw' method='post'>
                                              <label for='accountNo'>Account no</label>
                                              <input type='text' name='accountNo' id='accountNo'>
                                              <br />
                                              <label for='amount'>Amount</label>
                                              <input type='text' name='amount' id='amount'>
                                              <br />
                                              <input type='submit' name='withdraw' id='withdraw' value='Withdraw'>
                                            </form>
                                          </body>
                                        </html>";
                           };

            Post["/withdraw"] = p =>
                                    {
                                        var vm = this.Bind<WithdrawalVM>();
                                        var account = _accountRepo.GetAccount(vm.AccountNo);
                                        var teller = new Teller(_dispenser);
                                        teller.AuthenticateAs(account);
                                        teller.Withdraw(vm.Amount);
                                        return "It's done!";
                                    };
        }
 public ReportLogic(IUnitOfWork unit, IReportRepository repo, IActivityRepository a, IAccountRepository ac)
 {
     this.Unit = unit;
     this.Repo = repo;
     this.actRepo = a;
     this.aRepo = ac;
 }
Exemplo n.º 15
0
 public TransactionApp(ITransactionRepository transactionRepository, IAccountRepository accountRepository, ICategoryRepository categoryRepository, IPropertyRepository propertyRepository)
 {
     _transactionRepository = transactionRepository;
     _accountRepository = accountRepository;
     _categoryRepository = categoryRepository;
     _propertyRepository = propertyRepository;
 }
Exemplo n.º 16
0
 public useradminController(IAccountRepository _rightRepository, IDataCenterRepository _datacenterRepository, IMaterialRepository _materialRepository, ICostanalysisRepository _costanalysisRepository)
 {
     accountService = new AccountService(_rightRepository);
     centerService = new DataCenterService(_datacenterRepository);
     materialService = new MaterialService(_materialRepository);
     costanalysisService = new CostanalysisService(_costanalysisRepository);
 }
Exemplo n.º 17
0
 public AccountService(ILoggingService loggingService, IAccountRepository accountRepository,
     ISharedHelper helper)
 {
     _loggingService = loggingService;
     _accountRepository = accountRepository;
     _helper = helper;
 }
Exemplo n.º 18
0
 public AccountController(IOAuthWebSecurityWrapper oAuthWebSecurityWrapper,
                          IAccountRepository accountRepository,
                          IFormsAuthenticationWrapper formsAuthenticationWrapper) {
     _oAuthWebSecurityWrapper = oAuthWebSecurityWrapper;
     _accountRepository = accountRepository;
     _formsAuthenticationWrapper = formsAuthenticationWrapper;
 }
Exemplo n.º 19
0
        public AccountController(IAccountRepository accountRepository)
        {
            _accountRepository = accountRepository;

            membership = new CustomMembership();
            membership.AccountRepository = _accountRepository;
        }
Exemplo n.º 20
0
 public AccountBrowserViewModel(IAccountRepository accountRepository, IAccountTagRepository accountTagRepository, IMainWindowViewModel mainWindow = null)
 {
     _accountRepository = accountRepository;
     _accountTagRepository = accountTagRepository;
     _mainWindow = mainWindow;
     _accounts = new ObservableCollection<AccountViewModel>();
 }
Exemplo n.º 21
0
        public void Init(IInviteFriends view)
        {
            _view = view;
            //_userSession = ObjectFactory.GetInstance<IUserSession>();
            //_email = ObjectFactory.GetInstance<IEmail>();
            //_friendInvitationRepository = ObjectFactory.GetInstance<IFriendInvitationRepository>();
            //_accountRepository = ObjectFactory.GetInstance<IAccountRepository>();
            //_webContext = ObjectFactory.GetInstance<IWebContext>();
            _userSession = new SPKTCore.Core.Impl.UserSession();
            _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
            _email = new SPKTCore.Core.Impl.Email();
            _webContext = new SPKTCore.Core.Impl.WebContext();
            if (_userSession.LoggedIn)
            {
                _account = _userSession.CurrentUser;
                _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
                if (_account != null)
                {
                    _view.DisplayToData(_account.UserName + " &lt;" + _account.Email + "&gt;");

                    if (_webContext.AccoundIdToInvite > 0)
                    {
                        _accountToInvite = _accountRepository.GetAccountByID(_webContext.AccoundIdToInvite);

                        if (_accountToInvite != null)
                        {
                            SendInvitation(_accountToInvite.Email,
                                           _account.UserName + " " + _account.UserName + " ");
                            _view.ShowMessage(_accountToInvite.UserName + " Đã được gửi đi!");
                            _view.TogglePnlInvite(false);
                        }
                    }
                }
            }
        }
Exemplo n.º 22
0
 public FileWriter(IAccountRepository accountRepository, IAccountTagRepository accountTagRepository, ITemplateRepository templateRepository, IJournalRepository journalRepository)
 {
     _accountRepository = accountRepository;
     _accountTagRepository = accountTagRepository;
     _templateRepository = templateRepository;
     _journalRepository = journalRepository;
 }
Exemplo n.º 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //_profileRepository = new ProfileRepository();
            _fr = new FileRepository();
            _userSession = new UserSession();
            _accountRepository = new AccountRepository();
            _webContext = new WebContext();

                if (_userSession.LoggedIn && _userSession.CurrentUser != null)
                {
                    account = _userSession.CurrentUser;
                    file = _fr.GetFileByID(fileID);
                }

            //show the appropriate image

            if (file != null)
            {

                //Response.Clear();
                Response.ContentType = "jpg";
                Response.BinaryWrite(file.ContentFile.ToArray());

            }
        }
Exemplo n.º 24
0
        public AccountManager(
            ISecurityProvider securityProvider,
            IAccountRepository accountRepository,
            IAccountValidator accountValidator,
            ITimeSource timeSource,
            int accountSessionCollectionCapacity,
            ISessionRepository sessionRepository,
            IActionRightResolver actionRightResolver/*,
            Func<TBizAccountRegistrationData, TBizAccount> accountRegistrationDataToAccount*/)
        {
            // todo1[ak] check args
            _securityProvider = securityProvider;
            _accountRepository = accountRepository;
            _accountValidator = accountValidator;
            _timeSource = timeSource;

            _sessionManager = new SessionManager(
                _securityProvider,
                _timeSource,
                accountSessionCollectionCapacity,
                sessionRepository);

            _actionRightResolver = actionRightResolver;
            //_accountRegistrationDataToAccount = accountRegistrationDataToAccount;
        }
Exemplo n.º 25
0
 public AccountController(IAccountService accountService)
 {
     repository = new AccountRepository();
     if (accountService == null)
         throw new ArgumentNullException();
     this.accountService = accountService;
 }
Exemplo n.º 26
0
 public PlatformManager()
 {
     managerTrade = ManagerTrade.Instance;
     userSettingsStorage = new UserSettingsStorage();
     walletRepository = new WalletRepository();
     accountRepository = AccountRepository.Instance;
 }
 public FacebookAccountRepository(IAccountRepository accountRepository,
                                  IFacebookDataRepository facebookDataRepository, IEventBus eventBus)
 {
     this.accountRepository = accountRepository;
     this.facebookDataRepository = facebookDataRepository;
     this.eventBus = eventBus;
 }
Exemplo n.º 28
0
 public UserAccountRepository(IAccountRepository repository)
 {
     if (repository != null)
         _repository = repository;
     else
         throw new ArgumentNullException();
 }
Exemplo n.º 29
0
 public AdminController(PostRepository repo, IRepository<Category> category, IRepository<Location> locationRepo, IAccountRepository account)
 {
     _postRepo = repo;
     _categoryRepo = category;
     _locationRepo = locationRepo;
     _accountRepo = account;
 }
Exemplo n.º 30
0
        public AuthorizationService(IAccountRepository accountRepository, ISessionRepository sessionRepository, IPasswordHashManager passwordHashManager)
        {
            _accountRepository = accountRepository;
            _sessionRepository = sessionRepository;

            _passwordHashManager = passwordHashManager;
        }
Exemplo n.º 31
0
 public Handler(IUserContext userContext, IAccountRepository repository, ILogger <Handler> logger)
 {
     _userContext = userContext;
     _repository  = repository;
     _logger      = logger;
 }
Exemplo n.º 32
0
 public AccountService(IAccountRepository accountRepository)
 {
     _accountRepository = accountRepository;
 }
Exemplo n.º 33
0
 public AccountCommandHandlers(IAccountRepository repository)
 {
     _repository = repository;
 }
Exemplo n.º 34
0
 public AccountManager(IAccountRepository accountRepository)
 {
     _accountRepository = accountRepository;
 }
Exemplo n.º 35
0
 public CharacterCheckNick(IAccountRepository accountRepository)
 {
     _accountRepository = accountRepository;
 }
Exemplo n.º 36
0
 /// <summary>
 /// Account Controller ctor
 /// </summary>
 /// <param name="accountRepository"></param>
 public AccountController(IAccountRepository accountRepository)
 {
     this.AccountRepository = accountRepository;
 }
Exemplo n.º 37
0
 public WithdrawMoney(IAccountRepository accountRepository, INotificationService notificationService)
 {
     this.accountRepository   = accountRepository;
     this.notificationService = notificationService;
 }
 public AccountTransactionHandler(IAccountRepository repo)
 {
     _repo = repo;
 }
Exemplo n.º 39
0
 public AccountService(IAccountRepository accountRepository, IUnitOfWork unitOfWork)
 {
     this._accountRepository = accountRepository;
     this._unitOfWork        = unitOfWork;
 }
Exemplo n.º 40
0
 public AccountController(ILogger <AccountController> logger, IAccountRepository repository)
 {
     _logger     = logger;
     _repository = repository;
 }
Exemplo n.º 41
0
 public ChatDetailHub(IMapper mapper, IRoomRepository iRoomRepository, IMessageRepository iMessageRepository, IAccountRepository iAccountRepository, IThongBaoRepository thongBaoRepository, ICustomerRepository customerRepository)
 {
     _mapper                 = mapper;
     _iRoomRepository        = iRoomRepository;
     _iMessageRepository     = iMessageRepository;
     _iAccountRepository     = iAccountRepository;
     this.thongBaoRepository = thongBaoRepository;
     this.customerRepository = customerRepository;
 }
Exemplo n.º 42
0
 public AdminNavController(IMenuRepository menuRepo, IAccountRepository accountRepo)
 {
     menuRepository    = menuRepo;
     accountRepository = accountRepo;
 }
 public GetAccountByIdHandler(IAccountRepository repo)
 {
     _repo = repo;
 }
 public ResetPasswordCommandHandler(IAccountRepository accountRepository, IApiMessagesResource apiMessagesResource)
 {
     _accountRepository   = accountRepository;
     _apiMessagesResource = apiMessagesResource;
 }
Exemplo n.º 45
0
 public AccountService(IAccountRepository _accountRepository, IEventBus bus)
 {
     accountRepository = _accountRepository;
     _bus = bus;
 }
 public UserFactoryRepository(IAccountRepository accountRepository, IProfileRepository profileRepository, ISettingsRepository settingsRepository)
 {
     Accounts = accountRepository;
     Profiles = profileRepository;
     Settings = settingsRepository;
 }
 public FreezeAccountCommandHandler(IAccountStatusValidator statusValidator, IAccountRepository accountRepository)
 {
     _statusValidator   = statusValidator ?? throw new ArgumentNullException(nameof(statusValidator));
     _accountRepository = accountRepository ?? throw new ArgumentNullException(nameof(accountRepository));
 }
Exemplo n.º 48
0
 public AttachEmailCommandHandler(IAccountRepository repository) =>
Exemplo n.º 49
0
 public SalesOrderHeaderController(IAccountRepository accountRepository, ISalesOrderHeaderRepository salesOrderHeaderRepository, ILogger <SalesOrderHeaderRepository> logger)
 {
     _accountRepository          = accountRepository;
     _salesOrderHeaderRepository = salesOrderHeaderRepository;
     _logger = logger;
 }
 public CreateAccountUseCase(IAccountRepository accountRepository)
 {
     _accountRepository = accountRepository;
 }
Exemplo n.º 51
0
 public TrasnferCommandHandler(IAccountRepository accountRepo, AppDbContext unitOfWork)
 {
     _accountRepo = accountRepo;
     _unitOfWork  = unitOfWork;
 }
Exemplo n.º 52
0
 public AccountsAppService(IAccountRepository accountRepository, IMapper mapper)
 {
     _accountRepository = accountRepository;
     _mapper            = mapper;
 }
Exemplo n.º 53
0
 public MoneyBase(IAccountRepository accountRepository)
 {
     this.accountRepository = accountRepository;
 }
Exemplo n.º 54
0
 public CustomerRepository(IAccountRepository accountRepository, ICustomerAccountRepository customerAccountRepository, AppDbContext appDbContext)
 {
     _accountRepository         = accountRepository;
     _customerAccountRepository = customerAccountRepository;
     _appDbContext = appDbContext;
 }
 public AccountController(IAccountRepository r)
 {
     repo = r;
 }
Exemplo n.º 56
0
 public AccountService(IAccountRepository accountRepository, IEventBus eventBus)
 {
     _accountRepository = accountRepository;
     _eventBus          = eventBus;
 }
Exemplo n.º 57
0
 public SendNotificationWhenItemHadBeenUpdated(ITodoListRepository todoList, IHubContext <NotificationHub> context, IAccountRepository account, IHttpContextAccessor httpContextAccessor)
 {
     _httpContextAccessor = httpContextAccessor;
     _todoList            = todoList;
     _context             = context;
     _account             = account;
 }
Exemplo n.º 58
0
 public AccountAuthority(IAccountRepository repository)
 {
     _repository = repository;
 }
Exemplo n.º 59
0
 public RequestPasswordResetHandler(IAccountRepository accountRepository, ICommandBus commandBus)
 {
     _accountRepository = accountRepository;
     _commandBus        = commandBus;
 }
Exemplo n.º 60
0
 public TransferMoney(IAccountRepository accountRepository, INotificationService notificationService)
 {
     this._accountRepository   = accountRepository;
     this._notificationService = notificationService;
 }