/// <summary> /// Creates a new order /// </summary> public void CheckoutOrder() { if (this.State == null) { throw new ApplicationException(ResourceManager.GetString("RES_ExceptionStateRequired")); } try { CartTaskBusinessObject cartBO = new CartTaskBusinessObject(); // retrieve the customerID for the customer that is performing the current task int customerId = cartBO.GetCustomerFromTask(State.TaskId); // create a new order object and fill it with orderdetail items OrderBusinessObject orderBO = new OrderBusinessObject(); orderBO.CreateOrderFromCart(customerId, Cart.CartItems); State.NavigateValue = "checkout"; } catch (Exception e) { State[STATE_EXCEPTION] = e; State.NavigateValue = "fail"; } Navigate(); }
/// <summary> /// Creates a new order /// </summary> public void CheckoutOrder() { if (this.State == null) { throw new ApplicationException(ResourceManager.GetString("RES_ExceptionStateRequired")); } try { CartTaskBusinessObject cartBO = new CartTaskBusinessObject(); int customerId = cartBO.GetCustomerFromTask(State.TaskId); OrderBusinessObject orderBO = new OrderBusinessObject(); orderBO.CreateOrderFromCart(customerId, Cart.CartItems); State.NavigateValue = "checkout"; } catch (Exception e) { State[STATE_EXCEPTION] = e; State.NavigateValue = "error"; } Navigate(); }