public void Initialize(Guid entityId, string owner)
 {
     this.EntityId = entityId;
     this.Session = SessionManager.Manager.Open(owner);
     this.uow = new UnitOfWork();
     this.repository = new CustomerRepository(this.uow);
 }
 public CustomerService(
     ICustomerRepository customerRepository, 
     ICustomerFullNameBuilder customerFullName)
 {
     _customerRepository = customerRepository;
     _customerFullName = customerFullName;
 }
        public void Init()
        {
            Mock<ICustomerRepository<CustomerModel>> mockCustomerRepository = new Mock<ICustomerRepository<CustomerModel>>();
            Mock<IEngineerRepository<EngineerModel>> mockEngineerRepository = new Mock<IEngineerRepository<EngineerModel>>();
            Mock<IInstallationRepository<InstallationModel>> mockInstallationRepository = new Mock<IInstallationRepository<InstallationModel>>();

            List<EngineerModel> engineers = new List<EngineerModel>
            {
                new EngineerModel {engineerid=0, firstname="Karl", lastname="Maier", password="******",email="*****@*****.**", username="******"}
            };
            List<InstallationModel> installations = new List<InstallationModel>
            {
                new InstallationModel { installationid= 0, customerid=0, description="test", latitude=44, longitude=55, Measurement= new List<int>{0}, serialno="serial"}
            };
            List<CustomerModel> customers = new List<CustomerModel>
            {
                new CustomerModel { customerid=0, engineerid=0, firstname="Anton", lastname="Huber", password="******",email="*****@*****.**", username="******", Installation=new List<int> {0}}
            };

            mockCustomerRepository.Setup(mr => mr.GetAll()).Returns(customers);
            mockCustomerRepository.Setup(mr => mr.GetById(It.IsAny<int>())).Returns((int customerid) => customers.Where(customer => customer.customerid == customerid).Single());
            mockCustomerRepository.Setup(mr => mr.Add(It.IsAny<CustomerModel>())).Callback((CustomerModel customer) => customers.Add(customer));
            mockInstallationRepository.Setup(mr => mr.GetByCustomerId(It.IsAny<int>())).Returns((int customerid) => installations.Where(installation => installation.customerid == customerid).ToList<InstallationModel>());
            mockInstallationRepository.Setup(mr => mr.Add(It.IsAny<InstallationModel>())).Callback((InstallationModel installation) => installations.Add(installation));
            mockInstallationRepository.Setup(mr => mr.GetAll()).Returns(installations);
            mockEngineerRepository.Setup(mr => mr.GetMyCustomers(It.IsAny<int>())).Returns((int id) => customers.Where(customer => customer.engineerid == id).ToList<CustomerModel>());

            this.mockcrepo = mockCustomerRepository.Object;
            this.mockirepo = mockInstallationRepository.Object;
            this.mockerepo = mockEngineerRepository.Object;
        }
 /// <summary>
 /// ConductivityController controller
 /// </summary>
 /// <param name="modifiedCondRepository">modified Conductivity Repository</param>
 /// <param name="CondClient">Conductivity Client</param>
 public ConductivityController(IConductivityRepository modifiedCondRepository, IConductivityService CondClient, IRepository<customer> custRepo, ICustomerRepository modifiedCustRepository)
 {
     this.modifiedCondRepository = modifiedCondRepository;
     this.conductivityService = CondClient;
     this.customerRepository = custRepo;
     this.modifiedCustRepository = modifiedCustRepository;
 }
        public void BeforeEach()
        {
            _productRepo = Substitute.For<IProductRepository>();
            _orderFulfillmentService = Substitute.For<IOrderFulfillmentService>();
            _customerRepository = Substitute.For<ICustomerRepository>();
            _taxRateService = Substitute.For<ITaxRateService>();
            _emailService = Substitute.For<IEmailService>();

            _subject = new OrderService(_orderFulfillmentService,
                _customerRepository,
                _taxRateService,
                _emailService);

            _bestCustomer = new Customer
            {
                CustomerId = 42,
                PostalCode = "12345",
                Country = "Merica"
            };

            _listOfTaxEntries = new List<TaxEntry>
            {
                new TaxEntry {Description = "High Tax", Rate = (decimal) 0.60},
                new TaxEntry {Description = "Low Tax", Rate = (decimal) 0.10}
            };

            _orderConfirmation = new OrderConfirmation
            {
                OrderId = 1234,
                OrderNumber = "hello"
            };
            _customerRepository.Get(_bestCustomer.CustomerId.Value).Returns(_bestCustomer);
            _taxRateService.GetTaxEntries(_bestCustomer.PostalCode, _bestCustomer.Country).Returns(_listOfTaxEntries);
        }
示例#6
0
 public UserService(IUserAccountRepository userAccountRepository, ICustomerRepository customerRepository, IUserRoleRepository userRoleRepository, IRoleRepository roleRepository)
 {
     _customerRepository = customerRepository;
     _userRoleRepository = userRoleRepository;
     _roleRepository = roleRepository;
     _userAccountRepository = userAccountRepository;
 }
 protected override void Context()
 {
     MockAuthorizationService = MockRepository.GenerateStub<IAuthorizationService>();
     MockDocumentRepository = MockRepository.GenerateStub<IDocumentRepository>();
     MockCustomerRepository = MockRepository.GenerateStub<ICustomerRepository>();
     //DocumentService = new DocumentService(MockAuthorizationService, MockDocumentRepository, MockCustomerRepository);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="custRepo"></param>
 /// <param name="modifiedCustRepository"></param>
 /// <param name="vesselRepo"></param>
 public CostAnalyzerController(IRepository<customer> custRepo, ICustomerRepository modifiedCustRepository, IRepository<vessel> vesselRepo, ICostAnalyzerService costAnalyzerService)
 {
     this.customerRepository = custRepo;
     this.modifiedCustRepository = modifiedCustRepository;
     this.vesselRepository = vesselRepo;
     this.costAnalyzerService = costAnalyzerService;
 }
 public ReservationsController(IReservationRepository reservationRepository, 
     ICustomerRepository customerRepository, ILibraryItemRepository libraryItemRepository)
 {
     _reservationRepository = reservationRepository;
     _customerRepository = customerRepository;
     _libraryItemRepository = libraryItemRepository;
 }
示例#10
0
 public CartController(ICustomerRepository customerRepository,
     IProductRepository productRepository)
     : base(customerRepository)
 {
     _productRepository = productRepository;
     _customerRepository = customerRepository;
 }
		public CustomerDetailViewModel(ISecurityService securityService, IViewModelsFactory<IPhoneNumberDialogViewModel> phoneVmFactory, IViewModelsFactory<IEmailDialogViewModel> emailVmFactory, IViewModelsFactory<ICreateUserDialogViewModel> wizardUserVmFactory, IViewModelsFactory<IAddressDialogViewModel> addressVmFactory, ICustomerEntityFactory entityFactory,
			IAuthenticationContext authContext, CustomersDetailViewModel parentViewModel, Contact innerContact,
			ICustomerRepository customerRepository, IRepositoryFactory<ISecurityRepository> securityRepositoryFactory,
			IRepositoryFactory<ICountryRepository> countryRepositoryFactory, IRepositoryFactory<IOrderRepository> orderRepositoryFactory, ILoginViewModel loginViewModel)
		{
			_securityService = securityService;
			_loginViewModel = loginViewModel;
			_parentViewModel = parentViewModel;
			_authContext = authContext;
			_customerRepository = customerRepository;
			_orderRepositoryFactory = orderRepositoryFactory;
			_securityRepositoryFactory = securityRepositoryFactory;
			_countryRepositoryFactory = countryRepositoryFactory;
			_entityFactory = entityFactory;
			_addressVmFactory = addressVmFactory;
			_wizardUserVmFactory = wizardUserVmFactory;
			_emailVmFactory = emailVmFactory;
			_phoneVmFactory = phoneVmFactory;
			_fileDialogService = new FileDialogService();

			InnerItem = innerContact;

			InnerItem.PropertyChanged += _innerContact_PropertyChanged;

			CommandsInit();
			RequestInit();
			CollectionInit();

			HasCurrentContactLoginAndSuspendAccessCheck();
		}
示例#12
0
 public CustomerService(
     IUnitOfWork unitOfWork, 
     ICustomerRepository customerRepository)
 {
     UnitOfWork = unitOfWork;
     _customerRepository = customerRepository;
 }
        public CustomerService_9(ICustomerRepository customerRepository, IMailingRepository mailingRepository)
        {
            _customerRepository = customerRepository;
            _mailingRepository = mailingRepository;

            _customerRepository.NotifySalesTeam += _customerRepository_NotifySalesTeam;
        }
 public CustomerService(
     ICustomerRepository customerRepository, 
     IIdFactory idFactory)
 {
     _customerRepository = customerRepository;
     _idFactory = idFactory;
 }
        public ExternalModule(ICustomerRepository customers, IClientRepository clients)
        {
            Get["/CustomerClient/{id}"] = param =>
            {
                Guid paramId;
                Guid.TryParse(param.id, out paramId);
                var searchId = paramId;

                this.Info(() => "Searching for Customer | Client {0}".FormatWith(searchId));

                var customerAcc = customers.FirstOrDefault(x => x.Id == searchId);
                var clientAcc = clients.FirstOrDefault(x => x.Id == searchId);

                var accountNumber = "DEFAULT";
                if (customerAcc != null)
                {
                    accountNumber = customerAcc.CustomerAccountNumber.ToString();
                    this.Info(() => "Found Customer {0}".FormatWith(searchId));
                }
                if (clientAcc != null)
                {
                    accountNumber = clientAcc.ClientAccountNumber.ToString();
                    this.Info(() => "Found Client {0}".FormatWith(searchId));
                }

                if (accountNumber.Equals("DEFAULT"))
                    throw new LightstoneAutoException("Customer | Client could not be found: {0}".FormatWith(searchId));

                return accountNumber;
            };

           
        }
		public RentalAgreementService(IRentalAgreementRepository theRentalAgreementRepository,
			ICustomerRepository theCustomerRepository, IUserRepository theUserRepository)
		{
			_rentalAgreementRepository = theRentalAgreementRepository;
			_customerRepository = theCustomerRepository;
			_userRepository = theUserRepository;
		}
 public VehicleEditorModel(ICustomerRepository customerRepository, IVehicleGroupRepository vehicleGroupRepository,
     IVehicleRepository vehicleRepository,
     IVehicleDetailRepository vehicleDetailRepository, IVehicleWheelRepository vehicleWheelRepository,
     ISparepartRepository sparepartRepository, ITypeRepository typeRepository,
     ISpecialSparepartDetailRepository wheelDetailRepository, IBrandRepository brandRepository,
     ISparepartDetailRepository sparepartDetailRepository,
     ISpecialSparepartDetailRepository specialSparepartDetailRepository,
     ISparepartStockCardRepository sparepartStokCardRepository,
     IReferenceRepository referenceRepository,
     IUnitOfWork unitOfWork)
     : base()
 {
     _customerRepository = customerRepository;
     _vehicleGroupRepository = vehicleGroupRepository;
     _vehicleRepository = vehicleRepository;
     _vehicleDetailRepository = vehicleDetailRepository;
     _vehicleWheelRepository = vehicleWheelRepository;
     _specialSparepartDetailRepository = wheelDetailRepository;
     _sparepartDetailRepository = sparepartDetailRepository;
     _sparepartRepository = sparepartRepository;
     _typeRepository = typeRepository;
     _brandRepository = brandRepository;
     _sparepartStokCardRepository = sparepartStokCardRepository;
     _referenceRepository = referenceRepository;
     _unitOfWork = unitOfWork;
 }
 public CustomerController(WorkspaceController workspaces, CommandController commands,
     ICustomerRepository customerRepository)
 {
     _workspaces = workspaces;
     _commands = commands;
     _customerRepository = customerRepository;
 }
示例#19
0
 public BookingService(ILocationRepository locationRepository, ICargoRepository cargoRepository, IRoutingService routingService, ICustomerRepository customerRepository)
 {
    _locationRepository = locationRepository;
    _customerRepository = customerRepository;
    _cargoRepository = cargoRepository;
    _routingService = routingService;
 }
 public WarehouseController()
 {
     events = new EventRepository(db);
     assets = new AssetRepository(db);
     customers = new CustomerRepository(db);
     orders = new OrderRepository(db);
 }
示例#21
0
 public OrderService(IOrderRepository orderRepository, IBasketRepository basketRepository, ICustomerRepository customerRepository, IUnitOfWork uow)
 {
     _customerRepository = customerRepository;
     _orderRepository = orderRepository;
     _basketRepository = basketRepository;
     _uow = uow;
 }
 public CustomerController(ICustomerRepository customerRepository, INotificationProvider notificationProvider, IOrderRepository ordersRepository, ILogger logger)
 {
     _customerRepository = customerRepository;
     _notificationProvider = notificationProvider;
     _ordersRepository = ordersRepository;
     _logger = logger;
 }
示例#23
0
 public OrderController(ICustomerRepository customerRepository,
     IOrderRepository orderRepository)
     : base(customerRepository)
 {
     _orderRepository = orderRepository;
     _customerRepository = customerRepository;
 }
示例#24
0
        public static ICustomerRepository GetCustomerRepo()
        {
            if (customerRepo == null)
                customerRepo = new CustomerRepository();

            return customerRepo;
        }
        public IntegrationModule(ICustomerRepository customers, IClientRepository clients)
        {
            Get["/Integration/ClientCustomerContracts/All"] = param =>
            {
                var result = new List<IntegrationClientDto>();
                var clientContracts = clients.ToList().Select(
                    s =>
                        new IntegrationClientDto(s.Id, s.Name, s.ClientAccountNumber.ToString(), s.IsActive,
                            s.Contracts
                                .Select(c => new IntegrationContractDto(c.Id, c.Name, c.Packages
                                    .Select(p => new PackageDto() {PackageId = p.PackageId, Name = p.Name, IsActive = p.IsActive}))))).ToList();

                result.AddRange(clientContracts.Where(w => w.Contracts.Any()));

                var customerContracts = customers.ToList().Select(
                    s =>
                        new IntegrationClientDto(s.Id, s.Name, s.CustomerAccountNumber.ToString(), s.IsActive,
                            s.Contracts.Select(c => new IntegrationContractDto(c.Id, c.Name, c.Packages
                                .Select(p => new PackageDto() { Id = p.Id, PackageId = p.PackageId, Name = p.Name, IsActive = p.IsActive}))))).ToList();

                result.AddRange(customerContracts.Where(w => w.Contracts.Any()));

                return Response.AsJson(result);
            };
        }
 public CustomerFacade(ICustomerRepository customerRepository, IAddressRepository addressRepository, IAuth auth, IPasswordHandler passwordHandler)
 {
     _customerRepository = customerRepository;
     _addressRepository = addressRepository;
     _auth = auth;
     _passwordHandler = passwordHandler;
 }
示例#27
0
 public CustomerService(ICustomerRepository customerRepository, IUnitOfWork unitOfWork)
 {
     if (customerRepository == null) throw new ArgumentNullException("Customer repo");
     if (unitOfWork == null) throw new ArgumentNullException("Unit of work");
     _customerRepository = customerRepository;
     _unitOfWork = unitOfWork;
 }
示例#28
0
 public OrderController(IOrderRepository orderRepo,
     IUserAuthRepository userAuthRepo,
     ICustomerRepository customerRepo,
     IOrderLogRepository orderLogRepo,
     IOrderItemRepository orderItemRepo,
     IInboundPackRepository inboundRepo,
     IOutboundRepository outboundRepo,
     IOutboundItemRepository outbounditemRepo,
     ISectionRepository sectionRepo,
     IRMARepository rmaRepo,
     IRMALogRepository rmalogRepo,
     IRMAItemRepository rmaitemRepo
     )
 {
     _orderRepo = orderRepo;
     _userAuthRepo = userAuthRepo;
     _customerRepo = customerRepo;
     _orderLogRepo = orderLogRepo;
     _orderItemRepo = orderItemRepo;
     _inboundRepo = inboundRepo;
     _outboundRepo = outboundRepo;
     _outbounditemRepo = outbounditemRepo;
     _sectionRepo = sectionRepo;
     _rmaRepo = rmaRepo;
     _rmalogRepo = rmalogRepo;
     _rmaitemRepo = rmaitemRepo;
 }
示例#29
0
 public AccountServices(IRepository repository, IAccountRepository accountRepository, ICustomerRepository customerRepository,
     IDtoCreator<Account, AccountDto> accountDtoCreator)
 {
     _repository = repository;
     _accountRepository = accountRepository;
     _customerRepository = customerRepository;
     _accountDtoCreator = accountDtoCreator;
 }
        public AccountController(ICustomerRepository customerRepository)
        {
            // Setup Fields
            _customerRepository = customerRepository;

            // Setup Callbacks
            _customerRepository.StatusCallback = DisplayMessage;
        }
 public MarkCustomerAsWelcomedCommandHandler(ICustomerRepository customerRepository)
 {
     _customerRepository = customerRepository;
 }
 public RegisterCustomerCommandHandler(IUnitOfWork uow, ICustomerRepository customerRepository) : base(uow)
 {
     _customerRepository = customerRepository;
 }
示例#33
0
 public CustomerCommandHandler(IMediator mediator, ICustomerRepository customerRepository)
 {
     _mediator           = mediator;
     _customerRepository = customerRepository;
 }
示例#34
0
 public WorkOrderController(IWorkOrderService workOrderService, IMapperWrapper mapperWrapper, IWorkOrderPrintConverter workOrderPrintConverter, IMarketApiClient marketApiClient, ICustomerRepository customerRepository, IWorkerRepository workerRepository, IEvrikaPrinterClient evrikaPrinterClient)
 {
     this.workOrderService        = workOrderService;
     this.mapperWrapper           = mapperWrapper;
     this.workOrderPrintConverter = workOrderPrintConverter;
     this.marketApiClient         = marketApiClient;
     this.customerRepository      = customerRepository;
     this.workerRepository        = workerRepository;
     this.evrikaPrinterClient     = evrikaPrinterClient;
 }
示例#35
0
 public CustomerService(ICustomerRepository customerRepository, IApplicationSettings applicationSettings)
 {
     _customerRepository  = customerRepository;
     _applicationSettings = applicationSettings;
 }
示例#36
0
 public CustomerService(ICustomerRepository customerRepository,
                        IAddressRepository addressRepository)
 {
     _customerRepo      = customerRepository;
     _addressRepository = addressRepository;
 }
示例#37
0
        public static Task <Customer> UpdateAsync(this ICustomerRepository repo, Customer record)
        {
            repo.DbSet.Update(record);

            return(Task.FromResult(record));
        }
示例#38
0
 public CustomerController(ICustomerRepository customerRepository, IBookRepository bookRepository)
 {
     _customerRepository = customerRepository;
     _bookRepository     = bookRepository;
 }
示例#39
0
 public CustomerService(ICustomerRepository customerRepo)
 {
     _customerRepository = customerRepo;
 }
示例#40
0
 public ReturnController(IMovieRepository movieRepository, ICustomerRepository customerRepository)
 {
     _movieRepository    = movieRepository;
     _customerRepository = customerRepository;
 }
示例#41
0
 //private readonly IEmailService _emailService;
 public CustomerHandler(ICustomerRepository customerRepository /*, IEmailService emailService*/)
 {
     this.customerRepository = customerRepository;
     //_emailService = emailService;
 }
示例#42
0
 public CustomerController(ICustomerRepository customerRepository)
 {
     _customerRepository = customerRepository;
 }
示例#43
0
 public AccountInvoicesController(IAccountInvoiceService accountInvoiceService, IAccountInvoiceViewModelSelectListBuilder accountInvoiceViewModelSelectListBuilder, ICustomerRepository customerRepository)
     : base(accountInvoiceService, accountInvoiceViewModelSelectListBuilder, true, true)
 {
     this.customerRepository = customerRepository;
 }
示例#44
0
 public CustomerHandler(ICustomerRepository customerRepository)
 {
     _customerRepository = customerRepository;
 }
示例#45
0
        public static async Task RemoveAsync(this ICustomerRepository repo, Guid id)
        {
            var record = await repo.With(id);

            repo.DbSet.Remove(record);
        }
 public CustomerExecutiveController(ICustomerRepository customerRepository, IAccountRepository accountRepository)
 {
     _customerRepository = customerRepository;
     _accountRepository  = accountRepository;
 }
示例#47
0
 public static async Task StoreAsync(this ICustomerRepository repo, IEnumerable <Customer> list)
 {
     await repo.DbSet.AddRangeAsync(list);
 }
示例#48
0
 public GetCustomerStep(ICustomerRepository customerRepository, ICustomerStatusLevelRepository customerStatusLevelRepository)
 {
     _customerRepository            = customerRepository;
     _customerStatusLevelRepository = customerStatusLevelRepository;
 }
示例#49
0
 public CustomerViewModel(ICustomerRepository customerRepository)
 {
     CustomerRepository = customerRepository;
     InitialViewModel();
     MainUserControl = MainUserControlViewModel.GetInstance();
 }
 public HomeController(ICustomerRepository customerRepository)
 {
     _CustomerRepository = customerRepository;
 }
 public EmployeeFacade(IEmployeeRepository employeeRepository, ICustomerRepository customerRepository)
 {
     this._employeeRepository = employeeRepository;
     this._customerRepository = customerRepository;
 }
示例#52
0
        public void SetUp()
        {
            IList <Customer> customers = new List <Customer>()
            {
                new Customer()
                {
                    Firstname = "Jose",
                    Lastname  = "Perez",
                    ID        = 1
                },
                new Customer()
                {
                    Firstname = "Maria",
                    Lastname  = "lopez",
                    ID        = 2
                },
                new Customer()
                {
                    Firstname = "Clelia",
                    Lastname  = "Aguilar",
                    ID        = 3
                }
            };

            _mockCustomerRepository = new Mock <ICustomerRepository>();
            _mockCustomerRepository.Setup(mr => mr.GetAll()).Returns(customers);

            _mockCustomerRepository.Setup(mr => mr.Count()).Returns(customers.Count);

            _mockCustomerRepository.Setup(mr => mr.Get(It.IsAny <Expression <Func <Customer, bool> > >())).Returns(
                (Expression <Func <Customer, bool> > expression) =>
            {
                var userQuery = customers.Where(expression.Compile()).FirstOrDefault();
                return(userQuery);
            }
                );
            _mockCustomerRepository.Setup(mr => mr.Delete(It.IsAny <Customer>()))
            .Callback(
                (Customer us) =>
            {
                customers.Remove(us);
            }
                ).Verifiable();
            _mockCustomerRepository.Setup(mr => mr.Create(It.IsAny <Customer>()))
            .Callback(
                (Customer us) => {
                us.ID = customers.Count + 1;
                customers.Add(us);
            }
                );
            _mockCustomerRepository.Setup(mr => mr.Update(It.IsAny <Customer>()))
            .Callback(
                (Customer us) => {
                int index = customers.IndexOf(us);
                if (index != -1)
                {
                    customers[index] = us;
                }
            }
                )
            .Verifiable();
            _mockCustomerRepository.Setup(mr => mr.ExecuteQuery(It.IsAny <string>())).Throws(new NotSupportedException("Query executions not supported."));
            this.MockCustomerRepository = _mockCustomerRepository.Object;
        }
 public UnitOfWork()
 {
     _customers = new CustomerRepository();
 }
 public CustomerController(IMapper mapper, ICustomerRepository repository)
 {
     _mapper     = mapper;
     _repository = repository;
 }
示例#55
0
 public CustomerService(ICustomerRepository customerRepository)
 {
     this.customerRepository = customerRepository;
 }
示例#56
0
 public CustomerService(ITenantPersistenceService tenantPersistenceService, ICustomerRepository customerRepository, IBusinessRuleSet <Customer> businessRuleSet = null)
     : base(customerRepository, customerRepository, tenantPersistenceService, businessRuleSet)
 {
     _customerRepository = customerRepository;
 }
 public QAHub(ICustomerRepository customerRepository)
 {
     _customerRepository = customerRepository;
 }
 public CustomerReRegistrationOnbaseService(OnbaseSettings onbaseSettings, IOnbaseConector _onbaseConector, ICustomerRepository _customerRepository, ILogger logger) : base(onbaseSettings, _onbaseConector)
 {
     this._onbaseSettings     = onbaseSettings;
     this._logger             = logger;
     this._customerRepository = _customerRepository;
 }
示例#59
0
 public CustomerManager(ICustomerRepository customerRepository)
 {
     _customerRepository = customerRepository;
 }
 public CustomerEventsListener(ICustomerRepository repo, IConfiguration config)
 {
     this.repo   = repo;
     eventSender = new ServiceBusQueueEvents(config);
 }