billinaction.cs
来自「ibatis源码及帮助文档(IBatis源码+xsd+帮助)」· CS 代码 · 共 56 行
CS
56 行
using System;
using System.Web;
using NPetshop.Domain.Accounts;
using NPetshop.Domain.Billing;
using NPetshop.Presentation.Core;
using NPetshop.Service;
namespace NPetshop.Presentation.UserActions
{
/// <summary>
/// Summary description for BillinAction.
/// </summary>
public class BillinAction : AbstractWebAction
{
private static readonly BillingService _billingService = BillingService.GetInstance();
public BillinAction(HttpContext context) : base(context)
{
}
public void NewOrder(Order order, bool shipToBillinAddress)
{
if (shipToBillinAddress)
{
order.ShippingAddress = order.BillingAddress;
singleton.CurrentOrder = order;
this.nextViewToDisplay = WebViews.CONFIRMATION;
}
else
{
this.nextViewToDisplay = WebViews.SHIPPING;
}
}
public void SubmitShippingAddress(Address address)
{
singleton.CurrentOrder.ShippingAddress = address;
this.nextViewToDisplay = WebViews.CONFIRMATION;
}
public void ConfirmOrder(Order order)
{
// save the order
_billingService.InsertOrder(order);
singleton.CurrentShoppingCart = ShoppinAction.CreateNewShoppingCart();
this.nextViewToDisplay = WebViews.BILLING;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?