Inheritance: ICustomerRepository
        public void BankAccountRepositoryAddNewItemSaveItem()
        {
            //Arrange
            var unitOfWork = new MainBCUnitOfWork();
            var customerRepository = new CustomerRepository(unitOfWork);
            var bankAccountRepository = new BankAccountRepository(unitOfWork);
           
            var customer = customerRepository.Get(new Guid("43A38AC8-EAA9-4DF0-981F-2685882C7C45"));
            
            var bankAccountNumber = new BankAccountNumber("1111", "2222", "3333333333", "01");

            var newBankAccount = BankAccountFactory.CreateBankAccount(customer,bankAccountNumber);
            

            //Act
            bankAccountRepository.Add(newBankAccount);

            try
            {
                unitOfWork.Commit();
            }
            catch (DbUpdateException ex)
            {
                var entry = ex.Entries.First();
            }
        }
        public void Initialize()
        {
            connection = Effort.DbConnectionFactory.CreateTransient();
            databaseContext = new TestContext(connection);
            objRepo = new CustomerRepository(databaseContext);

        }
        public void CustomerRepositoryAddNewItemSaveItem()
        {
            //Arrange
            var unitOfWork = new MainBCUnitOfWork();
            ICustomerRepository customerRepository = new CustomerRepository(unitOfWork);

            var countryId = new Guid("32BB805F-40A4-4C37-AA96-B7945C8C385C");

            var customer = CustomerFactory.CreateCustomer("Felix", "Trend", countryId, new Address("city", "zipCode", "addressLine1", "addressLine2"));
            customer.Id = IdentityGenerator.NewSequentialGuid();

            customer.Picture = new Picture()
            {
                Id = customer.Id
            };

            //Act

            customerRepository.Add(customer);
            customerRepository.UnitOfWork.Commit();

            //Assert

            var result = customerRepository.Get(customer.Id);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Id == customer.Id);
        }
 public JsonResult Customers(string term)
 {
     term = term.ToLower();
     IList<string> custList = new CustomerRepository(_sqlConnectionString).CustomerNamesList;
     var result = custList.Where(c => c.ToLower().Contains(term)).Take(10);
     return Json(result, JsonRequestBehavior.AllowGet);
 }
 public static Installation ConverttoEntity(InstallationModel ininstallation)
 {
     Installation installation = null;
        try
        {
        CustomerRepository crepo = new CustomerRepository();
        MeasurementRepository mrepo = new MeasurementRepository();
        installation = new Installation();
        installation.customerid = ininstallation.customerid;
        installation.installationid = ininstallation.installationid;
        installation.latitude = ininstallation.latitude;
        installation.longitude = ininstallation.longitude;
        installation.description = ininstallation.description;
        installation.serialno = ininstallation.serialno;
        //installation.Customer = ConvertCustomer.ConverttoEntity(crepo.GetById(installation.customerid));
        foreach (var item in ininstallation.Measurement)
        {
            installation.Measurement.Add(ConvertMeasurement.ConverttoEntity(mrepo.GetById(item)));
        }
        log.Info("InstallationModel wurde konvertiert.");
        }
        catch (Exception exp)
        {
        log.Error("InstallationModel konnte nicht konvertiert werden.");
        throw new DalException("InstallationModel konnte nicht konvertiert werden.", exp);
        }
        return installation;
 }
 //public CustomerService(OrderRepository orderRepo, ApplicationUserManager userMan)
 public CustomerService(UserAddressRepository userAddressRepo, OrderRepository orderRepo, CustomerRepository customerRepo, ApplicationUserManager userMan)
 {
     _userAddressRepo = userAddressRepo;
     _orderRepo = orderRepo;
     _customerRepo = customerRepo;
     _userManager = userMan;
 }
Example #7
0
        static void Main(string[] args)
        {
            using (var context = new DatabaseContext())
            {
                ICustomerRepository customers = new CustomerRepository(context);
                IProductRepository products = new ProductRepository(context);

                var github = new Customer() { IsActive = true, Name = "GitHub" };
                var microsoft = new Customer() {IsActive = true, Name = "Microsoft"};
                var apple = new Customer() { IsActive = false, Name = "Apple" };

                customers.Create(github);
                customers.Create(microsoft);
                customers.Create(apple);

                var windows = new Product()
                {
                    CustomerId = microsoft.Id,
                    Description = "The best OS!",
                    Name = "Windows 10",
                    Sku = "AWESOME1"
                };

                var sourceControl = new Product()
                {
                    CustomerId = github.Id,
                    Description = "The best hosted source control solution!",
                    Name = "GitHub Enterprise",
                    Sku = "AWESOME2"
                };

                var iphone = new Product()
                {
                    CustomerId = apple.Id,
                    Description = "The best phone ever created!",
                    Name = "iPhone 6S",
                    Sku = "AWESOME3"
                };

                products.Create(windows);
                products.Create(sourceControl);
                products.Create(iphone);

                foreach (var customer in customers.All.WhereIsActive().ToList())
                {
                    Console.WriteLine(customer.Name);
                }

                foreach (var customer in customers.GetAllWithProducts().WhereNameBeginsWith("Git").WhereIsActive().ToList())
                {
                    Console.WriteLine(customer.Name);

                    foreach (var product in customer.Products)
                    {
                        Console.WriteLine("-- {0}", product.Name);
                    }
                }
            }
        }
        public AllCustomersViewModel(CustomerRepository customerRepository)
        {
            _customerRepository = customerRepository;
            _customerRepository.CustomerAdded += this.OnCustomerAddedToRepository;
            base.DisplayName = "AllCustomersViewModelDisplayName";

            this.CreateAllCustomers();
        }
 public Order GetOrderById(int OrderId)
 {
     _customerRepository = new CustomerRepository();
     var order = _context.Orders.Single(o => o.OrderId == OrderId);
     if (order.CustomerId.Length > 0)
         order.Customer = _customerRepository.GetCustomerByCustomerId(order.CustomerId);
     return order;
 }
Example #10
0
 public CustomerRepository GetCustomerRepository()
 {
     if (customerRepo == null)
     {
         customerRepo = new CustomerRepository();
     }
     return customerRepo;
 }
Example #11
0
 public ProfileController()
 {
     _currencyRepository = new CurrencyRepository();
     _balanceRepository = new BalanceRepository();
     _cardRepository = new CardRepository();
     _customerRepository = new CustomerRepository();
     _accountRepository = new AccountRepository();
 }
Example #12
0
 public TransferFundsController()
 { 
     _accountRepository = new AccountRepository();
     _cardRepository = new CardRepository();
     _customerRepository = new CustomerRepository();
     _transactionRepository = new TransactionRepository();
     _transactionTypeRepository = new TransactionTypeRepository();
     _balanceRepository = new BalanceRepository();
 }
Example #13
0
 public UnitOfWork(LuaContext context)
 {
     _context = context;
     Authors = new AuthorRepository(_context);
     Books = new BookRepository(_context);
     Customers = new CustomerRepository(_context);
     Rentals = new RentalRepository(_context);
     Stocks = new StockRepository(_context);
 }
Example #14
0
 public AptekaNetUnitOfWork()
 {
     Context = new AptekaNETDbContext();
     OrderRepository = new OrderRepository(Context);
     EmployeeRepository = new EmployeeRepository(Context);
     CustomerRepository = new CustomerRepository(Context);
     MedicineRepository = new MedicineRepository(Context);
     ProductRepository = new ProductRepository(Context);
     PharmacyRepository = new PharmacyRepository(Context);
 }
        public void GetAllWithNullArgument_ThrowsExceptions()
        {
            using (CustomerRepository repository = new CustomerRepository())
            {
                IEnumerable<Customer> customers =
                    repository.GetAll(null);

                Assert.Fail("Show have thrown an ArgumentNullException.");
            }
        }
Example #16
0
 public void Get()
 {
     using (var uow = UnitOfWork.Create(true))
     {
         var repository = new CustomerRepository(uow);
         var cus = repository.GetById(1);
         Assert.IsNotNull(cus);
         uow.Complete();
     }
 }
Example #17
0
        public void TestRemoveCustomer_PassNull_ShouldThrowArgumentNullException()
        {
            var dbSetMock = new Mock<DbSet<Customer>>();

            var mockedContext = new Mock<NorthwindEntities>();
            mockedContext.SetupGet(x => x.Customers).Returns(dbSetMock.Object);

            var repository = new CustomerRepository(mockedContext.Object);

            Assert.Throws<ArgumentNullException>(() => repository.RemoveCustomer(null));
        }
        public static void Wrong()
        {
            var repository = new CustomerRepository();
            Customer customer = new Customer()
            {
                Name = "Michael L Perry",
                PhoneNumber = "222-9999"
            };

            repository.Save(customer);
        }
        public void UsingTheRepo_WithoutOpeningItBefore_ThrowsException()
        {
            var customerMock = new Mock<CustomerRecord>();
            var lineFileMock = new Mock<ILineFile>();
            var repo = new CustomerRepository<CustomerRecord>(lineFileMock.Object, ';');

            Assert.Throws<RepositoryException>(() => repo.Store(customerMock.Object));
            Assert.Throws<RepositoryException>(() => repo.Delete(customerMock.Object));
            Assert.Throws<RepositoryException>(() => repo.Select(customerMock.Object));
            Assert.Throws<RepositoryException>(() => repo.Select(new Func<CustomerRecord, bool>(c => true)));
        }
        /// <summary>
        /// Rule 5a) Missing data or errors must be made explicit.
        /// </summary>
        public void TestThatErrorsAreExplicit()
        {
            // create a repository
            var repo = new CustomerRepository();

            // find a customer by id
            var customer = repo.GetById(42);

            // what is the expected output?
            Console.WriteLine(customer.Id);
        }
        public void GetNamesAndEmailTest()
        {
            // Arrange
            CustomerRepository repository = new CustomerRepository();
            var customerList = repository.Retrieve();

            // Act
            var query = repository.GetNamesAndEmail(customerList);

            // NOT REALLY A TEST
        }
Example #22
0
        public CustomerViewModel(Customer customer, CustomerRepository customerRepository)
        {
            if (customer == null)
                throw new ArgumentNullException("customer");

            if (customerRepository == null)
                throw new ArgumentNullException("customerRepository");

            _customer = customer;
            _customerRepository = customerRepository;
            _customerType = "Not Specified";
        }
        public void FindTestNotFound()
        {
            // Arrange
            CustomerRepository repository = new CustomerRepository();
            var customerList = repository.Retrieve();

            // Act
            var result = repository.Find(customerList, 42);

            // Assert
            Assert.IsNull(result);
        }
        public void GetAllWithNoSubItems_ReturnsExpected()
        {
            using (CustomerRepository repository = new CustomerRepository())
            {
                IEnumerable<Customer> customers =
                    repository.GetAll();

                Assert.IsNotNull(customers.First());
                Assert.IsNull(customers.First().CustomerSecure);
                Assert.IsNull(customers.First().Orders);
            }
        }
        public void CustomerRepositoryGetMethodReturnNullWhenIdIsEmpty()
        {
            //Arrange
            var unitOfWork = new MainBCUnitOfWork();
            var customerRepository = new CustomerRepository(unitOfWork);

            //Act
            var customer = customerRepository.Get(Guid.Empty);

            //Assert
            Assert.IsNull(customer);
        }
        public AutoResolveClientDbContext()
        {
            conn = DependencyService.Get<ISQLite>().GetConnection();

            CustomerRepository = new CustomerRepository(conn);
            AccidentRepository = new AccidentRepository(conn);
            WitnessRepository = new WitnessRepository(conn);
            OtherDriverRepository = new OtherDriverRepository(conn);
            MediaRepository = new AccidentMediaRepository(conn);
            CustomerSettingsRepository = new CustomerSettingsRepository(conn);
            AccountRepository = new AccountRepository(conn);
            
        }
        public void CustomerRepositoryFilterMethodReturnEntitisWithSatisfiedFilter()
        {
            //Arrange
            var unitOfWork = new MainBCUnitOfWork();
            ICustomerRepository customerRepository = new CustomerRepository(unitOfWork);

            //Act
            var result = customerRepository.GetFiltered(c => c.CreditLimit > 0);

            //Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.All(c => c.CreditLimit>0));
        }
        public void CustomerRepositoryAllMatchingMethodReturnEntitiesWithSatisfiedCriteria()
        {
            //Arrange
            var unitOfWork = new MainBCUnitOfWork();
            ICustomerRepository customerRepository = new CustomerRepository(unitOfWork);

            var spec = CustomerSpecifications.EnabledCustomers();

            //Act
            var result = customerRepository.AllMatching(spec);

            //Assert
            Assert.IsNotNull(result.All(c => c.IsEnabled));
        }
        public static void Right()
        {
            var repository = new CustomerRepository();
            Customer customer = new Customer()
            {
                Name = "Michael L Perry",
                PhoneNumber = "(214) 222-9999"
            };

            if (!customer.Validate())
                Console.WriteLine("Invalid customer");
            else
                repository.Save(customer);
        }
Example #30
0
        public void TestRemoveCustomer_PassValidCustomer_ShouldCalllContextCustomers()
        {
            var dbSetMock = new Mock<DbSet<Customer>>();

            var mockedContext = new Mock<NorthwindEntities>();
            mockedContext.SetupGet(x => x.Customers).Returns(dbSetMock.Object);

            var repository = new CustomerRepository(mockedContext.Object);

            var customer = new Mock<Customer>().Object;
            repository.RemoveCustomer(customer);

            mockedContext.Verify(x => x.Customers, Times.Once);
        }
Example #31
0
        public static void Main(string[] args)
        {
            var newProduct1 = new Product {
                Name = "firstProduct"
            };
            var newProduct2 = new Product()
            {
                Name = "secondProduct"
            };
            var newCustomer1 = new Customer()
            {
                Name = "firstCustomer", Email = "*****@*****.**", Adress = "sadsaswwww", Id = Guid.NewGuid(), PhoneNumber = "0742757942"
            };
            var newCustomer2 = new Customer()
            {
                Name = "secondCustomer", Email = "*****@*****.**", Adress = "sdsaswwww", Id = Guid.NewGuid(), PhoneNumber = "0742757942"
            };
            var newCustomer3 = new Customer()
            {
                Name = "thirdCustomer", Email = "*****@*****.**", Adress = "sadsasww", Id = Guid.NewGuid(), PhoneNumber = "0742757942"
            };

            using (var dbCtx1 = new DbEntities())
            {
                var productRepo  = new ProductRepository <Product>(dbCtx1);
                var customerRepo = new CustomerRepository <Customer>(dbCtx1);


                productRepo.Add(newProduct1);
                productRepo.Add(newProduct2);

                customerRepo.Add(newCustomer1);
                customerRepo.Add(newCustomer2);
                customerRepo.Add(newCustomer3);

                var numberOfProducts  = dbCtx1.Products.Count();
                var numberOfCustomers = dbCtx1.Customers.Count();
                Console.WriteLine("Number of Customers: " + numberOfCustomers);
                Console.WriteLine("Number of Products: " + numberOfProducts);
            }

            using (var dbCtx2 = new DbEntities())
            {
                var userRepo         = new UserRepository <User>(dbCtx2);
                var organisationRepo = new OrganizationRepository <Organization>(dbCtx2);

                for (int i = 0; i < 10; ++i)
                {
                    userRepo.Add(new User()
                    {
                        Id = Guid.NewGuid(), FirstName = "asda", LastName = "SdSDS"
                    });
                }

                for (int i = 0; i < 5; ++i)
                {
                    organisationRepo.Add(new Organization()
                    {
                        Id = Guid.NewGuid(), Name = "dasxx", Description = "trololololoool"
                    });
                }
            }


            using (var dbCtx3 = new DbEntities())
            {
                //var userRepo = new UserRepository<User>(dbCtx3);
                //var organisationRepo = new OrganizationRepository<Organization>(dbCtx3);

                foreach (var user in dbCtx3.Users)
                {
                    Console.WriteLine(user.FirstName + " " + user.LastName);
                }

                foreach (var org in dbCtx3.Organizations)
                {
                    Console.WriteLine(org.Name + " " + org.Description);
                }

                var lazyQuary = dbCtx3.Organizations;

                foreach (var item in lazyQuary)
                {
                    Console.WriteLine($"{item.Name} has {item.AssignedUsers.Count} Assigned");
                }

                var eagerQuary = dbCtx3.Organizations.Include("AssignedUsers");

                foreach (var item in eagerQuary)
                {
                    Console.WriteLine($"{item.Name} has {item.AssignedUsers.Count} Assigned");
                }

                var explicitQuary = dbCtx3.Organizations.Include("AssignedUsers");

                foreach (var item in explicitQuary)
                {
                    var users = dbCtx3.Entry(item).Collection(c => c.AssignedUsers);
                    if (!users.IsLoaded)
                    {
                        users.Load();
                    }
                    Console.WriteLine($"{item.Name} has {item.AssignedUsers.Count} Assigned");
                }
                Console.ReadLine();
            }
        }
 public CustomerManager()
 {
     custumerRepository = new CustomerRepository();
 }
 public EditModel(CustomerRepository customerRepository)
 {
     _customerRepository = customerRepository;
 }
 public CustomerServices(CustomerRepository customerRepository)
 {
     this.customerRepository = customerRepository;
 }
Example #35
0
 public CustomerController(CustomerRepository customerRepo)
 {
     _customerRepo = customerRepo;
 }
 public void BeforeEach()
 {
     _customerRepository = new CustomerRepository(MainContext);
 }
 public CustomerController(IConfiguration configuration)
 {
     customerRepository = new CustomerRepository(configuration);
 }
        public Customer GetCustomerByCustomerId(int customerId)
        {
            var customerRepository = new CustomerRepository();

            return(customerRepository.GetCustomerBy(customerId));
        }
Example #39
0
 public FrmPrincipal()
 {
     InitializeComponent();
     this.customerRepository = new CustomerRepository();
 }
Example #40
0
 public CustomerController()
 {
     _repository = new CustomerRepository(new WebAppContext());
 }
Example #41
0
        public override async Task UpdateWorksAsync()
        {
            int         id = 0;
            Reservation reservationSaved = null;
            Customer    customerSaved    = null;
            Room        roomSaved        = null;

            var options = new DbContextOptionsBuilder <Project15Context>()
                          .UseInMemoryDatabase("db_reservation_test_getById").Options;

            using (var db = new Project15Context(options));

            // act (for act, only use the repo, to test it)
            using (var db = new Project15Context(options))
            {
                var repo         = new ReservationRepository(db);
                var customerRepo = new CustomerRepository(db);
                var roomRepo     = new RoomRepository(db);

                //Create customer
                Customer customer = new Customer {
                    Name = "Axel", Address1 = "111 Address"
                };
                customer = await customerRepo.CreateAsync(customer);

                await customerRepo.SaveChangesAsync();

                // Create room
                Room room = new Room {
                    Beds = 1, Cost = 50, RoomType = "Standard"
                };
                room = await roomRepo.CreateAsync(room);

                await roomRepo.SaveChangesAsync();

                // Create reservation
                Reservation eventCustomer = new Reservation
                {
                    CustomerId = customer.Id,
                    RoomId     = room.Id,
                    Paid       = true
                };
                reservationSaved = await repo.CreateAsync(eventCustomer);

                await repo.SaveChangesAsync();

                customerSaved = customer;
                roomSaved     = room;
                id            = reservationSaved.Id;
            }
            using (var db = new Project15Context(options))
            {
                var         repo        = new ReservationRepository(db);
                Reservation reservation = await repo.GetByIdAsync(id);

                Assert.NotEqual(0, reservation.Id);
                Assert.Equal(customerSaved.Id, reservation.CustomerId);
                Assert.Equal(roomSaved.Id, reservation.RoomId);
                Assert.True(reservation.Paid);

                reservation.Paid = false;

                await repo.UpdateAsync(reservation, id);

                Assert.False(reservation.Paid);
            }
        }
Example #42
0
        public override async Task GetAllWorksAsync()
        {
            List <Reservation> reservationList  = new List <Reservation>();
            Reservation        reservationSaved = null;
            Customer           customerSaved    = null;
            Room roomSaved = null;

            var options = new DbContextOptionsBuilder <Project15Context>()
                          .UseInMemoryDatabase("db_reservation_test_getall").Options;

            using (var db = new Project15Context(options));

            using (var db = new Project15Context(options))
            {
                var repo         = new ReservationRepository(db);
                var customerRepo = new CustomerRepository(db);
                var roomRepo     = new RoomRepository(db);

                //Create customer
                Customer customer = new Customer {
                    Name = "Axel", Address1 = "111 Address"
                };
                customer = await customerRepo.CreateAsync(customer);

                await customerRepo.SaveChangesAsync();

                // Create room
                Room room = new Room {
                    Beds = 1, Cost = 50, RoomType = "Standard"
                };
                room = await roomRepo.CreateAsync(room);

                await roomRepo.SaveChangesAsync();

                for (int i = 0; i < 5; i++)
                {
                    Reservation reservation = new Reservation
                    {
                        CustomerId = customer.Id,
                        RoomId     = room.Id,
                    };
                    reservationSaved = await repo.CreateAsync(reservation);

                    await repo.SaveChangesAsync();

                    reservationList.Add(reservationSaved);
                }

                roomSaved     = room;
                customerSaved = customer;
            }
            using (var db = new Project15Context(options))
            {
                var repo = new ReservationRepository(db);
                List <Reservation> list = (List <Reservation>) await repo.GetAllAsync();

                Assert.Equal(reservationList.Count, list.Count);

                for (int i = 0; i < 5; i++)
                {
                    Assert.Equal(reservationList[i].CustomerId, list[i].CustomerId);
                    Assert.Equal(reservationList[i].RoomId, list[i].RoomId);
                    Assert.NotEqual(0, list[i].Id);
                }
            }
        }
Example #43
0
        public ECommerceUnitTests()
        {
            int.TryParse(ConfigurationManager.AppSettings["TwoFactorAuthTimeSpan"], out _twoFactorAuthTimeSpan);
            int.TryParse(ConfigurationManager.AppSettings["TwoFactorTimeOut"], out _twoFactorTimeOut);
            bool.TryParse(ConfigurationManager.AppSettings["TwoFactorEnabled"], out _twoFactorEnabled);
            _twoFactorAuthCookie    = ConfigurationManager.AppSettings["TwoFactorAuthCookie"];
            _twoFactorAuthSmtpHost  = ConfigurationManager.AppSettings["TwoFactorAuthSmtpHost"];
            _twoFactorAuthFromEmail = ConfigurationManager.AppSettings["TwoFactorAuthFromEmail"];
            _twoFactorAuthFromPhone = ConfigurationManager.AppSettings["TwoFactorAuthFromPhone"];
            _emailPassword          = ConfigurationManager.AppSettings["EmailPassword"];
            _authToken  = ConfigurationManager.AppSettings["TwilioAuthToken"];
            _accountSID = ConfigurationManager.AppSettings["TwilioAccountSID"];

            //Get payfabric configs
            _payfabricDeviceId       = ConfigurationManager.AppSettings["PayfabricDeviceId"];
            _payfabricDevicePassword = ConfigurationManager.AppSettings["PayfabricDevicePassword"];
            _payfabricDeviceUrl      = ConfigurationManager.AppSettings["PayfabricDeviceUrl"];


            var smsConfigs = new InitTwoFactor()
            {
                TwoFactorAuthTimeSpan  = _twoFactorAuthTimeSpan,
                TwoFactorAuthCookie    = _twoFactorAuthCookie,
                TwoFactorAuthSmtpHost  = _twoFactorAuthSmtpHost,
                TwoFactorAuthFromEmail = _twoFactorAuthFromEmail,
                TwoFactorAuthFromPhone = _twoFactorAuthFromPhone,
                AuthToken        = _authToken,
                AccountSID       = _accountSID,
                TwoFactorEnabled = _twoFactorEnabled,
                EmailPassword    = _emailPassword
            };

            _twoFactorAuth = new TwoFactorAuth(smsConfigs);

            //repositories
            var catalogSettings        = new CatalogSettings();
            var commonSettings         = new CommonSettings();
            var categoryRepository     = new CategoryRepository(connectionString);
            var productRepository      = new ProductRepository(connectionString);
            var productCategory        = new ProductCategoryMappingRepository(connectionString);
            var shoppingCartRepository = new ShoppingCartItemRepository(connectionString);

            var _pictureBinaryRepository = new PictureBinaryRepository(connectionString);
            var _pictureRepository       = new PictureRepository(connectionString);
            var _productAttributeCombinationRepository          = new ProductAttributeCombinationRepository(connectionString);
            var _productAttributeRepository                     = new ProductAttributeRepository(connectionString);
            var _productAttributeValueRepository                = new ProductAttributeValueRepository(connectionString);
            var _productAvailabilityRangeRepository             = new ProductAvailabilityRangeRepository(connectionString);
            var _productCategoryMappingRepository               = new ProductCategoryMappingRepository(connectionString);
            var _productProductAttributeMappingRepository       = new ProductProductAttributeMappingRepository(connectionString);
            var _productProductTagMappingRepository             = new ProductTagMappingRepository(connectionString);
            var _productSpecificationAttributeMappingRepository = new ProductSpecificationAttributeRepository(connectionString);
            var _specificationAttributeOptionRepository         = new SpecificationAttributeOptionRepository(connectionString);
            var _specificationAttributeRepository               = new SpecificationAttributeRepository(connectionString);
            var _productRepository = new ProductRepository(connectionString);
            var _productManufacturerMappingRepository = new ProductManufacturerMappingRepository(connectionString);
            var _productPictureRepository             = new ProductPictureRepository(connectionString);
            var _productReviewsRepository             = new ProductReviewsRepository(connectionString);
            var _tierPricesRepository                = new TierPricesRepository(connectionString);
            var _discountProductMappingRepository    = new DiscountProductMappingRepository(connectionString);
            var _productWarehouseInventoryRepository = new ProductWarehouseInventoryRepository(connectionString);
            var _customerRepository = new CustomerRepository(connectionString);

            //services
            _categoryService = new CategoryService(catalogSettings, commonSettings, categoryRepository, productRepository, productCategory);

            _menuService    = new MenuService(_categoryService);
            _cartService    = new CartService(commonSettings, shoppingCartRepository);
            _productService = new ProductService(
                _pictureBinaryRepository,
                _pictureRepository,
                _productAttributeCombinationRepository,
                _productAttributeRepository,
                _productAttributeValueRepository,
                _productAvailabilityRangeRepository,
                _productCategoryMappingRepository,
                _productProductAttributeMappingRepository,
                _productProductTagMappingRepository,
                _productSpecificationAttributeMappingRepository,
                _specificationAttributeOptionRepository,
                _specificationAttributeRepository,
                _productRepository,
                _productManufacturerMappingRepository,
                _productPictureRepository,
                _productReviewsRepository,
                _tierPricesRepository,
                _discountProductMappingRepository,
                _productWarehouseInventoryRepository
                );
            _customerService = new CustomerService(_customerRepository);
        }
 public AddCustomerViewModel()
 {
     CustomerList       = new BindingList <Customer>();
     CustomerListToShow = new BindingList <Customer>();
     repository         = new CustomerRepository();
 }
Example #45
0
 public CustomerController(UnitOfWork unitOfWork, IEmailGateway emailGateway)
     : base(unitOfWork)
 {
     _customerRepository = new CustomerRepository(unitOfWork);
     _emailGateway       = emailGateway;
 }
Example #46
0
 //test deneme
 public CustomerController(CustomerRepository CustomerRepository) : base(CustomerRepository)
 {
 }
Example #47
0
 public CustomerService()
 {
     _customerRepository = new CustomerRepository();
 }
Example #48
0
 public UserController(DbContextOptions <OurGamesContext> contextOptions)
 {
     _userRepository = new CustomerRepository(contextOptions);
 }
Example #49
0
 public CustomerController()
 {
     _customerRepository = new CustomerRepository();
 }
Example #50
0
        public CustomerController(IEmailGateway emailGateway)

        {
            _customerRepository = new CustomerRepository();
            _emailGateway       = emailGateway;
        }
Example #51
0
 public CustomerOrderController(CustomerRepository customerRepository, OrderRepository orderRepository)
 {
     _customerRepository = customerRepository;
     _orderRepository    = orderRepository;
 }
Example #52
0
 public HomeController()
 {
     repoBike     = new MotorcycleRepository();
     repoCustomer = new CustomerRepository();
     repoPurchase = new PurchaseRepository();
 }
Example #53
0
 public Customer LoadCustomer(int customerId)
 {
     return(CustomerRepository.Load(customerId));
 }
Example #54
0
 public DeliveryAddrService()
 {
     _deliveryAddrRepository = new DeliveryAddressRepository();
     _customerRepository     = new CustomerRepository();
 }
Example #55
0
        // GET: Customers
        public ActionResult Index()
        {
            var customerRepository = new CustomerRepository();

            return(View(customerRepository.GetAllCustomers()));
        }
Example #56
0
        private Core.Users.Domain.Customer GetCustomerDetail()
        {
            ICustomerRepository customerRepository = new CustomerRepository();

            return(customerRepository.GetCustomer(CustomerId));
        }
Example #57
0
 public CustomersController(IConfiguration configuration)
 {
     repo = new CustomerRepository(configuration);
 }
Example #58
0
 /// <summary>
 /// Handles the DataTablesRequest for the Customer Database
 /// </summary>
 /// <param name="request">DataTables Ajax Request</param>
 /// <returns>DataTablesResponse for Customer table</returns>
 /// <remarks>
 /// When intergration with projects without Data.Repository classes, the
 /// base SQL query may be hard-coded here when making the call to the generic
 /// DataTablesRequestAsync() method.
 /// </remarks>
 public static async Task <DataTablesResponse <Customer> > DataTablesCustomerRequestAsync(DataTablesRequest request)
 {
     return(await DataTablesRequestAsync <Customer>(request, CustomerRepository.BaseQuery()));
 }
Example #59
0
 public UserController(UserRepository userRepository, IMapper mapper,
                       UserService userService, CompanyRepository companyRepository, CustomerRepository customerRepository)
 {
     _userRepository     = userRepository;
     _mapper             = mapper;
     _userService        = userService;
     _companyRepository  = companyRepository;
     _customerRepository = customerRepository;
 }
Example #60
0
        public static IEnumerable <Customer> GetCustomers()
        {
            var repo = new CustomerRepository();

            return(repo.Get());
        }