public GBSOrderController(
     Factories.IOrderModelFactory orderModelFactory,
     IOrderService orderService,
     ICcService ccService,
     CcSettings ccSettings,
     GBSOrderSettings gbsOrderSettings,
     ILocalizationService localizationService,
     ISettingService settingService,
     IStoreService storeService,
     IWorkContext workContext,
     ILogger logger,
     IStoreContext storeContext,
     IPluginFinder pluginFinder,
     IHttpContextAccessor httpContextAccessor,
     IGBSOrderService gbsOrderService)
 {
     this._orderModelFactory   = orderModelFactory;
     this._orderService        = orderService;
     this._ccService           = ccService;
     this._ccSettings          = ccSettings;
     this._gbsOrderSettings    = gbsOrderSettings;
     this._localizationService = localizationService;
     this._settingService      = settingService;
     this._storeService        = storeService;
     this._workContext         = workContext;
     this._logger              = logger;
     this._storeContext        = storeContext;
     this._pluginFinder        = pluginFinder;
     this._httpContextAccessor = httpContextAccessor;
     this._gbsOrderService     = gbsOrderService; // EngineContext.Current.Resolve<GBSOrderService>(); //(GBSOrderService)System.Web.Mvc.DependencyResolver.Current.GetServices(typeof(GBSOrderService));
 }
Exemple #2
0
        public List <Nop.Web.Models.Order.CustomerOrderListModel.OrderDetailsModel> getLegacyOrders()
        {
            GBSOrderSettings            _gbsOrderSettings = EngineContext.Current.Resolve <GBSOrderSettings>();
            IWorkContext                _workContext      = EngineContext.Current.Resolve <IWorkContext>();
            Customer                    customer          = _workContext.CurrentCustomer;
            Dictionary <string, Object> paramDicEx        = new Dictionary <string, Object>();
            var myOrders = new List <CustomerOrderListModel.OrderDetailsModel>();

            //_logger.Information("Entered getLegacyOrders");

            try
            {
                paramDicEx.Add("@email", customer.Email);
                paramDicEx.Add("@website", _gbsOrderSettings.GBSStoreNamePrepend);

                DBManager manager = new DBManager(_gbsOrderSettings.HOMConnectionString);
                string    select  = "EXEC usp_getLegacyOrdersForNOP @email, @website";

                string jsonResult = manager.GetParameterizedJsonString(select, paramDicEx);
                myOrders = JsonConvert.DeserializeObject <List <CustomerOrderListModel.OrderDetailsModel> >(jsonResult);
                //_logger.Information("getLegacyOrders() - myOrders.count = " + (myOrders != null ? Convert.ToString(myOrders.Count()) : "NULL"));
            }
            catch (Exception ex)
            {
                _logger.Error("Error in GBS Order Extensions getLegacyOrders() - myOrders.count = " + (myOrders != null ? Convert.ToString(myOrders.Count()) : "NULL"), ex, customer);
                throw ex;
            }
            return(myOrders);
        }
Exemple #3
0
        public GBSOrderModelFactory(IAddressModelFactory addressModelFactory,
                                    IOrderService orderService,
                                    IWorkContext workContext,
                                    ICurrencyService currencyService,
                                    IPriceFormatter priceFormatter,
                                    IOrderProcessingService orderProcessingService,
                                    IDateTimeHelper dateTimeHelper,
                                    IPaymentService paymentService,
                                    ILocalizationService localizationService,
                                    IShippingService shippingService,
                                    ICountryService countryService,
                                    IProductAttributeParser productAttributeParser,
                                    IDownloadService downloadService,
                                    IStoreContext storeContext,
                                    IOrderTotalCalculationService orderTotalCalculationService,
                                    IRewardPointService rewardPointService,
                                    CatalogSettings catalogSettings,
                                    OrderSettings orderSettings,
                                    TaxSettings taxSettings,
                                    ShippingSettings shippingSettings,
                                    AddressSettings addressSettings,
                                    RewardPointsSettings rewardPointsSettings,
                                    PdfSettings pdfSettings,
                                    IPluginFinder pluginFinder,
                                    GBSOrderSettings gbsOrderSettings,
                                    ILogger logger) : base(
                addressModelFactory,
                orderService,
                workContext,
                currencyService,
                priceFormatter,
                orderProcessingService,
                dateTimeHelper,
                paymentService,
                localizationService,
                shippingService,
                countryService,
                productAttributeParser,
                downloadService,
                storeContext,
                orderTotalCalculationService,
                rewardPointService,
                catalogSettings,
                orderSettings,
                taxSettings,
                shippingSettings,
                addressSettings,
                rewardPointsSettings,
                pdfSettings
                )
        {
            this._addressModelFactory          = addressModelFactory;
            this._orderService                 = orderService;
            this._workContext                  = workContext;
            this._currencyService              = currencyService;
            this._priceFormatter               = priceFormatter;
            this._orderProcessingService       = orderProcessingService;
            this._dateTimeHelper               = dateTimeHelper;
            this._paymentService               = paymentService;
            this._localizationService          = localizationService;
            this._shippingService              = shippingService;
            this._countryService               = countryService;
            this._productAttributeParser       = productAttributeParser;
            this._downloadService              = downloadService;
            this._storeContext                 = storeContext;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._rewardPointService           = rewardPointService;

            this._catalogSettings      = catalogSettings;
            this._orderSettings        = orderSettings;
            this._taxSettings          = taxSettings;
            this._shippingSettings     = shippingSettings;
            this._addressSettings      = addressSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._pdfSettings          = pdfSettings;

            this._pluginFinder     = pluginFinder;
            this._gbsOrderSettings = gbsOrderSettings;
            this._logger           = logger;
        }