Esempio n. 1
0
        public void TestFixtureSetUp()
        {
            try
            {
                CodeSharp.Core.Configuration.ConfigWithEmbeddedXml(null
                    , "application_config"
                    , Assembly.GetExecutingAssembly()
                    , "Cooper.Model.Test.ConfigFiles")
                    .RenderProperties()
                    .Castle(o => this.Resolve(o.Container));

                //初始化同步锁
                DependencyResolver.Resolve<ILockHelper>().Init<Account>();
                DependencyResolver.Resolve<ILockHelper>().Init<GoogleConnection>();
                DependencyResolver.Resolve<ILockHelper>().Init<GitHubConnection>();
            }
            catch (Exception e)
            {
                if (!e.Message.Contains("不可重复初始化配置"))
                    Console.WriteLine(e.Message);
            }

            this._log = DependencyResolver.Resolve<ILoggerFactory>().Create(this.GetType());
            this._sessionManager = DependencyResolver.Resolve<Castle.Facilities.NHibernateIntegration.ISessionManager>();

            this._accountHelper = DependencyResolver.Resolve<IAccountHelper>();
            this._accountService = DependencyResolver.Resolve<IAccountService>();
            this._accountConnectionService = DependencyResolver.Resolve<IAccountConnectionService>();
            this._taskService = DependencyResolver.Resolve<ITaskService>();
            this._tasklistService = DependencyResolver.Resolve<ITasklistService>();
            this._addressBookService = DependencyResolver.Resolve<IAddressBookService>();
            this._contactGroupService = DependencyResolver.Resolve<IContactGroupService>();
            this._contactService = DependencyResolver.Resolve<IContactService>();
        }
Esempio n. 2
0
 public CartService(
     IProductService productService,
     IPricingService pricingService,
     IOrderGroupFactory orderGroupFactory,
     CustomerContextFacade customerContext,
     IPlacedPriceProcessor placedPriceProcessor,
     IInventoryProcessor inventoryProcessor,
     ILineItemValidator lineItemValidator,
     IOrderRepository orderRepository,
     IPromotionEngine promotionEngine,
     IAddressBookService addressBookService,
     ICurrentMarket currentMarket,
     ICurrencyService currencyService,
     ReferenceConverter referenceConverter,
     IContentLoader contentLoader,
     IRelationRepository relationRepository)
 {
     _productService       = productService;
     _pricingService       = pricingService;
     _orderGroupFactory    = orderGroupFactory;
     _customerContext      = customerContext;
     _placedPriceProcessor = placedPriceProcessor;
     _inventoryProcessor   = inventoryProcessor;
     _lineItemValidator    = lineItemValidator;
     _promotionEngine      = promotionEngine;
     _orderRepository      = orderRepository;
     _addressBookService   = addressBookService;
     _currentMarket        = currentMarket;
     _currencyService      = currencyService;
     _referenceConverter   = referenceConverter;
     _contentLoader        = contentLoader;
     _relationRepository   = relationRepository;
 }
Esempio n. 3
0
 public CartService(
     IProductService productService,
     IPricingService pricingService,
     IOrderFactory orderFactory,
     CustomerContextFacade customerContext,
     IPlacedPriceProcessor placedPriceProcessor,
     IInventoryProcessor inventoryProcessor,
     ILineItemValidator lineItemValidator,
     IOrderRepository orderRepository,
     IPromotionEngine promotionEngine,
     IAddressBookService addressBookService,
     ICurrentMarket currentMarket,
     ICurrencyService currencyService)
 {
     _productService = productService;
     _pricingService = pricingService;
     _orderFactory = orderFactory;
     _customerContext = customerContext;
     _placedPriceProcessor = placedPriceProcessor;
     _inventoryProcessor = inventoryProcessor;
     _lineItemValidator = lineItemValidator;
     _promotionEngine = promotionEngine;
     _orderRepository = orderRepository;
     _addressBookService = addressBookService;
     _currentMarket = currentMarket;
     _currencyService = currencyService;
 }
 public CheckoutController(
     ICurrencyService currencyService,
     ControllerExceptionHandler controllerExceptionHandler,
     IOrderRepository orderRepository,
     CheckoutViewModelFactory checkoutViewModelFactory,
     ICartService cartService,
     OrderSummaryViewModelFactory orderSummaryViewModelFactory,
     IRecommendationService recommendationService,
     CheckoutService checkoutService,
     OrderValidationService orderValidationService,
     IDatabaseMode databaseMode,
     SecureAcceptanceSecurity secureAcceptanceSecurity,
     IAddressBookService addressBookService)
 {
     _currencyService            = currencyService;
     _controllerExceptionHandler = controllerExceptionHandler;
     _orderRepository            = orderRepository;
     _checkoutViewModelFactory   = checkoutViewModelFactory;
     _cartService = cartService;
     _orderSummaryViewModelFactory = orderSummaryViewModelFactory;
     _recommendationService        = recommendationService;
     _checkoutService          = checkoutService;
     _orderValidationService   = orderValidationService;
     _databaseMode             = databaseMode;
     _secureAcceptanceSecurity = secureAcceptanceSecurity;
     _addressBookService       = addressBookService;
 }
 public CheckoutController(
     ICartService cartService,
     IContentRepository contentRepository,
     UrlResolver urlResolver,
     IMailService mailService,
     ICheckoutService checkoutService,
     IContentLoader contentLoader,
     IPaymentService paymentService,
     LocalizationService localizationService,
     Func <string, CartHelper> cartHelper,
     CurrencyService currencyService,
     IAddressBookService addressBookService,
     ControllerExceptionHandler controllerExceptionHandler,
     CustomerContextFacade customerContextFacade)
 {
     _cartService                = cartService;
     _contentRepository          = contentRepository;
     _urlResolver                = urlResolver;
     _mailService                = mailService;
     _checkoutService            = checkoutService;
     _paymentService             = paymentService;
     _contentLoader              = contentLoader;
     _localizationService        = localizationService;
     _cartHelper                 = cartHelper;
     _currencyService            = currencyService;
     _addressBookService         = addressBookService;
     _controllerExceptionHandler = controllerExceptionHandler;
     _customerContext            = customerContextFacade;
 }
Esempio n. 6
0
 public NewEmailController(IMessageService messageService, IShellService shellService, IAddressBookService addressBookService, NewEmailViewModel newEmailViewModel)
 {
     this.messageService = messageService;
     this.shellService = shellService;
     this.addressBookService = addressBookService;
     this.NewEmailViewModel = newEmailViewModel;
     this.selectContactCommand = new DelegateCommand(SelectContact);
     this.sendCommand = new DelegateCommand(SendEmail);
 }
Esempio n. 7
0
 //public WorkflowDataResponse CreateWorkflow(WorkflowDataRequest workflowData)
 //{
 //}
 public WorkflowService(ApplicationDbContext applicationDbContext,
                        IAddressBookService addressBookService,
                        IEntityValidationService entityValidationService)
 {
     this.context                 = applicationDbContext;
     this.addressBookService      = addressBookService;
     this.entityValidationService = entityValidationService;
     this.optionsBuilder          = new DbContextOptionsBuilder <ApplicationDbContext>();
     this.optionsBuilder.EnableSensitiveDataLogging(true);
 }
        protected override void OnInit(EventArgs e)
        {
            // IContainerAccessor 
            accessor = Context.ApplicationInstance as IContainerAccessor;

            if (accessor == null || accessor.Container == null)
                throw new InvalidOperationException("Castle not configured properly");

            svcAdddress = accessor.Container.Resolve<IAddressBookService>();

            // get around dynamic control issues...set the controls HERE before the postback stuff
            // check below as to get into the viewstate in tact.
            // credit: http://codebetter.com/jefferypalermo/2004/11/25/key-to-ensuring-dynamic-asp-net-controls-save-viewstate-level-300/
            LoadAddressUC();
        }
 public MultiShipmentViewModelFactory(
     LocalizationService localizationService,
     IAddressBookService addressBookService,
     IContentLoader contentLoader,
     UrlResolver urlResolver,
     ServiceAccessor<HttpContextBase> httpContextAccessor,
     ShipmentViewModelFactory shipmentViewModelFactory)
 {
     _localizationService = localizationService;
     _addressBookService = addressBookService;
     _contentLoader = contentLoader;
     _urlResolver = urlResolver;
     _httpContextAccessor = httpContextAccessor;
     _shipmentViewModelFactory = shipmentViewModelFactory;
 }
 public CheckoutViewModelFactory(
     LocalizationService localizationService,
     PaymentMethodViewModelFactory paymentMethodViewModelFactory,
     IAddressBookService addressBookService,
     IContentLoader contentLoader,
     IOrderFactory orderFactory,
     UrlResolver urlResolver,
     ServiceAccessor<HttpContextBase> httpContextAccessor,
     ShipmentViewModelFactory shipmentViewModelFactory)
 {
     _localizationService = localizationService;
     _paymentMethodViewModelFactory = paymentMethodViewModelFactory;
     _addressBookService = addressBookService;
     _contentLoader = contentLoader;
     _orderFactory = orderFactory;
     _urlResolver = urlResolver;
     _httpContextAccessor = httpContextAccessor;
     _shipmentViewModelFactory = shipmentViewModelFactory;
 }
 public ShipmentViewModelFactory(
     IContentLoader contentLoader,
     ShippingManagerFacade shippingManagerFacade,
     LanguageService languageService,
     ReferenceConverter referenceConverter,
     IAddressBookService addressBookService,
     CartItemViewModelFactory cartItemViewModelFactory,
     Func<CultureInfo> preferredCulture,
     IRelationRepository relationRepository)
 {
     _contentLoader = contentLoader;
     _shippingManagerFacade = shippingManagerFacade;
     _languageService = languageService;
     _referenceConverter = referenceConverter;
     _addressBookService = addressBookService;
     _cartItemViewModelFactory = cartItemViewModelFactory;
     _relationRepository = relationRepository;
     _preferredCulture = preferredCulture();
 }
 public AddressBookControllerForTest(IContentLoader contentLoader, IAddressBookService addressBookService, LocalizationService localizationService, ControllerExceptionHandler controllerExceptionHandler)
     : base(contentLoader, addressBookService, localizationService, controllerExceptionHandler)
 {
 }
Esempio n. 13
0
 public LoginControllerForTest(ApplicationSignInManager signInManager, ApplicationUserManager userManager, UserService userService, LocalizationService localizationService, IContentLoader contentLoader, IAddressBookService addressBookService, ControllerExceptionHandler controllerExceptionHandler)
     : base(signInManager, userManager, userService, localizationService, contentLoader, addressBookService, controllerExceptionHandler)
 {
 }
        protected override void OnInit(EventArgs e)
        {
            // IContainerAccessor
            accessor = Context.ApplicationInstance as IContainerAccessor;

            if (accessor == null || accessor.Container == null)
                throw new InvalidOperationException("Castle not configured properly");

            svcAdddress = accessor.Container.Resolve<IAddressBookService>();
        }
 protected override void OnInit(EventArgs e)
 {
     svcAdddress = Master.accessor.Container.Resolve<IAddressBookService>();
 }
 public CheckoutControllerForTest(
     IContentRepository contentRepository,
     IMailService mailService,
     LocalizationService localizationService,
     ICurrencyService currencyService,
     ControllerExceptionHandler controllerExceptionHandler,
     CustomerContextFacade customerContextFacade,
     IOrderRepository orderRepository,
     CheckoutViewModelFactory checkoutViewModelFactory,
     IOrderGroupCalculator orderGroupCalculator,
     IPaymentProcessor paymentProcessor,
     IPromotionEngine promotionEngine,
     ICartService cartService,
     IAddressBookService addressBookService,
     OrderSummaryViewModelFactory orderSummaryViewModelFactory,
     IOrderFactory orderFactory
     )
     : base(contentRepository,
           mailService,
           localizationService,
           currencyService,
           controllerExceptionHandler,
           customerContextFacade,
           orderRepository,
           checkoutViewModelFactory,
           orderGroupCalculator,
           paymentProcessor,
           promotionEngine,
           cartService,
           addressBookService,
           orderSummaryViewModelFactory,
           orderFactory)
 {
 }