public ProductController(ICalculationService calculationService, IProductRepository productRepository, IVariantRepository variantRepository, TypedProductViewModelFactory typedProductViewModelFactory) { mCalculationService = calculationService; mProductRepository = productRepository; mVariantRepository = variantRepository; mTypedProductViewModelFactory = typedProductViewModelFactory; }
/// <summary> /// Constructor. /// You can use a dependency injection container to initialize the services and repositories. /// </summary> public ProductController() { //DocSection:InitializeServices shoppingService = new ShoppingService(); pricingService = new PricingService(); variantRepository = new KenticoVariantRepository(); //EndDocSection:InitializeServices }
public VariantController(IVariantRepository repository, string catalog, LoginView view) { this._LoginId = view.LoginId.ToLong(); this._UserId = view.UserId.ToInt(); this._OfficeId = view.OfficeId.ToInt(); this._Catalog = catalog; this.VariantRepository = repository; }
public void FixtureSetUp() { InsertDefaultSite(); variantRepository = new KenticoVariantRepository(); SetUpOptionCategories(); SetUpVariants(); }
public ProductController(IPageDataContextRetriever dataRetriever, ICalculationService calculationService, IVariantRepository variantRepository, TypedProductViewModelFactory typedProductViewModelFactory, IShoppingService shoppingService, ISKUInfoProvider skuInfoProvider) { this.dataRetriever = dataRetriever; this.calculationService = calculationService; this.variantRepository = variantRepository; this.typedProductViewModelFactory = typedProductViewModelFactory; this.shoppingService = shoppingService; this.skuInfoProvider = skuInfoProvider; }
public VariantController() { this._LoginId = AppUsers.GetCurrent().View.LoginId.ToLong(); this._UserId = AppUsers.GetCurrent().View.UserId.ToInt(); this._OfficeId = AppUsers.GetCurrent().View.OfficeId.ToInt(); this._Catalog = AppUsers.GetCurrentUserDB(); this.VariantRepository = new MixERP.Net.Schemas.Core.Data.Variant { _Catalog = this._Catalog, _LoginId = this._LoginId, _UserId = this._UserId }; }
public void SetUp() { Fake <SKUInfo, SKUInfoProvider>().WithData(sku = new SKUInfo { SKUID = SKU_ID }, variant = new SKUInfo { SKUID = VARIANT_ID }); Fake <VariantOptionInfo, VariantOptionInfoProvider>().WithData(); page = Substitute.For <SKUTreeNode>(); retiever = Substitute.For <IPageDataContextRetriever>(); variantRepository = Substitute.For <IVariantRepository>(); controller = new ProductController(retiever, null, variantRepository, null, null, SKUInfo.Provider); }
public VariantsController(RegistrationDbContext context) { _variantRepository = new VariantRepository(context); }
public RfidController(RegistrationDbContext context) { _studentRepository = new StudentRepository(context); _variantRepository = new VariantRepository(context); }
public VariantManager(IVariantRepository variantRepository) : base(variantRepository) { _variantrepository = variantRepository; }
public VariantController(IVariantRepository repo) => _repo = repo;
public VariantService(IVariantRepository variantRepository) : base(variantRepository) { _variantRepository = variantRepository; }
public VariantController(IVariantRepository variantRepository) { _vRepository = variantRepository; }
//EndDocSection:DifferentShippingAddress private object DummyEcommerceMethod() { IPricingService pricingService = null; ShoppingCart shoppingCart = null; SKUInfo productSku = null; Variant variant = null; IVariantRepository mVariantRepository = null; SKUTreeNode product = null; SKUInfo sku = null; DummyViewModel model = null; Order order = null; PaymentResultInfo result = null; //DocSection:CalculatePriceOptions ProductPrice productPrice = pricingService.CalculatePrice(productSku, shoppingCart); //EndDocSection:CalculatePriceOptions //DocSection:FormatPriceOptions decimal price = 5.50M; string formattedPrice = shoppingCart.Currency.FormatPrice(price); //EndDocSection:FormatPriceOptions //DocSection:VariantDisplayImg var response = new { // ... imagePath = Url.Content(variant.ImagePath) }; //EndDocSection:VariantDisplayImg //DocSection:DisplayAttributeSelection // Gets the cheapest variant from the product List <Variant> variants = mVariantRepository.GetByProductId(product.NodeSKUID).OrderBy(v => v.VariantPrice).ToList(); Variant cheapestVariant = variants.FirstOrDefault(); // Gets the product's option categories. IEnumerable <ProductOptionCategory> categories = mVariantRepository.GetVariantOptionCategories(sku.SKUID); // Gets the cheapest variant's selected attributes IEnumerable <ProductOptionCategoryViewModel> variantCategories = cheapestVariant?.ProductAttributes.Select( option => new ProductOptionCategoryViewModel(option.SKUID, categories.FirstOrDefault(c => c.ID == option.SKUOptionCategoryID))); //EndDocSection:DisplayAttributeSelection //DocSection:ShippingIsDifferent if (model.ShippingAddressIsDifferent) { // ... } //EndDocSection:ShippingIsDifferent //DocSection:DifferentPaymentMethods if (shoppingCart.PaymentMethod.PaymentOptionName.Equals("PaymentMethodCodeName")) { return(RedirectToAction("ActionForPayment", "MyPaymentGateway")); } //EndDocSection:DifferentPaymentMethods //DocSection:SetPaymentResult order.SetPaymentResult(result); //EndDocSection:SetPaymentResult //DocSection:RedirectForManualPayment return(RedirectToAction("ThankYou", new { orderID = order.OrderID })); //EndDocSection:RedirectForManualPayment }
public VariantService(IVariantRepository variantRepository, IMapper mapper) { _variantRepository = variantRepository; _mapper = mapper; }
public AnnotationController() { var db = new LighthouseContext(); _variants = new VariantRepository(db); }