Пример #1
0
 public CustomersWindow(ICustomerRepository customerRepository,
                        ICustomerValidator customerValidator,
                        ICityRepository cityRepository,
                        IWindowDialogService windowDialogService)
 {
     InitializeComponent();
 }
Пример #2
0
 public CustomerRepository(ICustomerValidator customerValidator, CustomerVal customerVal)
 {
     _allCustomers       = new List <ICusnew>();
     MartinJones         = 60;
     _customerValidator  = customerValidator;
     _customerValidator2 = customerVal;
 }
Пример #3
0
 public CustomerService(ICompanyRepository companyRepository, ICustomerCreditContext customerCreditContext, ICustomerDataAccessFacade customerDataAccessFacade, ICustomerValidator customerValidator)
 {
     _companyRepository        = companyRepository;
     _customerCreditContext    = customerCreditContext;
     _customerDataAccessFacade = customerDataAccessFacade;
     _customerValidator        = customerValidator;
 }
 public CustomerCreateViewModel()
 {
     //This is a concrete implementation which some may have an issue with here.
     //If you are a DI purist, then you will need to declare a custom model validator to be injected
     //    public class CustomModelValidator : AssociatedValidatorProvider
     //See my demos on completedevelopment.blogspot.com
     _validator = new CustomerValidator();
 }
Пример #5
0
 public CustomerService(
     IUOW UOW,
     ICustomerValidator CustomerValidator
     )
 {
     this.UOW = UOW;
     this.CustomerValidator = CustomerValidator;
 }
Пример #6
0
        public CustomerService()
        {
            ICustomerCreditServiceClient customerCreditServiceClient = new CustomerCreditServiceClient();

            _customerDataAccessFacade = new CustomerDataAccessFacade();
            _customerValidator        = new CustomerValidator();
            _companyRepository        = new CompanyRepository();
            _customerCreditContext    = new CustomerCreditContext(customerCreditServiceClient);
        }
 public void Initialize()
 {
     _dbContext = new EntityContext();
     _validator = new CustomerValidator();
     //AlwaysRecreateDatabase
     //CreateDatabaseOnlyIfNotExists
     //RecreateDatabaseIfModelChanges
     Database.SetInitializer(new CreateDatabaseIfNotExists <EntityContext>());
 }
Пример #8
0
 public CustomersService(
     ICustomersRepository customersRepository,
     IUnitOfWork unitOfWork,
     ICustomerValidator validator)
 {
     _customersRepository = customersRepository;
     _unitOfWork          = unitOfWork;
     _validator           = validator;
 }
 public void Initialize()
 {
     _dbContext = new EntityContext();
     _validator= new CustomerValidator();
     //AlwaysRecreateDatabase
     //CreateDatabaseOnlyIfNotExists
     //RecreateDatabaseIfModelChanges
     Database.SetInitializer(new CreateDatabaseIfNotExists<EntityContext>());
 }
 public CustomerService(ICustomerRepository customerRepository,
                        [Internal] ICustomerValidator customerValidator,
                        IStorage storage,
                        ILogger logger)
 {
     _customerRepository = customerRepository ?? throw new ArgumentNullException(nameof(customerRepository));
     _customerValidator  = customerValidator ?? throw new ArgumentNullException(nameof(customerValidator));
     _storage            = storage ?? throw new ArgumentNullException(nameof(storage));
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Пример #11
0
        public CustomersBusinessService(ICustomersRepository customersRepository,
                                        ICustomerValidator <string> customerValidator)
        {
            if (customersRepository == default(ICustomersRepository))
            {
                throw new ArgumentException(INVALID_CUSTOMERS_REPOSITORY);
            }

            this.customersRepository = customersRepository;
            this.customerValidator   = customerValidator;
        }
Пример #12
0
 public CustomerService(
     IUOW UOW,
     ICurrentContext CurrentContext,
     ICustomerValidator CustomerValidator,
     ILogging Logging
     )
 {
     this.UOW               = UOW;
     this.Logging           = Logging;
     this.CurrentContext    = CurrentContext;
     this.CustomerValidator = CustomerValidator;
 }
 public CommerceManager(IStoreRepository storeRepository,
                        IConfigurationProviderFactory configFactory,
                        ICustomerValidator customerValidator,
                        ILogger logger)
 {
     _storeRepository   = storeRepository;
     _paymentProcessor  = configFactory.GetPaymentProcessor();
     _customerNotifier  = configFactory.GetCustomerNotifier();
     _events            = configFactory.GetEvents();
     _customerValidator = customerValidator;
     _logger            = logger;
 }
Пример #14
0
        public CustomerServiceFake()
        {
            this._validator = new CustomerValidator();

            this._customers = new List <Customer> {
                new Customer()
                {
                    Id               = "5c7432b01d39ea2b383e6ac3",
                    Name             = "Pessoa A",
                    Birthday         = DateTime.Now.AddYears(-33),
                    DocumentId       = "32.365.778-4",
                    SocialSecurityId = "334.457.685-40",
                    Phones           = new CustomerPhone[] {
                        new CustomerPhone("(+5511) 99999-9999", PhoneType.CellPhone),
                        new CustomerPhone("(+5511) 5555-5555", PhoneType.Residential),
                    },
                    Addresses = new CustomerAddress[] {
                        new CustomerAddress("Rua A", AddressType.Commercial),
                        new CustomerAddress("Rua B", AddressType.Residential),
                    },
                    Facebook    = "https://fb.com/pessoa-a",
                    LinkedIn    = "https://linkedin.com/in/pessoa-a",
                    Twitter     = "https://twitter.com/pessoa-a",
                    Instagram   = "https://instagram.com/pessoa-a",
                    DateCreated = DateTime.Now
                },
                new Customer()
                {
                    Id               = "6c8972b01d39ea2b383e6ab5",
                    Name             = "Pessoa B",
                    Birthday         = DateTime.Now.AddYears(-15),
                    DocumentId       = "25.233.978-3",
                    SocialSecurityId = "451.339.254-20",
                    Phones           = new CustomerPhone[] {
                        new CustomerPhone("(+5511) 98888-8888", PhoneType.CellPhone),
                        new CustomerPhone("(+5511) 5555-5555", PhoneType.Residential),
                    },
                    Addresses = new CustomerAddress[] {
                        new CustomerAddress("Avenida C", AddressType.Commercial),
                        new CustomerAddress("Alameda D", AddressType.Residential),
                    },
                    Facebook    = "https://fb.com/pessoa-b",
                    LinkedIn    = "https://linkedin.com/in/pessoa-b",
                    Twitter     = "https://twitter.com/pessoa-b",
                    Instagram   = "https://instagram.com/pessoa-b",
                    DateCreated = DateTime.Now.AddDays(-5),
                    DateUpdated = DateTime.Now.AddHours(-8)
                }
            };
        }
        public ProductSearchService(IAsyncRepository <Customer> customerRepo, IAsyncRepository <Product> productRepo,
                                    IAsyncRepository <Request> requestRepo,
                                    ICustomerValidator customerValidator, IProductResultsValidator productResultsValidator,
                                    ICustomerDetailsFormatter customerDetailsFormatter)
        {
            this._customerRepo = customerRepo;
            this._productRepo  = productRepo;
            this._requestRepo  = requestRepo;

            this._customerValidator       = customerValidator;
            this._productResultsValidator = productResultsValidator;

            this._customerDetailsFormatter = customerDetailsFormatter;
        }
Пример #16
0
        public OrderProductService(
            IDateService dateService,
            IProductFactory productFactory,
            IProductRepository productRepository,
            IProductModelRepository productModelRepository,
            ICustomerRepository customerRepository,
            IBasketRepository basketRepository,
            IShippingAddressFactory shippingAddressFactory,
            ICustomerFactory customerFactory,
            ICustomerValidator customerValidator)
        {
            dateService.CheckArgumentIsNull(nameof(dateService));
            _dateService = dateService;

            productFactory.CheckArgumentIsNull(nameof(productFactory));
            _productFactory = productFactory;

            productRepository.CheckArgumentIsNull(nameof(productRepository));
            _productRepository = productRepository;

            productModelRepository.CheckArgumentIsNull(nameof(productModelRepository));
            _productModelRepository = productModelRepository;

            customerRepository.CheckArgumentIsNull(nameof(customerRepository));
            _customerRepository = customerRepository;

            basketRepository.CheckArgumentIsNull(nameof(basketRepository));
            _basketRepository = basketRepository;

            shippingAddressFactory.CheckArgumentIsNull(nameof(shippingAddressFactory));
            _shippingAddressFactory = shippingAddressFactory;

            customerFactory.CheckArgumentIsNull(nameof(customerFactory));
            _customerFactory = customerFactory;

            customerValidator.CheckArgumentIsNull(nameof(customerValidator));
            _customerValidator = customerValidator;
        }
        public CustomerRepository(ICustomerValidator customerValidator)
        {
            _allCustomers = new List <ICustomer>();

            _customerValidator = customerValidator;
        }
Пример #18
0
 public WorkflowManager(ICustomerValidator validator, INotificationSender sender)
 {
     _notificationSender = sender;
     _customerValidator  = validator;
 }
Пример #19
0
 public CustomerService(ICustomerRepository _customerRepository, ICustomerValidator _customerValidator)
 {
     _repository = _customerRepository;
     _validator = _customerValidator;
 }
 public CustomerCreateViewModel(ICustomerValidator validator)
 {
     _validator = validator;
 }
 public CustomersBusinessComponent(
     ICustomersRepository customersRepository, ICustomerValidator customerValidator)
 {
     this.customersRepository = customersRepository;
     this.customerValidator   = customerValidator;
 }
 public CustomerRepository(ICustomerValidator customerValidator)
 {
     validator = customerValidator;
 }
Пример #23
0
 public AplicCustomer(DataContext context, ICustomerValidator customerValidator, ICustomerMapper customerMapper) : base(context)
 {
     _customerValidator = customerValidator;
     _customerMapper    = customerMapper;
 }
Пример #24
0
        public RegisterViewModel(
            IODataClient oDataClient,
            ICustomerValidator customerValidator,
            IPageDialogService pageDialogService,
            ISecurityService securityService,
            ISanaapAppTranslateService translateService,
            IUserDialogs userDialogs)
        {
            Register = new BitDelegateCommand(async() =>
            {
                registerCancellationTokenSource?.Cancel();
                registerCancellationTokenSource = new CancellationTokenSource();

                using (userDialogs.Loading(ConstantStrings.Loading, cancelText: ConstantStrings.Loading_Cancel, onCancel: registerCancellationTokenSource.Cancel))
                {
                    if (!customerValidator.IsValid(Customer, out string errorMessage))
                    {
                        await pageDialogService.DisplayAlertAsync("", translateService.Translate(errorMessage), "باشه");
                        return;
                    }

                    try
                    {
                        Customer = await oDataClient.For <CustomerDto>("Customers")
                                   .Action("RegisterCustomer")
                                   .Set(new
                        {
                            customer = Customer
                        })
                                   .ExecuteAsSingleAsync(registerCancellationTokenSource.Token);

                        IsEnterDataVisible = false;

                        IsVerifySectionVisible = true;

                        startVerifyTimer();
                    }
                    catch (Exception ex)
                    {
                        if (translateService.Translate(ex.GetMessage(), out string translateErrorMessage))
                        {
                            await pageDialogService.DisplayAlertAsync("", translateErrorMessage, "باشه");
                        }
                        else
                        {
                            throw;
                        }
                    }
                }
            });

            SendVerificationCodeAgain = new BitDelegateCommand(async() =>
            {
                registerCancellationTokenSource?.Cancel();
                registerCancellationTokenSource = new CancellationTokenSource();

                using (userDialogs.Loading(ConstantStrings.Loading, cancelText: ConstantStrings.Loading_Cancel, onCancel: registerCancellationTokenSource.Cancel))
                {
                    try
                    {
                        Customer = await oDataClient.For <CustomerDto>("Customers")
                                   .Action("SendVerificationCodeAgain")
                                   .Set(new
                        {
                            customer = Customer
                        })
                                   .ExecuteAsSingleAsync(registerCancellationTokenSource.Token);

                        startVerifyTimer();
                    }
                    catch (Exception ex)
                    {
                        if (translateService.Translate(ex.GetMessage(), out string translateErrorMessage))
                        {
                            await pageDialogService.DisplayAlertAsync("", translateErrorMessage, "باشه");
                        }
                        else
                        {
                            throw;
                        }
                    }
                }
            }, () => TimerValue == 0);

            SendVerificationCodeAgain.ObservesProperty(() => TimerValue);

            VerifyCode = new BitDelegateCommand(async() =>
            {
                if (VerificationCode == Customer.VerifyCode)
                {
                    IsVerifySectionVisible = false;

                    await securityService.LoginWithCredentials(Customer.NationalCode, Customer.Mobile, "SanaapResOwner", "secret", cancellationToken: registerCancellationTokenSource.Token);

                    await NavigationService.NavigateAsync($"/{nameof(NavigationPage)}/{nameof(MainMenuView)}");
                }
                else
                {
                    await pageDialogService.DisplayAlertAsync(ConstantStrings.Error, ConstantStrings.InvalidVerifyCode, ConstantStrings.Ok);

                    VerificationCode = string.Empty;
                }
            });
        }
Пример #25
0
 public CustomerService(ICustomerQuery customerQuery, ICustomerRepository customerRepository, ICustomerValidator customerValidator)
 {
     _customerQuery      = customerQuery;
     _customerRepository = customerRepository;
     _customerValidator  = customerValidator;
 }
Пример #26
0
 public CustomerService(ICustomerRepository customerRepository, IUnitOfWork unitOfWork, ICustomerValidator customerValidator)
 {
     _customerRepository = customerRepository;
     _unitOfWork         = unitOfWork;
     _customerValidator  = customerValidator;
 }
Пример #27
0
 public CustomerService(ICustomerRepository customerRepository, ICustomerValidator customerValidator)
 {
     _customerRepository = customerRepository ?? throw new ArgumentNullException(nameof(customerRepository));
     _customerValidator  = customerValidator ?? throw new ArgumentNullException(nameof(customerValidator));
 }
 public CustomerCreateViewModel(ICustomerValidator validator)
 {
     _validator = validator;
 }
 public CustomerService(ICustomerValidator customerValidator, ICreditCheck creditCheck, ICustomerRepository customerRepository)
 {
     _Validator = customerValidator;
     _CreditCheck = creditCheck;
     _Repository = customerRepository;
 }