Exemplo n.º 1
0
        private OrderInfo UpdateOrderStatus(int orderID, OrderInfo.OrderStatusList orderStatus)
        {
            OrderController orderController = new OrderController();
            OrderInfo order = orderController.GetOrder(orderID);

            switch (orderStatus)
            {
                case OrderInfo.OrderStatusList.Cancelled:
                    order.OrderStatusID = 6;
                    break;
                case OrderInfo.OrderStatusList.Paid:
                    order.OrderStatusID = 7;
                    break;
            }

            orderController.UpdateOrder(order.OrderID, order.OrderDate, order.OrderNumber, order.ShippingAddressID, order.BillingAddressID, order.Tax, order.ShippingCost, true, order.OrderStatusID, order.CustomerID);

            return order;
        }
Exemplo n.º 2
0
 private void CancelOrder(int orderID)
 {
     OrderController orderController = new OrderController();
     OrderInfo orderInfo = orderController.GetOrder(orderID);
     orderInfo.OrderStatusID = (int)OrderInfo.OrderStatusList.Cancelled;
     orderController.UpdateOrder(orderInfo.OrderID, orderInfo.OrderDate, orderInfo.OrderNumber, orderInfo.ShippingAddressID, orderInfo.BillingAddressID, orderInfo.Tax, orderInfo.ShippingCost, true, orderInfo.OrderStatusID, orderInfo.CustomerID);
     //SendOrderStatusChangeEmail(orderInfo.CustomerID, orderInfo.OrderID, GetOrderStatus(orderInfo.OrderStatusID), false, true);
     SendOrderStatusChangeEmail(orderInfo.CustomerID, orderInfo.OrderID, GetOrderStatus(orderInfo.OrderStatusID, orderInfo.OrderIsPlaced), false, true);
 }
Exemplo n.º 3
0
        private void lnkbtnSave_Click(object sender, EventArgs e)
        {
            //Update the order status...
            OrderController orderController = new OrderController();
            OrderInfo orderInfo = orderController.GetOrder(customerNav.OrderID);

            if (orderInfo != null)
            {
                orderController.UpdateOrder(orderInfo.OrderID, orderInfo.OrderDate, orderInfo.OrderNumber, orderInfo.ShippingAddressID, orderInfo.BillingAddressID, orderInfo.Tax, orderInfo.ShippingCost, true, Convert.ToInt32(ddlOrderStatus.SelectedValue), orderInfo.CustomerID);
                SendOrderStatusChangeEmail(orderInfo.CustomerID, orderInfo.OrderID, ddlOrderStatus.SelectedItem.Text, ddlOrderStatus.SelectedItem.Value == "2", false);
                customerNav.OrderID = Null.NullInteger;
                Response.Redirect(customerNav.GetNavigationUrl(), false);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Calculate the final order and place it into a "waiting for payment" state.
        /// </summary>
        /// <returns>OrderInfo with the final cart, tax, and shipping totals.</returns>
        public OrderInfo GetFinalizedOrderInfo()
        {
            // Save the address information, so that it can be associated with the order.
            //
            // NOTE: This may just update the address with duplicate information, but it is easier than
            //       trying to determine if a change was made the existing address.  In the future the
            //       AddressProvider may be able to supply a "Modified" property.
            AddressController controller = new AddressController();

            int m_BillingAddressID = 0;
            int m_ShippingAddressID = 0;

            if (Null.IsNull(BillingAddress.AddressID) || BillingAddress.AddressID == -1)
            {
                BillingAddress.PortalID = this.PortalId;
                BillingAddress.UserID = this.UserId;
                m_BillingAddressID = controller.AddAddress(BillingAddress);
            }
            else
            {
                controller.UpdateAddress(BillingAddress);
            }

            if (Null.IsNull(ShippingAddress.AddressID) || ShippingAddress.AddressID == -1)
            {
                ShippingAddress.PortalID = this.PortalId;
                ShippingAddress.UserID = this.UserId;

                if (ShippingAddress.Address1.Length == 0)
                {
                    m_ShippingAddressID = controller.AddAddress(BillingAddress);
                }
                else
                {
                    m_ShippingAddressID = controller.AddAddress(ShippingAddress);
                }
            }
            else
            {
                controller.UpdateAddress(ShippingAddress);
            }

            //Now that the addresses are saved update the tax and shipping.
            //CalculateTaxandShipping(_orderInfo);

            //Save order details
            OrderController orderController = new OrderController();
            orderController.UpdateOrder(_orderInfo.OrderID, System.DateTime.Now,
                "",
                m_ShippingAddressID,
                m_BillingAddressID,
                _orderInfo.Tax,
                _orderInfo.ShippingCost,
                true,
                1,
                UserId);

            BillingAddress = controller.GetAddress(m_BillingAddressID);
            ShippingAddress = controller.GetAddress(m_ShippingAddressID);

            //throw new NotImplementedException("gfhgfH");

            return _orderInfo;
        }