예제 #1
0
        public CreateAutoOrderRequest(IOrderConfiguration configuration, AutoOrderPaymentType paymentType, DateTime startDate, int shipMethodID, IEnumerable <IShoppingCartItem> items, ShippingAddress address)
        {
            WarehouseID  = configuration.WarehouseID;
            PriceType    = configuration.PriceTypeID;
            CurrencyCode = configuration.CurrencyCode;
            StartDate    = startDate;
            PaymentType  = paymentType;
            ProcessType  = AutoOrderProcessType.AlwaysProcess;
            ShipMethodID = shipMethodID;

            // Add all kit children under their parents. Add missing kit children
            // Will throw exception if dynamic kit children cannot be auto populated due to insuficient cart info
            IItemConverterService shoppingService = new Common.Services.ShoppingService(configuration);
            var details = shoppingService.GetOrderDetails(items.ToList());

            Details = details.ToArray();

            FirstName  = address.FirstName;
            MiddleName = address.MiddleName;
            LastName   = address.LastName;
            Company    = address.Company;
            Email      = address.Email;
            Phone      = address.Phone;
            Address1   = address.Address1;
            Address2   = address.Address2;
            City       = address.City;
            State      = address.State;
            Zip        = address.Zip;
            Country    = address.Country;
        }
        public JsonNetResult SetAutoOrderPaymentMethodPreference(int autoorderid, AutoOrderPaymentType type)
        {
            try
            {
                Exigo.UpdateCustomerAutoOrderPaymentMethod(Identity.Customer.CustomerID, autoorderid, type);

                var model   = Exigo.GetCustomerAutoOrder(Identity.Customer.CustomerID, autoorderid);
                var partial = RenderPartialViewToString("displaytemplates/autoorderrow", model);

                return(new JsonNetResult(new
                {
                    success = true,
                    html = partial,
                    autoorderid = autoorderid
                }));
            }
            catch (Exception ex)
            {
                return(new JsonNetResult(new
                {
                    success = false,
                    message = ex.Message
                }));
            }
        }
        public CreateAutoOrderRequest(IOrderConfiguration configuration, AutoOrderPaymentType paymentType, DateTime startDate, int shipMethodID, IEnumerable <IShoppingCartItem> items, ShippingAddress address)
        {
            WarehouseID  = configuration.WarehouseID;
            PriceType    = configuration.PriceTypeID;
            CurrencyCode = configuration.CurrencyCode;
            StartDate    = startDate;
            PaymentType  = paymentType;
            ProcessType  = AutoOrderProcessType.AlwaysProcess;
            ShipMethodID = shipMethodID;

            Details = items.Select(c => (OrderDetailRequest)(c as ShoppingCartItem)).ToArray();

            FirstName  = address.FirstName;
            MiddleName = address.MiddleName;
            LastName   = address.LastName;
            Company    = address.Company;
            Email      = address.Email;
            Phone      = address.Phone;
            Address1   = address.Address1;
            Address2   = address.Address2;
            City       = address.City;
            State      = address.State;
            Zip        = address.Zip;
            Country    = address.Country;
        }
예제 #4
0
 public static int GetAutoOrderPaymentTypeID(AutoOrderPaymentType autoOrderPaymentType)
 {
     try
     {
         return(AutoOrderPaymentTypeBindings.FirstOrDefault(c => c.Key == autoOrderPaymentType).Value);
     }
     catch
     {
         throw new Exception("Corresponding int not found for AutoOrderPaymentType {0}.".FormatWith(autoOrderPaymentType.ToString()));
     }
 }
        public CreateAutoOrderRequest(IAutoOrderConfiguration configuration, AutoOrderPaymentType paymentType, DateTime startDate, int shipMethodID, IEnumerable<IShoppingCartItem> items, ShippingAddress address)
        {
            WarehouseID  = configuration.WarehouseID;
            PriceType    = configuration.PriceTypeID;
            CurrencyCode = configuration.CurrencyCode;
            StartDate    = startDate;
            PaymentType  = paymentType;
            ProcessType  = AutoOrderProcessType.AlwaysProcess;
            ShipMethodID = shipMethodID;

            Details      = items.Select(c => (OrderDetailRequest)(c as ShoppingCartItem)).ToArray();

            FirstName    = address.FirstName;
            LastName     = address.LastName;
            Email        = address.Email;
            Phone        = address.Phone;
            Address1     = address.Address1;
            Address2     = address.Address2;
            City         = address.City;
            State        = address.State;
            Zip          = address.Zip;
            Country      = address.Country;
        }
예제 #6
0
        public static void UpdateCustomerAutoOrderPaymentMethod(int customerID, int autoOrderID, AutoOrderPaymentType type)
        {
            // Re-create the autoorder
            var request = GetCreateOverridenAutoOrderRequest(customerID, autoOrderID);

            if (request == null)
            {
                return;
            }

            request.PaymentType = type;


            // Update the autoorder
            var response = Exigo.WebService().CreateAutoOrder(request);
        }
예제 #7
0
 public static AutoOrderPaymentType CreateAutoOrderPaymentType(int autoOrderPaymentTypeID)
 {
     AutoOrderPaymentType autoOrderPaymentType = new AutoOrderPaymentType();
     autoOrderPaymentType.AutoOrderPaymentTypeID = autoOrderPaymentTypeID;
     return autoOrderPaymentType;
 }
예제 #8
0
 public void AddToAutoOrderPaymentTypes(AutoOrderPaymentType autoOrderPaymentType)
 {
     base.AddObject("AutoOrderPaymentTypes", autoOrderPaymentType);
 }
예제 #9
0
        public static void UpdateCustomerAutoOrderPaymentMethod(int customerID, int autoOrderID, AutoOrderPaymentType type)
        {
            // Re-create the autoorder
            var request = GetCreateOverridenAutoOrderRequest(customerID, autoOrderID);
            if (request == null) return;

            request.PaymentType = type;

            // Update the autoorder
            var response = Exigo.WebService().CreateAutoOrder(request);
        }
        public JsonNetResult SetAutoOrderPaymentMethodPreference(int autoorderid, AutoOrderPaymentType type)
        {
            try
            {
                Exigo.UpdateCustomerAutoOrderPaymentMethod(Identity.Customer.CustomerID, autoorderid, type);

                var model = Exigo.GetCustomerAutoOrder(Identity.Customer.CustomerID, autoorderid);
                var partial = RenderPartialViewToString("displaytemplates/autoorderrow", model);

                return new JsonNetResult(new
                {
                    success = true,
                    html = partial,
                    autoorderid = autoorderid
                });
            }
            catch (Exception ex)
            {
                return new JsonNetResult(new
                {
                    success = false,
                    message = ex.Message
                });
            }
        }