?? orderinfo.cs
字號:
?using System;
/// <summary>
/// 訂單實體
/// </summary>
[Serializable]
public class OrderInfo
{
// 內部變量
private int orderId;
private DateTime date;
private string userId;
private PayInfo creditCard;
private AddressInfo billingAddress;
private AddressInfo shippingAddress;
private decimal orderTotal;
private LineItemInfo[] lineItems;
/// <summary>
/// 默認的構造函數
/// </summary>
public OrderInfo() { }
/// <summary>
/// 帶參數的構造函數
/// </summary>
/// <param name="orderId">訂單ID</param>
/// <param name="date">訂單提交日期</param>
/// <param name="userId">用戶ID</param>
/// <param name="creditCard">付款信息</param>
/// <param name="billing">帳戶地址</param>
/// <param name="shipping">送貨地址</param>
/// <param name="total">訂單總額</param>
/// <param name="line">訂單內容</param>
public OrderInfo(int orderId, DateTime date, string userId, PayInfo creditCard, AddressInfo billing, AddressInfo shipping, decimal total, LineItemInfo[] line)
{
this.orderId = orderId;
this.date = date;
this.userId = userId;
this.creditCard = creditCard;
this.billingAddress = billing;
this.shippingAddress = shipping;
this.orderTotal = total;
this.lineItems = line;
}
// 公共屬性
public int OrderId
{
get { return orderId; }
set { orderId = value; }
}
public DateTime Date
{
get { return date; }
set { date = value; }
}
public string UserId
{
get { return userId; }
set { userId = value; }
}
public PayInfo CreditCard
{
get { return creditCard; }
set { creditCard = value; }
}
public AddressInfo BillingAddress
{
get { return billingAddress; }
set { billingAddress = value; }
}
public AddressInfo ShippingAddress
{
get { return shippingAddress; }
set { shippingAddress = value; }
}
public decimal OrderTotal
{
get { return orderTotal; }
set { orderTotal = value; }
}
public LineItemInfo[] LineItems
{
get { return lineItems; }
set { lineItems = value; }
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -